Main MRPT website > C++ reference for MRPT 1.5.7
messagelocation.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef MESSAGELOCATION_H
10 #define MESSAGELOCATION_H
11 
12 /*! \brief Stores the location of a message in a buffer using a start position and a size
13 */
15 public:
16  int m_startPos; //!< The offset of the first byte of the message or -1 if no message
17  int m_size; //!< The size of the message, when less than 0 it indicates the expected message size
18 
19  /*! \brief Constructor, initializes by default to an invalid message
20  \param start The offset of the first byte of the message
21  \param size The size of the message
22  \sa isValid() \sa m_startPos \sa m_size \sa IProtocolHandler::findMessage
23  */
24  MessageLocation(int start = -1, int size = 0)
25  : m_startPos(start)
26  , m_size(size)
27  {}
28 
29  /*! \brief Returns whether the stored message information describes a valid message
30  */
31  inline bool isValid() const
32  {
33  return m_startPos >= 0 && m_size > 0;
34  }
35 };
36 
37 #endif // file guard
MessageLocation(int start=-1, int size=0)
Constructor, initializes by default to an invalid message.
Stores the location of a message in a buffer using a start position and a size.
int m_startPos
The offset of the first byte of the message or -1 if no message.
int m_size
The size of the message, when less than 0 it indicates the expected message size. ...
GLsizeiptr size
Definition: glext.h:3779
GLuint start
Definition: glext.h:3512
bool isValid() const
Returns whether the stored message information describes a valid message.



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019