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;
68 
72  PacketBuffer();
73 
81  PacketBuffer(const std::vector<uint8_t>& buffer);
82 
88  PacketBuffer(const ArrayBuffer& buffer, const size_t& length);
89 
94  static uint32_t getMaxSize() { return MAXSIZE; }
95 
100  std::shared_ptr<std::vector<uint8_t> const> getBuffer() const;
101 
106  void setBuffer(const std::vector<uint8_t>& buffer);
107 
113  void setBuffer(const ArrayBuffer& buffer, const size_t& length);
114 
119  size_t getLength() const;
120 
121 
122 private:
123  std::shared_ptr<std::vector<uint8_t> const> m_buffer;
124 };
125 
126 } // namespace datastructure
127 } // namespace sick
128 
129 #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
std::shared_ptr< std::vector< uint8_t > const > getBuffer() const
Getter to return a copy of the data saved in the PacketBuffer.
static uint32_t getMaxSize()
Returns defined maximum size of PacketBuffer.
Definition: PacketBuffer.h:94
size_t getLength() const
Returns length of the current PacketBuffer.
const uint32_t MAXSIZE
MAXSIZE of the packetbuffer.
Definition: PacketBuffer.h:56
std::shared_ptr< std::vector< uint8_t > const > m_buffer
Definition: PacketBuffer.h:123
void setBuffer(const std::vector< uint8_t > &buffer)
Setter for the PacketBuffer.
PacketBuffer()
Constructor of PacketBuffer.


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Apr 2 2021 02:45:41