|
Open Model Railroad Network (OpenMRN)
|
Memory space implementation that exports the contents of a file as a memory space. More...
#include <MemoryConfig.hxx>
Public Member Functions | |
| ROFileMemorySpace (int fd, address_t len=AUTO_LEN) | |
| Creates a memory space based on an fd. | |
| ROFileMemorySpace (const char *name, address_t len=AUTO_LEN) | |
| Creates a memory space based on a file name. | |
| bool | read_only () OVERRIDE |
Public Member Functions inherited from openlcb::FileMemorySpace | |
| FileMemorySpace (int fd, address_t len=AUTO_LEN) | |
| Creates a memory space based on an fd. | |
| FileMemorySpace (const char *name, address_t len=AUTO_LEN) | |
| Creates a memory space based on a file name. | |
| address_t | max_address () OVERRIDE |
| size_t | write (address_t destination, const uint8_t *data, size_t len, errorcode_t *error, Notifiable *again) OVERRIDE |
| size_t | read (address_t source, uint8_t *dst, size_t len, errorcode_t *error, Notifiable *again) OVERRIDE |
Public Member Functions inherited from openlcb::MemorySpace | |
| virtual bool | set_node (Node *node) |
| Specifies which node the next operation pertains. | |
| virtual address_t | min_address () |
| virtual errorcode_t | freeze () |
| Handles space freeze command. | |
| virtual errorcode_t | unfreeze () |
| Handles space unfreeze command. | |
Additional Inherited Members | |
Public Types inherited from openlcb::MemorySpace | |
| typedef uint32_t | address_t |
| typedef uint16_t | errorcode_t |
Static Public Attributes inherited from openlcb::FileMemorySpace | |
| static const address_t | AUTO_LEN = (address_t) - 1 |
| static const address_t | UNLIMITED_LEN = (address_t) - 2 |
Static Public Attributes inherited from openlcb::MemorySpace | |
| 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). | |
Memory space implementation that exports the contents of a file as a memory space.
The file can be specified either as a path or an fd. By default writes are also allowed.
Definition at line 299 of file MemoryConfig.hxx.
|
inline |
Creates a memory space based on an fd.
| fd | is an open file descriptor with the data. |
| len | tells how many bytes there are in the memory space. If specified as AUTO_LEN, then uses fstat to figure out the size of the file. |
Definition at line 308 of file MemoryConfig.hxx.
|
inline |
Creates a memory space based on a file name.
Opens the file at the first use, and never closes it.
| name | is the file name to open. The pointer must stay alive so long as *this is around. |
| len | tells how many bytes there are in the memory space. If specified as AUTO_LEN, then uses fstat to figure out the size of the file. |
Definition at line 320 of file MemoryConfig.hxx.
|
inlinevirtual |
Reimplemented from openlcb::FileMemorySpace.
Definition at line 323 of file MemoryConfig.hxx.