MessagePacketHandle Class
The MessagePacketHandle class represents a handle to a message packet. More...
Header: | #include <MessagePacketHandle> |
Public Functions
MessagePacketHandle() | |
MessagePacketHandle(const std::shared_ptr<MessageReusePool> &customPool) | |
MessagePacketHandle(const MessagePacketHandle &other) | |
MessagePacketHandle(const T &customMessage) | |
MessagePacketHandle(const Message &customMessage) | |
~MessagePacketHandle() | |
unsigned int | Destination() const |
MessagePacket & | Packet() |
const MessagePacket & | Packet() const |
void | SetDestination(unsigned int destination) const |
MessagePacketHandle & | operator=(const MessagePacketHandle &other) |
Detailed Description
The MessagePacketHandle class represents a handle to a message packet.
The MessagePacketHandle provides a way to manage the lifetime and access to a message packet.
Member Function Documentation
MessagePacketHandle::MessagePacketHandle()
Default constructs an instance of MessagePacketHandle.
MessagePacketHandle::MessagePacketHandle(const std::shared_ptr<MessageReusePool> &customPool)
Constructor for the MessagePacketHandle using a Custom packet pool for packet reuse.
MessagePacketHandle::MessagePacketHandle(const MessagePacketHandle &other)
Copy constructor for the MessagePacketHandle class.
This constructor creates a new MessagePacketHandle instance as a copy of an existing instance, but does not copy any data.
It takes care of properly managing the reference count to the MessagePacket instance to ensure that it is not prematurely released.
other The source MessagePacketHandle instance to duplicate.
MessagePacketHandle::MessagePacketHandle(const T &customMessage)
Default constructs an instance of MessagePacketHandle.
MessagePacketHandle::MessagePacketHandle(const Message &customMessage)
Data copy constructor for the MessagePacketHandle class.
This method provides a way to copy the payload data of one MessagePacketHandle instance to another, making a modifiable copy of a MessagePacketHandle instance. This is useful when different destinations are used for the same but slightly altered message.
customMessage the source message to copy, typically from handle.Packet().GetMessage()
MessagePacketHandle::~MessagePacketHandle()
Destructor for MessagePacketHandle.
unsigned int MessagePacketHandle::Destination() const
Gets the destination of the message packet handle.
Returns the destination of the message packet handle.
MessagePacket &MessagePacketHandle::Packet()
Gets modifiable message packet when possible associated with the handle.
Returns the reference to the message packet.
const MessagePacket &MessagePacketHandle::Packet() const
Gets const message packet reference associated with the handle.
Returns the const reference to the message packet.
void MessagePacketHandle::SetDestination(unsigned int destination) const
Sets the destination of the message packet.
MessagePacketHandle &MessagePacketHandle::operator=(const MessagePacketHandle &other)
Overloads the assignment operator for the MessagePacketHandle class.
This method provides a way to assign the contents of one MessagePacketHandle instance to another making a copy of a MessagePacketHandle instance, but does not copy any data.
other The source MessagePacketHandle instance from which to copy. Returns a reference to the current instance, to allow for chained assignment operations.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.