Go to the documentation of this file.00001
00023 #ifndef PACKET_PARSER_H_
00024 #define PACKET_PARSER_H_
00025
00026 #include <iostream>
00027 #include <time.h>
00028 #include <vector>
00029 #include <map>
00030
00031 #include "micros_swarm/singleton.h"
00032 #include "micros_swarm/packet_type.h"
00033 #include "micros_swarm/serialize.h"
00034 #include "micros_swarm/check_neighbor.h"
00035 #include "micros_swarm/runtime_handle.h"
00036 #include "micros_swarm/msg_queue_manager.h"
00037
00038 #include "gsdf_msgs/CommHeader.h"
00039 #include "gsdf_msgs/CommContent.h"
00040 #include "gsdf_msgs/CommPacket.h"
00041 #include "gsdf_msgs/RobotBase.h"
00042 #include "gsdf_msgs/JoinSwarm.h"
00043 #include "gsdf_msgs/LeaveSwarm.h"
00044 #include "gsdf_msgs/SwarmList.h"
00045 #include "gsdf_msgs/VirtualStigmergyQuery.h"
00046 #include "gsdf_msgs/VirtualStigmergyPut.h"
00047 #include "gsdf_msgs/VirtualStigmergyPuts.h"
00048 #include "gsdf_msgs/BlackBoardQuery.h"
00049 #include "gsdf_msgs/BlackBoardAck.h"
00050 #include "gsdf_msgs/BlackBoardPut.h"
00051 #include "gsdf_msgs/SCDSPSOGet.h"
00052 #include "gsdf_msgs/SCDSPSOPut.h"
00053 #include "gsdf_msgs/NeighborBroadcastKeyValue.h"
00054 #include "gsdf_msgs/BarrierSyn.h"
00055 #include "gsdf_msgs/BarrierAck.h"
00056
00057 namespace micros_swarm{
00058
00059 class PacketParser{
00060 public:
00061 PacketParser();
00062 ~PacketParser();
00063 void parse(const std::vector<uint8_t>& data);
00064 void parse(const std::vector<char>& data);
00065 void parse(uint8_t* data, int len);
00066 void parse(char* data, int len);
00067 private:
00068 boost::shared_ptr<micros_swarm::RuntimeHandle> rth_;
00069 boost::shared_ptr<CheckNeighborInterface> cni_;
00070 boost::shared_ptr<micros_swarm::MsgQueueManager> mqm_;
00071 };
00072 };
00073
00074 #endif