This class abstracts a packet. You cannot directly allocate/deallocate Packet. Also you cannot directly access the internal buffer. Use access functions.
More...
#include <E_Packet.hpp>
This class abstracts a packet. You cannot directly allocate/deallocate Packet. Also you cannot directly access the internal buffer. Use access functions.
◆ Packet() [1/3]
E::Packet::Packet |
( |
const Packet & |
other | ) |
|
Copy constructor. (Copied packet has same UUID)
- Parameters
-
◆ Packet() [2/3]
E::Packet::Packet |
( |
Packet && |
other | ) |
|
|
noexcept |
Move constructor. (Moved packet become emtpy)
- Parameters
-
◆ Packet() [3/3]
E::Packet::Packet |
( |
size_t |
size | ) |
|
◆ clone()
Packet E::Packet::clone |
( |
| ) |
const |
Clone packet (Cloned packet has a different UUID)
- Returns
- Cloned packet.
◆ getSize()
size_t E::Packet::getSize |
( |
| ) |
const |
- Returns
- Current packet size.
◆ getUUID()
UUID E::Packet::getUUID |
( |
| ) |
const |
◆ operator=() [1/2]
Copy assignment operator. (Copied packet has same UUID)
- Parameters
-
◆ operator=() [2/2]
Move assignment operator. (Moved packet become emtpy)
- Parameters
-
◆ readData()
size_t E::Packet::readData |
( |
size_t |
offset, |
|
|
void * |
data, |
|
|
size_t |
length |
|
) |
| const |
- Parameters
-
offset | Start read skipping first n bytes of the internal buffer. |
data | Destination of the packet content. |
length | Length of data to be retrieved. |
- Returns
- Actual retrieved bytes.
◆ setSize()
size_t E::Packet::setSize |
( |
size_t |
size | ) |
|
Change the size of this Packet The size can be larger than the internal buffer.
- Parameters
-
- Returns
- Actual changed size.
◆ writeData()
size_t E::Packet::writeData |
( |
size_t |
offset, |
|
|
const void * |
data, |
|
|
size_t |
length |
|
) |
| |
- Parameters
-
offset | Start write skipping first n bytes of the given buffer. |
data | Data to be written in this packet. |
length | Length of data to be written. |
- Returns
- Actual written bytes. If length + offset is larger than the internal buffer size, some data may be truncated.
The documentation for this class was generated from the following files:
- include/E/Networking/E_Packet.hpp
- src/Networking/E_Packet.cpp