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

acsContainerServices.h

Go to the documentation of this file.
00001 #ifndef acsContainerServices_h
00002 #define acsContainerServices_h
00003 /*******************************************************************************
00004  *    ALMA - Atacama Large Millimiter Array
00005  *    (c) European Southern Observatory, 2002
00006  *    Copyright by ESO (in the framework of the ALMA collaboration)
00007  *    and Cosylab 2002, All rights reserved
00008  *
00009  *    This library is free software; you can redistribute it and/or
00010  *    modify it under the terms of the GNU Lesser General Public
00011  *    License as published by the Free Software Foundation; either
00012  *    version 2.1 of the License, or (at your option) any later version.
00013  *
00014  *    This library is distributed in the hope that it will be useful,
00015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  *    Lesser General Public License for more details.
00018  *
00019  *    You should have received a copy of the GNU Lesser General Public
00020  *    License along with this library; if not, write to the Free Software
00021  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00022  *
00023  *
00024  * "@(#) $Id: acsContainerServices.h,v 1.24 2011/10/14 16:57:57 rtobar Exp $"
00025  *
00026  * who       when      what
00027  * --------  --------  ----------------------------------------------
00028  * acaproni  2005-04-06  created
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        // It could be that the manager should be moved to MACIContainerServices
00469        ACS::ThreadManager threadManager_m;
00470       
00471    };
00472    
00473 }; // namespace maci
00474 
00475 // Include the implementation 
00476 #include "acsContainerServices.i"
00477    
00478 
00479 
00480 #endif // acsContainerServices_h

Generated on Thu Jan 12 2012 23:13:50 for ACS-10.0 C++ API by  doxygen 1.7.0