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

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