$darkmode
#include <rdb_transceiver_shm.hpp>
Public Member Functions | |
| RdbTransceiverShm (key_t key, uint32_t release_mask) | |
| bool | has () const override |
| std::vector< std::shared_ptr< RDB_MSG_t > > | receive () override |
| void | send (const RDB_MSG_t *, size_t) override |
| void | to_json (cloe::Json &j) const override |
Protected Attributes | |
| uint32_t | release_mask_ |
| VTD uses this mask to notify client when data in buffer is ready. | |
| boost::interprocess::mapped_region | region_ |
| Shared memory region. | |
| RDB_SHM_HDR_t * | rdb_shm_hdr_ {nullptr} |
| Pointer to the shared memory management header. | |
| RDB_SHM_BUFFER_INFO_t ** | buffer_info_ {nullptr} |
| Array of pointers to buffer information. | |
| RDB_MSG_t ** | rdb_msg_ {nullptr} |
| Array of pointers to rdb messages. | |
| uint64_t | num_errors_ {0} |
| uint64_t | num_messages_ {0} |
Friends | |
| void | to_json (cloe::Json &j, const RdbTransceiverShm &t) |
This class implements an RDB client via shared memory.
WARNING:
This class is primarily a proof-of-concept. Currently, it is not used and there is no guarantee that it actually works as advertised.
Even if it works, under the hood manual memory-management is used, which means that until it is audited, it may leak memory or worse (ironic, I know).
| vtd::RdbTransceiverShm::RdbTransceiverShm | ( | key_t | key, |
| uint32_t | release_mask | ||
| ) |
Connect to VTD memory to create a new RDB communication.
If a "connection" cannot be achieved, C-strings are thrown.
| key | to obtain shared memory id |
| release_mask | mask used by VTD to mask a shared memory region as accessible |
|
inlineoverridevirtual |
Returns true when the transceiver has a message that can be received.
That is, if true, then a call to receive() will return a vector that is not empty.
Implements vtd::RdbTransceiver.
|
overridevirtual |
Non-blocking function to return all received RDB messages.
Implements vtd::RdbTransceiver.
|
inlineoverridevirtual |
Sends the RDB message with the given size.
| msg | RDB message |
| size | number of bytes |
Implements vtd::RdbTransceiver.