responsible for mapping an ID value to a Pdu type.
More...
#include <PacketFactory.h>
responsible for mapping an ID value to a Pdu type.
◆ CreatePacket()
Pdu * PacketFactory::CreatePacket |
( |
unsigned char |
id | ) |
|
Create a Pdu.
- Parameters
-
id | the value representing the "type" of the Pdu. The value will be stored in the 3rd position of the buffer, as defined by the DIS specification. |
- Returns
- a dynamically allocated instance of a concrete Pdu. The value will be 'NULL' if no support for creating the concrete Pdu was registered.
◆ DestroyPacket()
void PacketFactory::DestroyPacket |
( |
Pdu * |
pdu | ) |
|
Clean up the memory for the Pdu.
- Parameters
-
pdu | The packet to be deleted. |
◆ IsRegistered()
bool PacketFactory::IsRegistered |
( |
unsigned char |
id | ) |
const |
Check to know if the Pdu type is supported.
- Parameters
-
id | The value representing the Pdu type. |
- Returns
- 'true' if support for creating a Pdu was found, 'false' if not found.
◆ RegisterPacket()
template<class T >
bool DIS::PacketFactory::RegisterPacket |
( |
unsigned char |
id | ) |
|
|
inline |
Add support for creating the Pdu.
- Parameters
-
id | The value identifying the type of the Pdu. |
- Returns
- 'false' if a packet id was already registered for the Pdu type. 'true' if support was added.
◆ UnRegisterPacket()
bool DIS::PacketFactory::UnRegisterPacket |
( |
char |
id | ) |
|
|
inline |
Remove support for creating the Pdu.
- Parameters
-
id | The value identifying the type of the Pdu. |
- Returns
- 'false' if no support previously existed. 'true' if support was removed.
The documentation for this class was generated from the following files: