FreeNOS
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
DatastoreServer Class Reference

Datastore Server. More...

#include <DatastoreServer.h>

Inheritance diagram for DatastoreServer:
ChannelServer< DatastoreServer, DatastoreMessage >

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 >
DatastoreServerm_instance
 Server object instance. More...
 
ChannelClientm_client
 Client for sending replies. More...
 
ChannelRegistrym_registry
 Contains registered channels. More...
 
MemoryChannel m_kernelEvent
 Kernel event channel. More...
 
Index< MessageHandler< IPCHandlerFunction >, MaximumHandlerCountm_ipcHandlers
 IPC handler functions. More...
 
Index< MessageHandler< IRQHandlerFunction >, MaximumHandlerCountm_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DatastoreServer()

DatastoreServer::DatastoreServer ( )

Member Function Documentation

◆ getBufferTable()

HashTable< String, Address > * DatastoreServer::getBufferTable ( const ProcessID  pid)
private

Retrieve current buffer table for given ProcessID.

Parameters
pidProcess identifier
Returns
Pointer to a HashTable on success, NULL on failure.

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().

◆ registerBuffer()

void DatastoreServer::registerBuffer ( DatastoreMessage msg)
private

Field Documentation

◆ m_buffers

HashTable<ProcessID, HashTable<String, Address> *> DatastoreServer::m_buffers
private

Per-process hash table with key to buffers mapping.

Definition at line 77 of file DatastoreServer.h.

Referenced by getBufferTable().

◆ MaximumBufferSize

const Size DatastoreServer::MaximumBufferSize = KiloByte(256)
staticprivate

Maximum size of a single buffer.

Definition at line 47 of file DatastoreServer.h.

Referenced by registerBuffer().


The documentation for this class was generated from the following files: