Go to the documentation of this file.00001 #ifndef acsContainerServices_h
00002 #define acsContainerServices_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
00029
00030
00031 #ifndef __cplusplus
00032 #error This is a C++ include file and cannot be used from plain C
00033 #endif
00034
00035 #include <acscomponentS.h>
00036 #include <acscomponentC.h>
00037 #include <maciC.h>
00038 #include <acsErrTypeContainerServices.h>
00039 #include <cdbDALS.h>
00040 #include <acsComponentStateManager.h>
00041 #include <acsThreadManager.h>
00042 #include <logging.h>
00043 #include <loggingLoggable.h>
00044 #include <maciErrType.h>
00045 #include <acsComponentListener.h>
00046 #include <acsComponentSmartPtr.h>
00047 #include <AlarmSource.h>
00048
00049 namespace maci {
00050
00059 class ContainerServices : public Logging::Loggable {
00060 public:
00067 ContainerServices(ACE_CString& compName, PortableServer::POA_ptr poa);
00068
00069
00073 virtual ~ContainerServices();
00074
00075 protected:
00086 virtual CORBA::Object* getCORBAComponent(const char* name)=0;
00098 virtual CORBA::Object* getCORBAComponentNonSticky(const char* name)=0;
00099
00113 virtual CORBA::Object* getCORBADynamicComponent(maci::ComponentSpec compSpec, bool markAsDefault)=0;
00114
00129 virtual CORBA::Object* getCORBACollocatedComponent(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent)
00130 =0;
00131
00142 virtual CORBA::Object* getCORBADefaultComponent(const char* idlType)=0;
00143
00144 public:
00145
00151 ACE_CString getName() {
00152 return m_componentName;
00153 }
00154
00160 ACE_CString getType() {
00161 return m_componentType;
00162 }
00163
00174 PortableServer::POA_var getPOA() {
00175 return m_poa;
00176 }
00177
00178
00179 void registerComponentListener(ComponentListener* listener);
00180 void fireComponentsUnavailable(ACE_CString_Vector& compNames);
00181 void fireComponentsAvailable(ACE_CString_Vector& compNames);
00182
00194 template<class T> T* getComponent(const char *name);
00195
00208 template<class T> T* getComponentNonSticky(const char *name);
00209
00224 template<class T> T* getDynamicComponent(maci::ComponentSpec compSpec, bool markAsDefault);
00240 template<class T> T* getCollocatedComponent(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent);
00241
00253 template<class T> T* getDefaultComponent(const char* idlType);
00254
00266 template <typename T>
00267 SmartPtr<T> getComponentSmartPtr(const char *name);
00268
00281 template <typename T>
00282 SmartPtr<T> getComponentNonStickySmartPtr(const char *name);
00283
00298 template <typename T>
00299 SmartPtr<T> getDynamicComponentSmartPtr(maci::ComponentSpec compSpec, bool markAsDefault);
00300
00316 template <typename T>
00317 SmartPtr<T> getCollocatedComponentSmartPtr(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent);
00318
00330 template <typename T>
00331 SmartPtr<T> getDefaultComponentSmartPtr(const char* idlType);
00332
00340 virtual maci::ComponentInfo getComponentDescriptor(const char* componentName)=0;
00341
00356 virtual ACE_CString_Vector findComponents(const char *nameWilcard, const char *typeWildcard)=0;
00357
00368 virtual void releaseComponent(const char *name)=0;
00369
00375 virtual void releaseAllComponents()=0;
00376
00386 virtual CDB::DAL_ptr getCDB()=0;
00387
00391 virtual PortableServer::POA_var getOffShootPOA()=0;
00392
00402 virtual ACS::OffShoot_ptr activateOffShoot(PortableServer::Servant cbServant)=0;
00403
00410 virtual void deactivateOffShoot(PortableServer::Servant cbServant)=0;
00411
00416 virtual PortableServer::POA_var createOffShootPOA()=0;
00417
00431 virtual ComponentStateManager* getComponentStateManager()=0;
00432
00440 virtual acsalarm::AlarmSource* getAlarmSource()=0;
00441
00451 virtual ACS::ThreadManager* getThreadManager(){ return &threadManager_m; }
00452
00453 protected:
00454 ACE_CString m_componentName;
00455 ACE_CString m_componentType;
00456
00457 ComponentListener* compListener;
00458 bool withCompListener;
00463 PortableServer::POA_var m_poa;
00464
00468
00469 ACS::ThreadManager threadManager_m;
00470
00471 };
00472
00473 };
00474
00475
00476 #include "acsContainerServices.i"
00477
00478
00479
00480 #endif // acsContainerServices_h