15#if !defined(_MEMORYQUEUES_H_)
16#define _MEMORYQUEUES_H_
The binary DataMessage container — the central data-exchange object of Psyclone/CMSDK.
Central shared-memory manager for a Psyclone node: master segment, per-subsystem shared maps and the ...
#define THREAD_FUNCTION_CALL
The central Psyclone data container: a self-contained binary message with typed, named user entries.
static uint32 GetRequestCount()
static bool GetMessageQueueByName(uint32 &qid, const char *name)
Look up a queue id by its global name.
static bool WaitForReply(uint32 reqID, uint32 ms, uint8 &status, DataMessage **outMsg)
Block up to ms for the reply to reqID.
static uint32 GetMessageQueueSize(uint32 qid)
static bool UnitTestQueues()
Self-test of the raw queue ring buffer.
static bool DestroyMessageQueue(uint32 qid)
Destroy a queue and release its shared memory.
MessageQueueHeader * header
Mapped queue header (points into shared memory; not owned).
friend THREAD_RET THREAD_FUNCTION_CALL QueueTest(THREAD_ARG arg)
changeSize(uint32 size)
Update the wrapper's notion of the region size.
static bool AddMessageToQueue(uint32 qid, DataMessage *msg)
Append a message (copied into shared memory).
static DataMessage * WaitForMessageQueue(uint32 qid, uint32 ms)
Block up to ms milliseconds for a message.
changeData(char *data)
Re-point the wrapper at a new mapped address.
static bool UnitTest()
Self-test of queue + request logic.
MessageQueue(char *data, uint32 size)
Attach this wrapper to a raw queue region.
static bool AddReply(uint32 reqID, bool success, DataMessage *msg)
Post the reply for request reqID.
static bool CreateMessageQueue(uint32 &qid, const char *name=NULL)
Create a new shared queue.
static bool AddRequest(DataMessage *msg, uint32 &reqID)
Submit a request message.
bool TestMemoryCommander()
Self-test hook for the memory commander.
static THREAD_RET THREAD_FUNCTION_CALL QueueTest(THREAD_ARG arg)