|
Open Model Railroad Network (OpenMRN)
|
#include <Devtab.hxx>
Classes | |
| struct | SelectInfo |
| Select wakeup information. More... | |
Public Member Functions | |
| Device (const char *name) | |
| Constructor. | |
| virtual | ~Device () |
| Destructor. | |
Static Public Member Functions | |
| static int | open (struct _reent *reent, const char *path, int flags, int mode) |
| Open a file or device. | |
| static int | close (struct _reent *reent, int fd) |
| Close a file or device. | |
| static int | stat (struct _reent *reent, const char *path, struct stat *stat) |
| Get the status information of a file or device. | |
| static int | select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, long long timeout) |
| POSIX select(). | |
| static void | select_clear () |
| Clears the current thread's select bits. | |
Static Public Member Functions inherited from FileIO | |
| static ssize_t | read (struct _reent *reent, int fd, void *buf, size_t count) |
| Read from a file or device. | |
| static ssize_t | write (struct _reent *reent, int fd, const void *buf, size_t count) |
| Write to a file or device. | |
| static _off_t | lseek (struct _reent *reent, int fd, _off_t offset, int whence) |
| Change the offset index of a file or device. | |
| static int | fstat (struct _reent *reent, int fd, struct stat *stat) |
| Get the status information of a file or device. | |
| static int | ioctl (int fd, unsigned long int key, unsigned long data) |
| Request and ioctl transaction. | |
| static int | fcntl (int fd, int cmd, unsigned long data) |
| Manipulate a file descriptor. | |
| static bool | is_device (int fd) |
| Test if the file descriptor belongs to a device. | |
Protected Member Functions | |
| virtual mode_t | get_mode () |
| Get the mode of the device. | |
Protected Member Functions inherited from FileIO | |
| FileIO (const char *name) | |
| Constructor. | |
| virtual | ~FileIO () |
| Destructor. | |
| virtual int | open (File *file, const char *path, int flags, int mode)=0 |
| Open a file or device. | |
| virtual int | close (File *file)=0 |
| Close a file or device. | |
| virtual ssize_t | read (File *file, void *buf, size_t count)=0 |
| Read from a file or device. | |
| virtual ssize_t | write (File *file, const void *buf, size_t count)=0 |
| Write to a file or device. | |
| virtual off_t | lseek (File *f, off_t offset, int whence) |
| Seek method. | |
| virtual int | fstat (File *file, struct stat *stat)=0 |
| Get the status information of a file or device. | |
| virtual int | ioctl (File *file, unsigned long int key, unsigned long data) |
| Request an ioctl transaction. | |
| virtual int | fcntl (File *file, int cmd, unsigned long data) |
| Manipulate a file descriptor. | |
| virtual bool | select (File *file, int mode) |
| Device select method. | |
Static Protected Member Functions | |
| static void | select_insert (SelectInfo *info) |
| Add client to list of clients needing woken. | |
| static void | select_wakeup (SelectInfo *info) |
| Wakeup the list of clients needing woken. | |
| static void | select_wakeup_from_isr (SelectInfo *info, int *woken) |
| Wakeup the list of clients needing woken. | |
Static Protected Member Functions inherited from FileIO | |
| static int | fd_alloc (void) |
| Allocate a free file descriptor. | |
| static void | fd_free (int fd) |
| Free up a file descriptor. | |
| static File * | file_lookup (int fd) |
| Looks up a reference to a File corresponding to a given file descriptor. | |
| static int | fd_lookup (File *file) |
| Looks up a file descriptor corresponding to a given File reference. | |
Private Member Functions | |
| DISALLOW_COPY_AND_ASSIGN (Device) | |
Private Attributes | |
| Device * | next |
| next device in linked list | |
| Device * | prev |
| previous device in linked list | |
Static Private Attributes | |
| static Device * | first = NULL |
| first device in linked list | |
Friends | |
| class | DeviceBufferBase |
| allow class DeviceBuffer access to select() related members. | |
| class | OSSelectWakeup |
| allow class OSSelectWakeup access to select() related members. | |
Additional Inherited Members | |
Protected Attributes inherited from FileIO | |
| const char * | name |
| device name | |
Static Protected Attributes inherited from FileIO | |
| static const unsigned int | numOpenFiles = 20 |
| static File | files [] |
| File descriptor pool. | |
| static OSMutex | mutex |
| mutual exclusion for fileio | |
Device tab structure.
Definition at line 431 of file Devtab.hxx.
| Device::Device | ( | const char * | name | ) |
Constructor.
| name | name of device in file system. Pointer must be valid throughout the entire lifetime. |
Definition at line 52 of file Device.cxx.
|
virtual |
Destructor.
Definition at line 68 of file Device.cxx.
|
static |
Close a file or device.
| reent | thread save reentrant structure |
| fd | file descriptor to close |
Definition at line 134 of file Device.cxx.
|
inlineprotectedvirtual |
Get the mode of the device.
Reimplemented in Node.
Definition at line 506 of file Devtab.hxx.
|
static |
Open a file or device.
| reent | thread save reentrant structure |
| path | file or device name |
| flags | open flags |
| mode | open mode, ignored in this implementation |
Definition at line 93 of file Device.cxx.
|
static |
POSIX select().
| nfds | highest numbered file descriptor in any of the three, sets plus 1 |
| readfds | fd_set of file descritpors to pend on read active |
| writefds | fd_set of file descritpors to pend on write active |
| exceptfds | fd_set of file descritpors to pend on error active |
| timeout | timeout in nsec to wait, if 0, return immediately, if < 0 wait forever |
Definition at line 96 of file Select.cxx.
|
static |
Clears the current thread's select bits.
This is used by select and ::pselect to ensure the necessary atomicity.
Definition at line 78 of file Select.cxx.
|
staticprotected |
Add client to list of clients needing woken.
Add client to list of clients needing woken,.
| info | wakeup event instance |
Definition at line 197 of file Select.cxx.
|
staticprotected |
Wakeup the list of clients needing woken.
Wakeup the list of clients needing woken,.
| info | wakeup event instance |
Definition at line 210 of file Select.cxx.
|
staticprotected |
Wakeup the list of clients needing woken.
Wakeup the list of clients needing woken,.
from ISR context.
| info | wakeup event instance |
| woken | is the task woken up |
| info | wakeup event instance |
Definition at line 224 of file Select.cxx.
|
static |
Get the status information of a file or device.
| reent | thread save reentrant structure |
| path | file or device name |
| stat | structure to fill status info into |
Definition at line 165 of file Device.cxx.
|
friend |
allow class DeviceBuffer access to select() related members.
Definition at line 528 of file Devtab.hxx.
|
friend |
allow class OSSelectWakeup access to select() related members.
Definition at line 531 of file Devtab.hxx.
|
staticprivate |
first device in linked list
Definition at line 535 of file Devtab.hxx.
|
private |
next device in linked list
Definition at line 538 of file Devtab.hxx.
|
private |
previous device in linked list
Definition at line 541 of file Devtab.hxx.