23#ifndef RestCore_TRestMessenger
24#define RestCore_TRestMessenger
26#include "TRestMetadata.h"
39 char content[MsgLength];
42 for (
int i = 0; i < MsgLength; i++) {
46 bool IsEmpty() {
return provider ==
nullptr || content[0] == 0; }
51 for (
int i = 0; i < MsgLength; i++) {
54 for (
int i = 0; i < Nmsg; i++) {
59 for (
int i = 0; i < Nmsg; i++) {
60 if (messages[i].IsEmpty()) {
68 messagepool_t* fMessagePool;
71 enum CommMode { MessagePool_Host, MessagePool_Client, MessagePool_TwoWay };
76 std::string fPoolToken;
77 std::string fPoolSource;
83 virtual void AddPool(std::string message);
85 bool lock(messagepool_t* pool,
int timeoutMs = 1000);
87 bool unlock(messagepool_t* pool,
int timeoutMs = 1000);
90 virtual bool IsConnected() {
return fMessagePool !=
nullptr; }
92 virtual void SendMessage(std::string message =
"");
94 virtual std::vector<std::string> ShowMessagePool();
96 virtual std::string ConsumeMessage();
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
virtual void Initialize() override
Making default settings.
virtual void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
Data provider and manager in REST.
void Reset()
max 100 messages, each 256 char length