• 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.22 2008/10/09 04:56:55 cparedes 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 
00048 namespace maci {
00049 
00058    class ContainerServices : public Logging::Loggable {
00059     public:
00066         ContainerServices(ACE_CString& compName, PortableServer::POA_ptr poa);
00067         
00068         
00072         virtual ~ContainerServices();
00073     
00074     protected:
00085         virtual CORBA::Object* getCORBAComponent(const char* name)=0;
00097        virtual CORBA::Object* getCORBAComponentNonSticky(const char* name)=0;
00098   
00112         virtual CORBA::Object* getCORBADynamicComponent(maci::ComponentSpec compSpec, bool markAsDefault)=0;
00113 
00128         virtual CORBA::Object* getCORBACollocatedComponent(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent)
00129             =0;
00130         
00141         virtual CORBA::Object* getCORBADefaultComponent(const char* idlType)=0; 
00142         
00143     public:
00144     
00150         ACE_CString getName() {
00151             return m_componentName;
00152         }
00153         
00164         PortableServer::POA_var getPOA() { 
00165             return m_poa; 
00166         }
00167 
00168                 
00169         void registerComponentListener(ComponentListener* listener);
00170         void fireComponentsUnavailable(ACE_CString_Vector& compNames);
00171         void fireComponentsAvailable(ACE_CString_Vector& compNames);
00172  
00184         template<class T> T* getComponent(const char *name);        
00185         
00198        template<class T> T* getComponentNonSticky(const char *name);
00199 
00214         template<class T> T* getDynamicComponent(maci::ComponentSpec compSpec, bool markAsDefault);
00230         template<class T> T* getCollocatedComponent(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent);
00231     
00243         template<class T> T* getDefaultComponent(const char* idlType);
00244       
00256          template <typename T>
00257          SmartPtr<T> getComponentSmartPtr(const char *name);    
00258 
00271          template <typename T>
00272          SmartPtr<T> getComponentNonStickySmartPtr(const char *name);
00273 
00288          template <typename T>
00289          SmartPtr<T> getDynamicComponentSmartPtr(maci::ComponentSpec compSpec, bool markAsDefault);
00290 
00306          template <typename T>
00307          SmartPtr<T> getCollocatedComponentSmartPtr(maci::ComponentSpec compSpec, bool markAsDefault, const char* targetComponent);
00308 
00320          template <typename T>
00321          SmartPtr<T> getDefaultComponentSmartPtr(const char* idlType); 
00322 
00330         virtual maci::ComponentInfo getComponentDescriptor(const char* componentName)=0;
00331         
00346         virtual ACE_CString_Vector findComponents(const char *nameWilcard, const char *typeWildcard)=0;
00347     
00358         virtual void releaseComponent(const char *name)=0;
00359       
00365         virtual void releaseAllComponents()=0;
00366     
00376         virtual CDB::DAL_ptr getCDB()=0;
00377       
00381         virtual PortableServer::POA_var getOffShootPOA()=0;
00382     
00392         virtual ACS::OffShoot_ptr activateOffShoot(PortableServer::Servant cbServant)=0;
00393       
00400         virtual void deactivateOffShoot(PortableServer::Servant cbServant)=0;
00401       
00406         virtual PortableServer::POA_var createOffShootPOA()=0;
00407         
00421         virtual ComponentStateManager* getComponentStateManager()=0;
00422 
00432        virtual ACS::ThreadManager* getThreadManager(){ return &threadManager_m; }
00433 
00434    protected:
00435         ACE_CString m_componentName;
00436         
00437         ComponentListener* compListener; 
00438         bool withCompListener; 
00443         PortableServer::POA_var m_poa;
00444 
00448        // It could be that the manager should be moved to MACIContainerServices
00449        ACS::ThreadManager threadManager_m;
00450       
00451    };
00452    
00453 }; // namespace maci
00454 
00455 // Include the implementation 
00456 #include "acsContainerServices.i"
00457    
00458 
00459 
00460 #endif // acsContainerServices_h

Generated on Thu Jul 8 2010 19:47:46 for ACS-9.0 C++ API by  doxygen 1.7.0