|
FreeNOS
|
Unidirectional point-to-point messaging channel. More...
#include <Channel.h>
Public Types | |
| enum | Result { Success, InvalidArgument, InvalidMode, InvalidSize, IOError, ChannelFull, NotFound, NotSupported } |
| Result codes. More... | |
| enum | Mode { Producer, Consumer } |
| Channel modes. More... | |
Public Member Functions | |
| Channel (const Mode mode, const Size messageSize) | |
| Constructor. More... | |
| virtual | ~Channel () |
| Destructor. More... | |
| const Size | getMessageSize () const |
| Get message size. More... | |
| virtual Result | read (void *buffer) |
| Read a message. More... | |
| virtual Result | write (const void *buffer) |
| Write a message. More... | |
| virtual Result | flush () |
| Flush message buffers. More... | |
Protected Attributes | |
| const Mode | m_mode |
| Channel mode. More... | |
| const Size | m_messageSize |
| Message size. More... | |
| enum Channel::Mode |
| enum Channel::Result |
Constructor.
| mode | Channel mode is either a producer or consumer |
| messageSize | Size of each individual message in bytes |
Definition at line 20 of file Channel.cpp.
|
virtual |
Destructor.
Definition at line 26 of file Channel.cpp.
|
virtual |
Flush message buffers.
Ensures that all messages are written through caches.
Reimplemented in MemoryChannel.
Definition at line 45 of file Channel.cpp.
References NotSupported.
| const Size Channel::getMessageSize | ( | ) | const |
Get message size.
Definition at line 30 of file Channel.cpp.
References m_messageSize.
Referenced by ChannelClient::sendRequest().
|
virtual |
Read a message.
| buffer | Output buffer for the message. |
Reimplemented in MemoryChannel.
Definition at line 35 of file Channel.cpp.
References NotSupported.
Referenced by ChannelServer< DatastoreServer, DatastoreMessage >::readChannels(), and ChannelClient::syncReceiveFrom().
|
virtual |
Write a message.
| buffer | Input buffer for the message. |
Reimplemented in MemoryChannel.
Definition at line 40 of file Channel.cpp.
References NotSupported.
Referenced by ChannelServer< DatastoreServer, DatastoreMessage >::readChannels(), ChannelClient::sendRequest(), FileSystemServer::sendResponse(), and ChannelClient::syncSendTo().
|
protected |
Message size.
Definition at line 117 of file Channel.h.
Referenced by getMessageSize(), MemoryChannel::read(), and MemoryChannel::write().
|
protected |
Channel mode.
Definition at line 114 of file Channel.h.
Referenced by MemoryChannel::flush(), MemoryChannel::reset(), and MemoryChannel::setPhysical().
1.8.17