|
Open Model Railroad Network (OpenMRN)
|
A statically allocated buffer for sending one message to the OpenLCB bus. More...
#include <WriteHelper.hxx>
Public Types | |
| typedef Node * | node_type |
| typedef string | payload_type |
Public Member Functions | |
| const payload_type & | last_payload () |
| void | clear_last_payload () |
| void | set_wait_for_local_loopback (bool wait=true) |
| void | WriteAsync (Node *node, Defs::MTI mti, NodeHandle dst, const payload_type &buffer, Notifiable *done) |
| Originates an NMRAnet message from a particular node. | |
Public Member Functions inherited from Executable | |
| void | test_deletion () |
| void | notify () override |
| Crashes the program – everyone who is expecting notify calls must override this function. | |
Public Member Functions inherited from QMember | |
| void | init () |
| Initiailize a QMember, in place of a public placement construction. | |
Static Public Member Functions | |
| static NodeHandle | global () |
Private Member Functions | |
| void | alloc_result (QMember *entry) override |
| Return the result of an alloc_async() from a memory Pool. | |
| void | run () override |
| Entry point. | |
Private Attributes | |
| unsigned | waitForLocalLoopback_: 1 |
| NodeHandle | dst_ |
| Defs::MTI | mti_ |
| Node * | node_ |
| payload_type | buffer_ |
| BarrierNotifiable | done_ |
Additional Inherited Members | |
Protected Member Functions inherited from QMember | |
| QMember () | |
| Constructor. | |
| ~QMember () | |
| Destructor. | |
Protected Attributes inherited from QMember | |
| QMember * | next |
| pointer to the next member in the queue | |
A statically allocated buffer for sending one message to the OpenLCB bus.
This buffer is reusable, as soon as the done notifiable is called, the buffer is free for sending the next packet.
Definition at line 51 of file WriteHelper.hxx.
| typedef Node* openlcb::WriteHelper::node_type |
Definition at line 54 of file WriteHelper.hxx.
| typedef string openlcb::WriteHelper::payload_type |
Definition at line 55 of file WriteHelper.hxx.
|
inline |
Definition at line 62 of file WriteHelper.hxx.
|
inlineoverrideprivatevirtual |
Return the result of an alloc_async() from a memory Pool.
| item | result of the the allocation |
Reimplemented from Executable.
Definition at line 126 of file WriteHelper.hxx.
|
inline |
Definition at line 72 of file WriteHelper.hxx.
|
inlinestatic |
Definition at line 57 of file WriteHelper.hxx.
|
inline |
Definition at line 67 of file WriteHelper.hxx.
|
inlineoverrideprivatevirtual |
Entry point.
This funciton will be called when *this gets scheduled on the CPU.
Implements Executable.
Definition at line 160 of file WriteHelper.hxx.
|
inline |
Definition at line 77 of file WriteHelper.hxx.
|
inline |
Originates an NMRAnet message from a particular node.
| node | is the originating node. |
| mti | is the message to send |
| dst | is the destination node to send to (may be global()) |
| buffer | is the message payload. |
| done | will be notified when the packet has been enqueued to the physical layer. If done == nullptr, the sending is invoked synchronously. |
Definition at line 91 of file WriteHelper.hxx.
|
private |
Definition at line 169 of file WriteHelper.hxx.
|
private |
Definition at line 170 of file WriteHelper.hxx.
|
private |
Definition at line 166 of file WriteHelper.hxx.
|
private |
Definition at line 167 of file WriteHelper.hxx.
|
private |
Definition at line 168 of file WriteHelper.hxx.
|
private |
Definition at line 165 of file WriteHelper.hxx.