PacketBuffer.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 
24 // -- END LICENSE BLOCK ------------------------------------------------
25 
26 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 
35 #ifndef SICK_SAFETYSCANNERS_DATASTRUCTURE_PACKETBUFFER_H
36 #define SICK_SAFETYSCANNERS_DATASTRUCTURE_PACKETBUFFER_H
37 
38 #include <iostream>
39 #include <stdint.h>
40 #include <string>
41 #include <vector>
42 
43 #include <boost/array.hpp>
44 #include <boost/asio.hpp>
45 
48 
49 
50 namespace sick {
51 namespace datastructure {
52 
56 const uint32_t MAXSIZE = 10000;
57 
62 {
63 public:
67  typedef boost::array<uint8_t, MAXSIZE> ArrayBuffer;
71  typedef std::vector<uint8_t> VectorBuffer;
72 
76  PacketBuffer();
77 
85  PacketBuffer(const VectorBuffer& buffer);
86 
92  PacketBuffer(const ArrayBuffer& buffer, const size_t& length);
93 
98  static uint32_t getMaxSize() { return MAXSIZE; }
99 
104  const VectorBuffer& getBuffer() const;
105 
110  void setBuffer(const VectorBuffer& buffer);
111 
117  void setBuffer(const ArrayBuffer& buffer, const size_t& length);
118 
123  size_t getLength() const;
124 
125 
126 private:
127  VectorBuffer m_buffer;
128 };
129 
130 } // namespace datastructure
131 } // namespace sick
132 
133 #endif // SICK_SAFETYSCANNERS_DATASTRUCTURE_PACKETBUFFER_H
boost::array< uint8_t, MAXSIZE > ArrayBuffer
Typedef for an arraybuffer which can be read from the sensor.
Definition: PacketBuffer.h:67
A packetbuffer for the raw data from the sensor.
Definition: PacketBuffer.h:61
void setBuffer(const VectorBuffer &buffer)
Setter for the PacketBuffer.
const VectorBuffer & getBuffer() const
Getter to return the VectorBuffer saved in the PacketBuffer.
static uint32_t getMaxSize()
Returns defined maximum size of PacketBuffer.
Definition: PacketBuffer.h:98
size_t getLength() const
Returns length of the current PacketBuffer.
const uint32_t MAXSIZE
MAXSIZE of the packetbuffer.
Definition: PacketBuffer.h:56
std::vector< uint8_t > VectorBuffer
Typedef for a vector buffer, to sort the incoming packets.
Definition: PacketBuffer.h:71
PacketBuffer()
Constructor of PacketBuffer.


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Thu May 9 2019 02:41:08