00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 00003 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00004 00024 // -- END LICENSE BLOCK ------------------------------------------------ 00025 00026 //---------------------------------------------------------------------- 00033 //---------------------------------------------------------------------- 00034 00035 #ifndef SICK_SAFETYSCANNERS_DATASTRUCTURE_PARSEDPACKETBUFFER_H 00036 #define SICK_SAFETYSCANNERS_DATASTRUCTURE_PARSEDPACKETBUFFER_H 00037 00038 #include <iostream> 00039 #include <stdint.h> 00040 #include <string> 00041 #include <vector> 00042 00043 #include <boost/array.hpp> 00044 #include <boost/asio.hpp> 00045 00046 #include <sick_safetyscanners/datastructure/DatagramHeader.h> 00047 #include <sick_safetyscanners/datastructure/PacketBuffer.h> 00048 00049 00050 namespace sick { 00051 namespace datastructure { 00052 00053 00057 class ParsedPacketBuffer 00058 { 00059 public: 00060 typedef std::vector<ParsedPacketBuffer> ParsedPacketBufferVector; 00061 00067 ParsedPacketBuffer(const sick::datastructure::PacketBuffer& packet_buffer, 00068 sick::datastructure::DatagramHeader datagram_header); 00069 00076 static bool sortForIncreasingOffset(const ParsedPacketBuffer& ppb1, 00077 const ParsedPacketBuffer& ppb2) 00078 { 00079 return ppb1.m_datagram_header.getFragmentOffset() < ppb2.m_datagram_header.getFragmentOffset(); 00080 } 00081 00086 sick::datastructure::PacketBuffer getPacketBuffer() const; 00087 00092 void setPacketBuffer(const sick::datastructure::PacketBuffer& packet_buffer); 00093 00094 private: 00098 sick::datastructure::PacketBuffer m_packet_buffer; 00099 00103 sick::datastructure::DatagramHeader m_datagram_header; 00104 }; 00105 00106 00107 } // namespace datastructure 00108 } // namespace sick 00109 00110 #endif // SICK_SAFETYSCANNERS_DATASTRUCTURE_PACKETBUFFER_H