| 1 | #ifndef FACT_MessageDim
|
|---|
| 2 | #define FACT_MessageDim
|
|---|
| 3 |
|
|---|
| 4 | #include "MessageImp.h"
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 | #include "DimDescriptionService.h"
|
|---|
| 9 | //#include <dis.hxx> // DimService
|
|---|
| 10 |
|
|---|
| 11 | class MessageDimTX : public DimDescribedService, public MessageImp
|
|---|
| 12 | {
|
|---|
| 13 | private:
|
|---|
| 14 | bool fDebug;
|
|---|
| 15 |
|
|---|
| 16 | public:
|
|---|
| 17 | MessageDimTX(const std::string &name, std::ostream &out=std::cout);
|
|---|
| 18 | ~MessageDimTX();
|
|---|
| 19 |
|
|---|
| 20 | int Write(const Time &t, const std::string &txt, int qos=kInfo);
|
|---|
| 21 |
|
|---|
| 22 | void SetDebug(bool b=true) { fDebug=b; }
|
|---|
| 23 | };
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | #include <dic.hxx> // DimStampedInfo
|
|---|
| 28 |
|
|---|
| 29 | class DimNetworkInfo : public DimStampedInfo
|
|---|
| 30 | {
|
|---|
| 31 | public:
|
|---|
| 32 | DimNetworkInfo(const char *name, const char *nolink, int size, DimInfoHandler *ptr)
|
|---|
| 33 | : DimStampedInfo(name, const_cast<char*>(nolink), size, ptr)
|
|---|
| 34 | {
|
|---|
| 35 | secs = 0;
|
|---|
| 36 | millisecs = 0;
|
|---|
| 37 | }
|
|---|
| 38 | };
|
|---|
| 39 |
|
|---|
| 40 | class MessageDimRX : public DimInfoHandler
|
|---|
| 41 | {
|
|---|
| 42 | private:
|
|---|
| 43 | int fMinLogLevel;
|
|---|
| 44 | bool fConnected;
|
|---|
| 45 |
|
|---|
| 46 | protected:
|
|---|
| 47 | MessageImp &fMsg;
|
|---|
| 48 |
|
|---|
| 49 | private:
|
|---|
| 50 | DimNetworkInfo fDimMessage;
|
|---|
| 51 |
|
|---|
| 52 | protected:
|
|---|
| 53 | void infoHandler();
|
|---|
| 54 |
|
|---|
| 55 | public:
|
|---|
| 56 | MessageDimRX(const std::string &name, MessageImp &imp);
|
|---|
| 57 |
|
|---|
| 58 | void SetMinLogLevel(int min=0) { fMinLogLevel=min; }
|
|---|
| 59 | bool IsConnected() const { return fConnected; }
|
|---|
| 60 | };
|
|---|
| 61 |
|
|---|
| 62 | #endif
|
|---|
| 63 |
|
|---|
| 64 | // **************************************************************************
|
|---|
| 65 | /** @class DimNetworkInfo
|
|---|
| 66 |
|
|---|
| 67 | @brief Direct derivative of DimStampedInfo
|
|---|
| 68 |
|
|---|
| 69 | Since secs and millisecs are not initialized in the base class
|
|---|
| 70 | valgrind throws a couple of warnings debugging applications.
|
|---|
| 71 |
|
|---|
| 72 | This derivative just initialized them with 0. It will be removed as
|
|---|
| 73 | soon as the initialization was done in Dim itself.
|
|---|
| 74 |
|
|---|
| 75 | **/
|
|---|
| 76 | // **************************************************************************
|
|---|