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

Last change on this file since 10451 was 10439, checked in by tbretz, 14 years ago
Added new class DimNetworkInfo which initialized members secs and millisecs which remain uninitialized by Dim; set the default size of the nolink argument to 0, in this way we can distinguish between an empty string and nolink.
File size: 1.6 KB
Line 
1#ifndef FACT_MessageDim
2#define FACT_MessageDim
3
4#include "MessageImp.h"
5
6
7
8#include <dis.hxx> // DimService
9
10class MessageDimTX : public DimService, public MessageImp
11{
12private:
13 bool fDebug;
14
15public:
16 MessageDimTX(const std::string &name, std::ostream &out=std::cout);
17 ~MessageDimTX();
18
19 int Write(const Time &t, const std::string &txt, int qos=kInfo);
20
21 void SetDebug(bool b=true) { fDebug=b; }
22};
23
24
25
26#include <dic.hxx> // DimStampedInfo
27
28class DimNetworkInfo : public DimStampedInfo
29{
30public:
31 DimNetworkInfo(const char *name, const char *nolink, int size, DimInfoHandler *ptr)
32 : DimStampedInfo(name, const_cast<char*>(nolink), size, ptr)
33 {
34 secs = 0;
35 millisecs = 0;
36 }
37};
38
39class MessageDimRX : public DimInfoHandler
40{
41private:
42 int fMinLogLevel;
43 bool fConnected;
44
45protected:
46 MessageImp &fMsg;
47
48private:
49 DimNetworkInfo fDimMessage;
50
51protected:
52 void infoHandler();
53
54public:
55 MessageDimRX(const std::string &name, MessageImp &imp);
56
57 void SetMinLogLevel(int min=0) { fMinLogLevel=min; }
58 bool IsConnected() const { return fConnected; }
59};
60
61#endif
62
63// **************************************************************************
64/** @class DimNetworkInfo
65
66@brief Direct derivative of DimStampedInfo
67
68Since secs and millisecs are not initialized in the base class
69valgrind throws a couple of warnings debugging applications.
70
71This derivative just initialized them with 0. It will be removed as
72soon as the initialization was done in Dim itself.
73
74**/
75// **************************************************************************
Note: See TracBrowser for help on using the repository browser.