| 1 | #ifndef FACT_MessageDim
|
|---|
| 2 | #define FACT_MessageDim
|
|---|
| 3 |
|
|---|
| 4 | #include "MessageImp.h"
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 | #include <dis.hxx> // DimService
|
|---|
| 9 |
|
|---|
| 10 | class MessageDimTX : public DimService, public MessageImp
|
|---|
| 11 | {
|
|---|
| 12 | private:
|
|---|
| 13 | bool fDebug;
|
|---|
| 14 |
|
|---|
| 15 | public:
|
|---|
| 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 |
|
|---|
| 28 | class DimNetworkInfo : public DimStampedInfo
|
|---|
| 29 | {
|
|---|
| 30 | public:
|
|---|
| 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 |
|
|---|
| 39 | class MessageDimRX : public DimInfoHandler
|
|---|
| 40 | {
|
|---|
| 41 | private:
|
|---|
| 42 | int fMinLogLevel;
|
|---|
| 43 | bool fConnected;
|
|---|
| 44 |
|
|---|
| 45 | protected:
|
|---|
| 46 | MessageImp &fMsg;
|
|---|
| 47 |
|
|---|
| 48 | private:
|
|---|
| 49 | DimNetworkInfo fDimMessage;
|
|---|
| 50 |
|
|---|
| 51 | protected:
|
|---|
| 52 | void infoHandler();
|
|---|
| 53 |
|
|---|
| 54 | public:
|
|---|
| 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 |
|
|---|
| 68 | Since secs and millisecs are not initialized in the base class
|
|---|
| 69 | valgrind throws a couple of warnings debugging applications.
|
|---|
| 70 |
|
|---|
| 71 | This derivative just initialized them with 0. It will be removed as
|
|---|
| 72 | soon as the initialization was done in Dim itself.
|
|---|
| 73 |
|
|---|
| 74 | **/
|
|---|
| 75 | // **************************************************************************
|
|---|