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
42class 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 */
Template class which serves incoming messages from Channels using MessageHandlers.
Datastore Server.
static const Size MaximumBufferSize
Maximum size of a single buffer.
void registerBuffer(DatastoreMessage *msg)
Add a new buffer.
DatastoreServer()
Class constructor function.
HashTable< ProcessID, HashTable< String, Address > * > m_buffers
Per-process hash table with key to buffers mapping.
HashTable< String, Address > * getBufferTable(const ProcessID pid)
Retrieve current buffer table for given ProcessID.
Efficient key -> value lookups.
Definition HashTable.h:45
u32 ProcessID
Process Identification Number.
Definition Types.h:140
#define KiloByte(v)
Convert kilobytes to bytes.
Definition Macros.h:54
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
Datastore IPC message.