CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
MemoryRequestServer.h
Go to the documentation of this file.
1
8
9#if !defined(_MEMORYREQUESTSERVER_H_)
10#define _MEMORYREQUESTSERVER_H_
11
13
14namespace cmlabs {
15
31public:
32 static bool UnitTest();
33
36
43 bool init(const char* memoryName, uint32 maxConnectionCount, uint32 maxQueueSize, uint32 maxRequestCount);
44 bool shutdown();
45
48 DataMessage* waitForRequest(uint32 ms);
49 bool setRequestStatus(uint64 id, uint16 status);
50 bool replyToRequest(uint64 id, DataMessage* msg);
51
52private:
53 RequestServerHeader* serverHeader;
54
55 utils::Mutex* mutex;
56
57 MemoryRequestConnection* requestCon;
58
59 bool maintenance();
60};
61
62} // namespace cmlabs
63
64#endif //_MEMORYREQUESTSERVER_H_
65
Client-side endpoint of the named shared-memory request/reply service.
The central Psyclone data container: a self-contained binary message with typed, named user entries.
Client endpoint connected to a named shared-memory request server.
static bool UnitTest()
Self-test of the request/reply round trip.
bool replyToRequest(uint64 id, DataMessage *msg)
Send the reply for request id (copied; caller keeps ownership).
bool shutdown()
Detach and mark the server stopped.
DataMessage * waitForRequest(uint32 ms)
Block up to ms milliseconds for the next client request.
bool init(const char *memoryName, uint32 maxConnectionCount, uint32 maxQueueSize, uint32 maxRequestCount)
Create the named server segment.
bool setRequestStatus(uint64 id, uint16 status)
Advance request id's MEMORYREQUEST_* status.
Recursive mutual-exclusion lock, optionally named for cross-process use.
Definition Utils.h:463
Header of a request-server segment: identity, limits and layout parameters.