|
Open Model Railroad Network (OpenMRN)
|
Abstract base class for the address spaces exported via the Memory Config Protocol. More...
#include <MemoryConfig.hxx>
Public Types | |
| typedef uint32_t | address_t |
| typedef uint16_t | errorcode_t |
Public Member Functions | |
| virtual bool | set_node (Node *node) |
| Specifies which node the next operation pertains. | |
| virtual bool | read_only () |
| virtual address_t | min_address () |
| virtual address_t | max_address ()=0 |
| virtual size_t | write (address_t destination, const uint8_t *data, size_t len, errorcode_t *error, Notifiable *again) |
| virtual size_t | read (address_t source, uint8_t *dst, size_t len, errorcode_t *error, Notifiable *again)=0 |
| virtual errorcode_t | freeze () |
| Handles space freeze command. | |
| virtual errorcode_t | unfreeze () |
| Handles space unfreeze command. | |
Static Public Attributes | |
| static const errorcode_t | ERROR_AGAIN = 0x3FFF |
| This error code signals that the operation was only partially completed, the again notify was used and will be notified when the operation can be re-tried). | |
Abstract base class for the address spaces exported via the Memory Config Protocol.
Usage: Instantiate the specific child class of this interface. Register for the address space number needed via ->insert()
Definition at line 64 of file MemoryConfig.hxx.
| typedef uint32_t openlcb::MemorySpace::address_t |
Definition at line 67 of file MemoryConfig.hxx.
| typedef uint16_t openlcb::MemorySpace::errorcode_t |
Definition at line 68 of file MemoryConfig.hxx.
|
inlinevirtual |
Handles space freeze command.
Returns an error code, or 0 for success.
Definition at line 119 of file MemoryConfig.hxx.
|
pure virtual |
Implemented in openlcb::ReadOnlyMemoryBlock, openlcb::ReadWriteMemoryBlock, openlcb::FileMemorySpace, openlcb::TractionCvSpace, openlcb::VirtualMemorySpace, and traction_modem::CvSpace.
|
inlinevirtual |
Reimplemented in openlcb::VirtualMemorySpace.
Definition at line 88 of file MemoryConfig.hxx.
|
pure virtual |
| again | when a re-try makes sense. The caller should call read once more, with the offset adjusted with the previously returned bytes. |
Implemented in openlcb::ReadOnlyMemoryBlock, openlcb::ReadWriteMemoryBlock, openlcb::FileMemorySpace, openlcb::TractionCvSpace, openlcb::VirtualMemorySpace, and traction_modem::CvSpace.
|
inlinevirtual |
Reimplemented in openlcb::ReadWriteMemoryBlock, openlcb::FileMemorySpace, openlcb::ROFileMemorySpace, openlcb::TractionCvSpace, openlcb::VirtualMemorySpace, and traction_modem::CvSpace.
Definition at line 83 of file MemoryConfig.hxx.
Specifies which node the next operation pertains.
If it returns false, the operation will be rejected by "unknown memory space ID".
Reimplemented in openlcb::TractionCvSpace.
Definition at line 77 of file MemoryConfig.hxx.
|
inlinevirtual |
Handles space unfreeze command.
Returns an error code, or 0 for success.
Definition at line 125 of file MemoryConfig.hxx.
|
inlinevirtual |
| again | when a re-try makes sense. The caller should call write once more, with the offset adjusted with the previously returned bytes. |
Reimplemented in openlcb::ReadWriteMemoryBlock, openlcb::FileMemorySpace, openlcb::TractionCvSpace, openlcb::VirtualMemorySpace, and traction_modem::CvSpace.
Definition at line 103 of file MemoryConfig.hxx.
|
static |
This error code signals that the operation was only partially completed, the again notify was used and will be notified when the operation can be re-tried).
Definition at line 73 of file MemoryConfig.hxx.