(Static) MsgBuffer Template Definition. This class is a specialization of the template MsgBuffer, and uses a static_storage_policy.
More...
#include <static_msg_buffer.h>
|
| MsgBuffer () |
| Default Constructor.
|
|
void | assign (const_pointer pBuffer, size_t n) |
| Assigns the contents of an incoming raw memory buffer to the message buffer. More...
|
|
size_t | capacity () const |
| Return the number of bytes reserved for use by this buffer. More...
|
|
void | clear () |
| Releases any resources associated with this object.
|
|
const_pointer | data () const |
| Provides access to the packed memory buffer. More...
|
|
bool | empty () const |
| Indicates if memory is currently managed by this buffer. More...
|
|
template<typename T > |
size_t | get_data (T &value, std::ptrdiff_t pos) const |
| Parameterized function that returns data from a specified offset in the buffer. More...
|
|
size_t | get_range (void *pBuffer, size_t length, size_t pos) const |
| Parameterized function that reads a range of data from the buffer. More...
|
|
std::ptrdiff_t | offset () const |
| Returns the offset used to access the buffer. More...
|
|
void | offset (std::ptrdiff_t new_offset) |
| Assigns a new base offset for memory access to this object. More...
|
|
void | resize (size_t n) |
| Resizes the buffer to contain n elements. This function is not supported for this fixed size buffer. More...
|
|
template<typename T > |
size_t | set_data (const T &value, size_t pos) |
| Parameterized function that writes data to a specified offset in the buffer. More...
|
|
template<typename InputIt > |
size_t | set_range (InputIt first, InputIt last, size_t pos) |
| Parameterized function that writes a range of data to the buffer. More...
|
|
size_t | size () const |
| Reports the current size of the buffer in use. More...
|
|
void | zero () |
| Zeroes the contents of the buffer if they have been assigned.
|
|
template<>
class Hg::MsgBuffer< BufferedStaticStoragePolicy >
(Static) MsgBuffer Template Definition. This class is a specialization of the template MsgBuffer, and uses a static_storage_policy.
Definition at line 24 of file static_msg_buffer.h.
Assigns the contents of an incoming raw memory buffer to the message buffer.
- Parameters
-
pBuffer | A memory buffer whose contents will be assigned to this message object. The values of the buffer are copied into the message. |
n | The number of bytes held in p_buffer. |
Definition at line 140 of file static_msg_buffer.h.
Return the number of bytes reserved for use by this buffer.
- Returns
- The allocated buffer size is returned. This packet buffer must be valid for a non-zero value to be returned.
Definition at line 67 of file static_msg_buffer.h.
Provides access to the packed memory buffer.
- Returns
- Returns a constant pointer to the buffer that contains the packed memory. 0 is returned if there is no memory associated with the buffer.
Definition at line 119 of file static_msg_buffer.h.
Indicates if memory is currently managed by this buffer.
- Returns
- true - The buffer is empty. false- There is memory allocated and managed by this buffer.
Definition at line 55 of file static_msg_buffer.h.
Parameterized function that returns data from a specified offset in the buffer.
- Template Parameters
-
T | [typename] The parameterized type to be returned to the caller. |
- Parameters
-
value | Accepts the value read from the packet buffer. |
pos | The offset from the beginning of the buffer to read the output value. |
- Returns
- The number of bytes read from the buffer is returned. It is possible for a successful case to return 0.
Definition at line 184 of file static_msg_buffer.h.
Parameterized function that reads a range of data from the buffer.
- Template Parameters
-
T | [typename] The parameterized type to be read by the caller. |
- Parameters
-
pBuffer | Pointer to the first element in the array to be written into. |
length | The number of bytes to read in. pBuffer must contain at least length number of bytes. |
pos | The offset from the beginning of the buffer to read the input value. |
- Returns
- The number of bytes read from the buffer is returned. It is possible for a successful case to return 0.
Definition at line 230 of file static_msg_buffer.h.
Returns the offset used to access the buffer.
Returns the offset used to access the buffer relative to the first index in the buffer. The default offset is zero. Alternate offsets are allowed to facilitate nested packet structures as well as dynamically formatted structures.
- Returns
- A number of bytes greater than 0 is returned.
Definition at line 156 of file static_msg_buffer.h.
Assigns a new base offset for memory access to this object.
- Parameters
-
new_offset | The offset from the beginning of the supplied buffer. |
Definition at line 166 of file static_msg_buffer.h.
Resizes the buffer to contain n elements. This function is not supported for this fixed size buffer.
- Parameters
-
n | The number of elements to allocate for the buffer. |
val | Optional value to be copied into each element allocated. |
Definition at line 101 of file static_msg_buffer.h.
Parameterized function that writes data to a specified offset in the buffer.
- Template Parameters
-
T | [typename] The parameterized type to be written by the caller. |
- Parameters
-
value | Contains the value to write to the packet buffer. |
pos | The offset from the beginning of the buffer to write the input value. |
- Returns
- The number of bytes written to the buffer is returned. It is possible for a successful case to return 0.
Definition at line 274 of file static_msg_buffer.h.
template<typename InputIt >
Parameterized function that writes a range of data to the buffer.
- Template Parameters
-
T | [typename] The parameterized type to be written by the caller. |
- Parameters
-
first | Contains the first item to write to the buffer. |
last | Contains the item one past the last item to write. This item may point to an element that is not valid to de-reference. Similar to C+++ Standard Library. |
Last must be greater than than the first time, and they must be part of the same range of elements otherwise the behavior is undefined.
- Parameters
-
pos | The offset from the beginning of the buffer to write the input value. |
- Returns
- The number of bytes written to the buffer is returned. It is possible for a successful case to return 0.
Definition at line 325 of file static_msg_buffer.h.
Reports the current size of the buffer in use.
- Returns
- The number of bytes in use in the allocated buffer. If there is no internal buffer, 0 is returned.
Definition at line 78 of file static_msg_buffer.h.
The documentation for this class was generated from the following file: