MRPT  1.9.9
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-2018, 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
13  * and a size
14 */
16 {
17  public:
18  /** The offset of the first byte of the message or -1 if no message */
20  /** The size of the message, when less than 0 it indicates the expected
21  * message size */
22  int m_size;
23 
24  /*! \brief Constructor, initializes by default to an invalid message
25  \param start The offset of the first byte of the message
26  \param size The size of the message
27  \sa isValid() \sa m_startPos \sa m_size \sa
28  IProtocolHandler::findMessage
29  */
30  MessageLocation(int start = -1, int size = 0)
32  {
33  }
34 
35  /*! \brief Returns whether the stored message information describes a valid
36  * message
37  */
38  inline bool isValid() const { return m_startPos >= 0 && m_size > 0; }
39 };
40 
41 #endif // file guard
Stores the location of a message in a buffer using a start position and a size.
MessageLocation(int start=-1, int size=0)
Constructor, initializes by default to an invalid message.
int m_size
The size of the message, when less than 0 it indicates the expected message size.
int m_startPos
The offset of the first byte of the message or -1 if no message.
bool isValid() const
Returns whether the stored message information describes a valid message.
GLuint start
Definition: glext.h:3528
GLsizeiptr size
Definition: glext.h:3923



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 814d80880 Fri Aug 24 01:51:28 2018 +0200 at mar 26 may 2026 12:30:59 CEST