Go to the documentation of this file.00001 #ifndef MONITOR_POINT_IMPL_H
00002 #define MONITOR_POINT_IMPL_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __cplusplus
00029 #error This is a C++ include file and cannot be used from plain C
00030 #endif
00031
00032 #include <tao/DynamicInterface/Request.h>
00033
00034 #include "MonitorCollectorS.h"
00035 #include <baciCharacteristicComponentImpl.h>
00036 #include <TMCDBCOMMON_IDLS.h>
00037 namespace TMCDB
00038 {
00039
00040
00044 class MonitorPointBase : public virtual POA_ACS::Callback
00045 {
00046 public:
00047 MonitorPointBase(const char *propertyName, const ACS::TimeInterval &archivingInterval, TMCDB::DataValueType typeOfData, MonitorBlob& mb);
00048
00049 virtual ~MonitorPointBase();
00050
00051 void setPropertySerialNumber(serialNumberTypeSeq& sn);
00052
00053 ACE_CString &getPropertyName() { return propertyName_m; }
00054
00055 CORBA::Boolean negotiate(ACS::TimeInterval, const ACS::CBDescOut&){ return true; }
00056
00058 virtual void activate(maci::ContainerServices *cs);
00059
00061 virtual void startMonitoring()=0;
00062
00064 virtual void stopMonitoring()=0;
00065
00067 virtual void fillSeq()=0;
00068
00069 virtual void set_archiving_interval(ACS::TimeInterval time)=0;
00070
00071 virtual void suppress_archiving()=0;
00072
00073 virtual void enable_archiving()=0;
00074
00075 protected:
00076
00077 ACE_CString propertyName_m;
00078
00079 ACS::TimeInterval archivingInterval_m;
00080
00081 double valuePercentTrigger_m;
00082
00083 MonitorBlob& monitorBlob_m;
00084
00085 ACS::Monitor_var monitor_m;
00086
00087 ACS::OffShoot_var callback_m;
00088
00089 unsigned int curSeqPos_m;
00090
00091 unsigned int seqLen_m;
00092
00093 ACE_Thread_Mutex switchMutex_m;
00094
00095 bool suppressed_m;
00096
00097 static const unsigned int prealocSeqLen_m = 100;
00098
00099 };
00100
00101 template <class T, class TBLOB_SEQ, class TPROP, class TCB, class TBASE>
00102 class MonitorPoint : public MonitorPointBase, public virtual TCB
00103 {
00104 public:
00105 MonitorPoint(const char *propertyName, const ACS::TimeInterval &monitoringInterval, ACS::Property* property, TMCDB::DataValueType typeOfData, MonitorBlob& mb);
00106
00107 ~MonitorPoint();
00108
00110 void startMonitoring();
00111
00113 void stopMonitoring();
00114
00115 void fillSeq();
00116
00117 void set_archiving_interval(ACS::TimeInterval time);
00118
00119 void suppress_archiving();
00120
00121 void enable_archiving();
00122
00124 void working(T value, const ACSErr::Completion& comp, const ACS::CBDescOut& cbdescout);
00125
00127 void done(T value, const ACSErr::Completion& comp, const ACS::CBDescOut& cbdescout);
00128 protected:
00129 TPROP* property_m;
00130 TBLOB_SEQ blobDataSeq_m;
00131 TBASE valueTrigger_m;
00132 };
00133
00134 template <class T>
00135 T initValue(unsigned int len);
00136 template <>
00137 char* initValue(unsigned int len);
00138 #include "MonitorPoint.i"
00139
00140 };
00141
00142 #endif