An interface for classes responsible of serialized payload management.
More...
#include <IPayloadPool.hpp>
An interface for classes responsible of serialized payload management.
◆ ~IPayloadPool()
◆ get_payload() [1/2]
Assign a serialized payload to a new sample.
This method will usually be called when a reader receives a whole cache change.
- Parameters
-
[in,out] | data | Serialized payload received |
[in,out] | payload | Destination serialized payload |
- Returns
- whether the operation succeeded or not
- Note
- If
data
has no owner, it means it is allocated on the stack of a reception thread, and a copy should be performed. If the ownership of data
needs to be changed, a consecutive call to this method needs to be performed with the arguments swapped, leveraging the post-condition of this method which ensures that payload.payload_owner
points to this
.
- Postcondition
- Field
payload.payload_owner
equals this
- Field
payload.data
points to a buffer of at least data.length
bytes
- Field
payload.length
is equal to data.length
- Field
payload.max_size
is greater than or equal to data.length
- Content of
payload.data
is the same as data.data
◆ get_payload() [2/2]
Get a serialized payload for a new sample.
This method will usually be called in one of the following situations:
- When a writer creates a new cache change
- When a reader receives the first fragment of a cache change
In both cases, the received size
will be for the whole serialized payload.
- Parameters
-
[in] | size | Number of bytes required for the serialized payload. |
[in,out] | payload | Payload of the cache change used in the operation |
- Returns
- whether the operation succeeded or not
- Postcondition
- Field
payload.payload_owner
equals this
- Field
payload.data
points to a buffer of at least size
bytes
- Field
payload.max_size
is greater than or equal to size
◆ release_payload()
Release a serialized payload from a sample.
This method will be called when a cache change is removed from a history.
- Parameters
-
[in,out] | payload | Payload to be released |
- Returns
- whether the operation succeeded or not
- Precondition
- Field
payload_owner
of payload
equals this
- Postcondition
- Field
payload_owner
of payload
is nullptr
The documentation for this class was generated from the following file: