|
| static bool | place (const std::string &name, const uint64_t id, const std::string &tag, Buffer &&buffer, const Timestamp timestamp) |
| | Explicitly places a maintenance data, information, message into the local maintenance manager.
|
| |
| static void | encodeData (const std::string &name, const uint64_t id, const std::string &tag, const Buffer &buffer, const Timestamp timestamp, const size_t reservedHeaderSize, Buffer &encodedBuffer) |
| | Encodes a maintenance data to one combined package.
|
| |
| static bool | decodeData (const void *encodedBuffer, const size_t encodedBufferSize, std::string &name, uint64_t &id, std::string &tag, Buffer &buffer, Timestamp ×tamp) |
| | Decodes a package buffer to maintenance data with corresponding information.
|
| |
This class is the base class for all maintenance connectors.
A maintenance connector connects a local maintenance manager with a remote maintenance manager to transmit the information.
The actual implementation of any maintenance connector must be done in a derived class, thus individual connectors with individual capabilities can be implemented.
| static void Ocean::Maintenance::Connector::encodeData |
( |
const std::string & |
name, |
|
|
const uint64_t |
id, |
|
|
const std::string & |
tag, |
|
|
const Buffer & |
buffer, |
|
|
const Timestamp |
timestamp, |
|
|
const size_t |
reservedHeaderSize, |
|
|
Buffer & |
encodedBuffer |
|
) |
| |
|
staticprotected |
Encodes a maintenance data to one combined package.
The resulting buffer holds the optional header followed by the payload, all fields in host byte order:
|<- reservedHeaderSize ->|<-------------------------------------------------- payload -------------------------------------------------->|
+------------------------+-----------+------------+-----------------+--------+-----------+----------------+------------+-----------------+
| header, left untouched | timestamp | nameLength |
name |
id | tagLength | tag | bufferSize | buffer |
| | 8 byte | 8 byte | nameLength byte | 8 byte | 8 byte | tagLength byte | 8 byte | bufferSize byte |
+------------------------+-----------+------------+-----------------+--------+-----------+----------------+------------+-----------------+
std::string name() const
Returns the name of this maintenance manager.
Definition Maintenance.h:473
timestamp is the timestamp of the maintenance data, a Timestamp and therefore a double. name is the readable name of the maintenance manager the data originated from, e.g. the application name. id is the random 64 bit id of that manager, which distinguishes two managers that happen to share a name. tag describes what the payload is and is what a receiver dispatches on. buffer is the maintenance payload itself. nameLength, tagLength and bufferSize each give the byte count of the variable length field which follows it. None of the strings is null terminated on the wire. The first reservedHeaderSize bytes are left untouched for a transport to write its own header into. This is how MaintenanceTCPConnector places its length prefix without copying the payload again.
- Parameters
-
| name | The name of the maintenance manager providing the data |
| id | The id of the maintenance manager providing the data |
| tag | The tag of the maintenance data |
| buffer | The maintenance data as buffer |
| timestamp | The timestamp of the maintenance data |
| reservedHeaderSize | The number of bytes which will be reserved for the header, so that the resulting buffer has an optional header followed by the payload data |
| encodedBuffer | The resulting encoded package |