Method to wrap an existing byte array within a Packet for easy Read/Write operations. The wrapped buffer is not resized or deleted by the Packet. More...
#include <packet.h>
Public Member Functions | |
Wrapper () | |
Constructor. | |
Wrapper (const Wrapper &wrapper) | |
Copy constructor. | |
Wrapper (unsigned char *buffer, const unsigned int len) | |
Constructor for Wrapper packet. A Wrapper packet wraps an existing buffer with a Packet so users can easily Read/Write to/from the buffer. On destruction, the buffer is not deleted. | |
~Wrapper () | |
Destructor. | |
bool | Create (unsigned char *buffer, const unsigned int len) |
Create a Wrapper packet. A Wrapper packet wraps an existing buffer with a Packet so users can easily Read/Write to/from the buffer. On destruction, the buffer is not deleted. | |
void | Clear () |
Clears wrapped data. | |
Packet * | operator-> () |
Method to get a pointer to the wrapper packet for read/write operations. | |
const Packet * | operator-> () const |
Method to get a pointer to the wrapper packet for read/write operations. | |
Packet * | GetData () |
Method to get a pointer to the wrapper packet for read/write operations. | |
const Packet * | GetData () const |
Method to get a pointer to the wrapper packet for read/write operations. | |
Wrapper & | operator= (const Wrapper &wrapper) |
Makes a wrapper packet copy. |
Method to wrap an existing byte array within a Packet for easy Read/Write operations. The wrapped buffer is not resized or deleted by the Packet.
Definition at line 112 of file packet.h.
Packet::Wrapper::Wrapper | ( | ) |
Constructor.
Definition at line 64 of file packet.cpp.
Packet::Wrapper::Wrapper | ( | const Wrapper & | wrapper ) |
Copy constructor.
[in] | wrapper | The wrapper to duplicate. |
Definition at line 76 of file packet.cpp.
Packet::Wrapper::Wrapper | ( | unsigned char * | buffer, |
const unsigned int | len | ||
) |
Constructor for Wrapper packet. A Wrapper packet wraps an existing buffer with a Packet so users can easily Read/Write to/from the buffer. On destruction, the buffer is not deleted.
[in] | buffer | Pointer to buffer to wrap. |
[in] | len | Length of the buffer in bytes. |
Definition at line 92 of file packet.cpp.
Packet::Wrapper::~Wrapper | ( | ) |
Destructor.
Definition at line 109 of file packet.cpp.
void Packet::Wrapper::Clear | ( | ) |
Clears wrapped data.
Definition at line 153 of file packet.cpp.
bool Packet::Wrapper::Create | ( | unsigned char * | buffer, |
const unsigned int | len | ||
) |
Create a Wrapper packet. A Wrapper packet wraps an existing buffer with a Packet so users can easily Read/Write to/from the buffer. On destruction, the buffer is not deleted.
[in] | buffer | Pointer to buffer to wrap. |
[in] | len | Length of the buffer in bytes. |
Definition at line 127 of file packet.cpp.
Packet * Packet::Wrapper::GetData | ( | ) |
Method to get a pointer to the wrapper packet for read/write operations.
Definition at line 207 of file packet.cpp.
const Packet * Packet::Wrapper::GetData | ( | ) | const |
Method to get a pointer to the wrapper packet for read/write operations.
Definition at line 195 of file packet.cpp.
const Packet * Packet::Wrapper::operator-> | ( | ) | const |
Method to get a pointer to the wrapper packet for read/write operations.
Definition at line 172 of file packet.cpp.
Packet * Packet::Wrapper::operator-> | ( | ) |
Method to get a pointer to the wrapper packet for read/write operations.
Definition at line 184 of file packet.cpp.
Packet::Wrapper & Packet::Wrapper::operator= | ( | const Wrapper & | wrapper ) |
Makes a wrapper packet copy.
Definition at line 218 of file packet.cpp.