FreeNOS
|
#include <DatastoreServer.h>
Public Member Functions | |
DatastoreServer () | |
Class constructor function. More... | |
Public Member Functions inherited from ChannelServer< DatastoreServer, DatastoreMessage > | |
ChannelServer (DatastoreServer *inst) | |
Constructor function. More... | |
virtual | ~ChannelServer () |
Destructor function. More... | |
int | run () |
Enters an infinite loop, serving incoming requests. More... | |
void | setTimeout (const uint msec) |
Set a sleep timeout. More... | |
Private Member Functions | |
HashTable< String, Address > * | getBufferTable (const ProcessID pid) |
Retrieve current buffer table for given ProcessID. More... | |
void | registerBuffer (DatastoreMessage *msg) |
Add a new buffer. More... | |
Private Attributes | |
HashTable< ProcessID, HashTable< String, Address > * > | m_buffers |
Per-process hash table with key to buffers mapping. More... | |
Static Private Attributes | |
static const Size | MaximumBufferSize = KiloByte(256) |
Maximum size of a single buffer. More... | |
Additional Inherited Members | |
Public Types inherited from ChannelServer< DatastoreServer, DatastoreMessage > | |
enum | Result |
Result codes. More... | |
Protected Types inherited from ChannelServer< DatastoreServer, DatastoreMessage > | |
typedef void(DatastoreServer ::* | IPCHandlerFunction) (DatastoreMessage *) |
Member function pointer inside Base, to handle IPC messages. More... | |
typedef void(DatastoreServer ::* | IRQHandlerFunction) (Size) |
Member function pointer inside Base, to handle interrupts. More... | |
Protected Member Functions inherited from ChannelServer< DatastoreServer, DatastoreMessage > | |
void | addIPCHandler (const Size slot, IPCHandlerFunction h, const bool sendReply=true) |
Register a new IPC message action handler. More... | |
void | addIRQHandler (const Size slot, IRQHandlerFunction h) |
Register a new IRQ message vector handler. More... | |
virtual void | timeout () |
Called when sleep timeout is reached. More... | |
virtual bool | retryRequests () |
Retry any pending requests. More... | |
virtual void | onProcessTerminated (const ProcessID pid) |
Called whenever another Process is terminated. More... | |
void | retryAllRequests () |
Keep retrying requests until all served. More... | |
Protected Attributes inherited from ChannelServer< DatastoreServer, DatastoreMessage > | |
DatastoreServer * | m_instance |
Server object instance. More... | |
ChannelClient * | m_client |
Client for sending replies. More... | |
ChannelRegistry & | m_registry |
Contains registered channels. More... | |
MemoryChannel | m_kernelEvent |
Kernel event channel. More... | |
Index< MessageHandler< IPCHandlerFunction >, MaximumHandlerCount > | m_ipcHandlers |
IPC handler functions. More... | |
Index< MessageHandler< IRQHandlerFunction >, MaximumHandlerCount > | m_irqHandlers |
IRQ handler functions. More... | |
ProcessID | m_self |
ProcessID of ourselves. More... | |
Timer::Info | m_time |
System timer value. More... | |
Timer::Info | m_expiry |
System timer expiration value. More... | |
Datastore Server.
Provides a key/value in-memory based data storage that can be used system wide.
Definition at line 42 of file DatastoreServer.h.
DatastoreServer::DatastoreServer | ( | ) |
Class constructor function.
Definition at line 21 of file DatastoreServer.cpp.
References ChannelServer< DatastoreServer, DatastoreMessage >::addIPCHandler(), Datastore::RegisterBuffer, and registerBuffer().
Retrieve current buffer table for given ProcessID.
pid | Process identifier |
Definition at line 28 of file DatastoreServer.cpp.
References HashTable< K, V >::get(), HashTable< K, V >::insert(), m_buffers, NULL, and ZERO.
Referenced by registerBuffer().
|
private |
Add a new buffer.
msg | DatastoreMessage pointer |
Definition at line 52 of file DatastoreServer.cpp.
References Memory::Range::access, DatastoreMessage::address, DEBUG, ERROR, DatastoreMessage::from, HashTable< K, V >::get(), getBufferTable(), HashTable< K, V >::insert(), Datastore::InvalidArgument, Datastore::IOError, DatastoreMessage::key, MapContiguous, MaximumBufferSize, Memory::Range::phys, Memory::Readable, Release, DatastoreMessage::result, DatastoreMessage::size, Memory::Range::size, Datastore::Success, API::Success, Memory::User, Memory::Range::virt, VMCtl(), Memory::Writable, and ZERO.
Referenced by DatastoreServer().
Per-process hash table with key to buffers mapping.
Definition at line 77 of file DatastoreServer.h.
Referenced by getBufferTable().
Maximum size of a single buffer.
Definition at line 47 of file DatastoreServer.h.
Referenced by registerBuffer().