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

Last change on this file since 16736 was 16479, checked in by tbretz, 11 years ago
Use the new Queue class to queue the Messages. This avoids Dim introduced delays during update, but we might loose log messages when a progam crashes or is shut down... we will see how it works.
File size: 1.0 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
27
28
29#include <dic.hxx> // DimStampedInfo
30
31class MessageDimRX : public DimInfoHandler
32{
33private:
34 int fMinLogLevel;
35 bool fConnected;
36
37protected:
38 MessageImp &fMsg;
39
40private:
41 DimStampedInfo fDimMessage;
42
43protected:
44 void infoHandler();
45
46public:
47 MessageDimRX(const std::string &name, MessageImp &imp);
48
49 void SetMinLogLevel(int min=0) { fMinLogLevel=min; }
50 bool IsConnected() const { return fConnected; }
51};
52
53#endif
Note: See TracBrowser for help on using the repository browser.