source: trunk/FACT++/src/MessageDim.h@ 16774

Last change on this file since 16774 was 16737, checked in by tbretz, 11 years ago
Implement a way to check if the (Log) Message Queue is empty. Only then the Boot message of the ReadlineColor (MCP) is printed... just cosmetics for startup.
File size: 1.1 KB
Line 
1#ifndef FACT_MessageDim
2#define FACT_MessageDim
3
4#include "queue.h"
5#include "MessageImp.h"
6#include "DimDescriptionService.h"
7//#include <dis.hxx> // DimService
8
9class MessageDimTX : public DimDescribedService, public MessageImp
10{
11private:
12 bool fDebug;
13
14 Queue<std::tuple<Time,std::string,int>> fMsgQueue;
15
16 void UpdateService(const std::tuple<Time,std::string,int> &data);
17
18public:
19 MessageDimTX(const std::string &name, std::ostream &out=std::cout);
20 ~MessageDimTX();
21
22 int Write(const Time &t, const std::string &txt, int qos=kInfo);
23
24 void SetDebug(bool b=true) { fDebug=b; }
25
26 bool MessageQueueEmpty() const { return fMsgQueue.empty(); }
27};
28
29
30
31#include <dic.hxx> // DimStampedInfo
32
33class MessageDimRX : public DimInfoHandler
34{
35private:
36 int fMinLogLevel;
37 bool fConnected;
38
39protected:
40 MessageImp &fMsg;
41
42private:
43 DimStampedInfo fDimMessage;
44
45protected:
46 void infoHandler();
47
48public:
49 MessageDimRX(const std::string &name, MessageImp &imp);
50
51 void SetMinLogLevel(int min=0) { fMinLogLevel=min; }
52 bool IsConnected() const { return fConnected; }
53};
54
55#endif
Note: See TracBrowser for help on using the repository browser.