• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

MonitorCollectorImpl.h

Go to the documentation of this file.
00001 #ifndef MONITOR_COLLECTOR_IMPL_H
00002 #define MONITOR_COLLECTOR_IMPL_H
00003 /*******************************************************************************
00004 * ALMA - Atacama Large Millimiter Array
00005 * (c) European Southern Observatory, 2009
00006 *
00007 * This library is free software; you can redistribute it and/or
00008 * modify it under the terms of the GNU Lesser General Public
00009 * License as published by the Free Software Foundation; either
00010 * version 2.1 of the License, or (at your option) any later version.
00011 *
00012 * This library is distributed in the hope that it will be useful,
00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 * Lesser General Public License for more details.
00016 *
00017 * You should have received a copy of the GNU Lesser General Public
00018 * License along with this library; if not, write to the Free Software
00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020 *
00021 * "@(#) $Id: MonitorCollectorImpl.h,v 1.3 2012/01/21 22:48:11 tstaig Exp $"
00022 *
00023 * who       when      what
00024 * --------  --------  ----------------------------------------------
00025 * bjeram  2009-02-11  created
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 "MonitorComponent.h"
00033 #include <ace/Synch.h>
00034 #include <ace/Hash_Map_Manager_T.h>
00035 #include <MonitorArchiverIFC.h>
00036 
00037 namespace TMCDB
00038 {
00039 
00043 class MonitorCollectorImpl :
00044 public acscomponent::ACSComponentImpl,
00045 public POA_TMCDB::MonitorCollector
00046 {
00047 public:
00048         MonitorCollectorImpl(const ACE_CString& name,
00049                         maci::ContainerServices * containerServices);
00050 
00051         ~MonitorCollectorImpl();
00052 
00053         // componnet's life cycle
00054         void initialize();
00055 
00056         void cleanUp();
00057 
00058 
00059         // implementations of IDL's methods
00060 
00061         //version where it is not checked if monitored device is collocated
00062         void registerNonCollocatedMonitoredDevice (const char * componentName, const char* serialNumber);
00063         void registerCollocatedMonitoredDevice (const char * componentName, const char* serialNumber);
00065         void registerMonitoredDevice (const char * componentName, const char* serialNumber);
00066 
00067         void registerNonCollocatedMonitoredDeviceWithMultipleSerial(const char*componentName, const TMCDB::propertySerialNumberSeq& serialNumbers);
00068         void registerCollocatedMonitoredDeviceWithMultipleSerial(const char*componentName, const TMCDB::propertySerialNumberSeq& serialNumbers);
00070         void registerMonitoredDeviceWithMultipleSerial(const char*componentName, const TMCDB::propertySerialNumberSeq& serialNumbers);
00071 
00072         void deregisterMonitoredDevice (const char * componentName);
00073 
00074         void startMonitoring (const char * componentName);
00075 
00076         void stopMonitoring (const char * componentName);
00077 
00078         TMCDB::MonitorDataBlocks * getMonitorData ();
00079 
00080         void set_archiving_interval(const char* componentName, const char* propertyName, ACS::TimeInterval time);
00081 
00082         void suppress_archiving(const char* componentName, const char* propertyName);
00083 
00084         void enable_archiving(const char* componentName, const char* propertyName);
00085 
00086 private:
00087 
00089         void registerMonitoredComponentWithSerial(const char * componentName, const char* serialNumber, bool checkCollocation);
00091         void registerMonitoredComponentWithMultipleSerial(const char*componentName, const TMCDB::propertySerialNumberSeq& serialNumbers, bool checkCollocation);
00092 
00095         MonitorComponent* registerMonitoredComponent (const char * componentName, bool checkCollocation=true);
00096 
00097         ACE_Hash_Map_Manager <ACE_CString, MonitorComponent*, ACE_Recursive_Thread_Mutex> monitorComponents_m;
00098 
00099         ACE_Recursive_Thread_Mutex mcMutex_m; 
00100 
00101         unsigned int numOfComponents_m; 
00102 
00104         maci::ContainerServices *contServ_m;
00105 
00107         MonitorArchiver::Controller_var archiveMonitorController_m;
00108 };//class MonitorCollectorImpl
00109 
00110 
00111 
00112 };//namespace TMCDB
00113 
00114 
00115 #endif 

Generated on Mon May 4 2015 08:27:43 for ACS-2015.4 C++ API by  doxygen 1.7.0