FreeNOS
DatastoreServer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __SERVER_DATASTORE_DATASTORESERVER_H
19 #define __SERVER_DATASTORE_DATASTORESERVER_H
20 
21 #include <FreeNOS/ProcessManager.h>
22 #include <ChannelServer.h>
23 #include <Types.h>
24 #include <HashTable.h>
25 #include <String.h>
26 #include "Datastore.h"
27 #include "DatastoreMessage.h"
28 
42 class DatastoreServer : public ChannelServer<DatastoreServer, DatastoreMessage>
43 {
44  private:
45 
47  static const Size MaximumBufferSize = KiloByte(256);
48 
49  public:
50 
55 
56  private:
57 
66 
73 
74  private:
75 
78 };
79 
85 #endif /* __SERVER_DATASTORE_DATASTORESERVER_H */
Datastore.h
DatastoreMessage.h
HashTable
Efficient key -> value lookups.
Definition: HashTable.h:44
DatastoreServer::getBufferTable
HashTable< String, Address > * getBufferTable(const ProcessID pid)
Retrieve current buffer table for given ProcessID.
Definition: DatastoreServer.cpp:28
DatastoreMessage
Datastore IPC message.
Definition: DatastoreMessage.h:36
DatastoreServer::registerBuffer
void registerBuffer(DatastoreMessage *msg)
Add a new buffer.
Definition: DatastoreServer.cpp:52
Types.h
HashTable.h
DatastoreServer
Datastore Server.
Definition: DatastoreServer.h:42
ProcessID
u32 ProcessID
Process Identification Number.
Definition: Types.h:140
DatastoreServer::MaximumBufferSize
static const Size MaximumBufferSize
Maximum size of a single buffer.
Definition: DatastoreServer.h:47
KiloByte
#define KiloByte(v)
Convert kilobytes to bytes.
Definition: Macros.h:54
DatastoreServer::DatastoreServer
DatastoreServer()
Class constructor function.
Definition: DatastoreServer.cpp:21
DatastoreServer::m_buffers
HashTable< ProcessID, HashTable< String, Address > * > m_buffers
Per-process hash table with key to buffers mapping.
Definition: DatastoreServer.h:77
Size
unsigned int Size
Any sane size indicator cannot go negative.
Definition: Types.h:128
ChannelServer
Template class which serves incoming messages from Channels using MessageHandlers.
Definition: ChannelServer.h:79
String.h
ChannelServer.h