00001 #ifndef acscomponentImpl_H 00002 #define acscomponentImpl_H 00003 00004 /******************************************************************************* 00005 * ALMA - Atacama Large Millimeter Array 00006 * Copyright (c) ESO - European Southern Observatory, 2011 00007 * (in the framework of the ALMA collaboration). 00008 * All rights reserved. 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU Lesser General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 2.1 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public 00021 * License along with this library; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 *******************************************************************************/ 00024 /************************************************************************ 00025 * E.S.O. - ACS project 00026 * 00027 * "@(#) $Id: acscomponentImpl.h,v 1.34 2013/01/16 16:24:00 acaproni Exp $" 00028 * 00029 * who when what 00030 * -------- ---------- ------------------------------------------------- 00031 * rcirami 2003/08/28 created 00032 00033 */ 00034 00035 #ifndef __cplusplus 00036 #error This is a C++ include file and cannot be used from plain C 00037 #endif 00038 00039 #include "acsutil.h" 00040 #include "logging.h" 00041 #include "loggingLoggable.h" 00042 00043 #include <acscomponentS.h> 00044 #include <acscomponentC.h> 00045 #include <acsContainerServices.h> 00046 #include <acsErrTypeLifeCycle.h> 00047 #include "lokiSmartPtr.h" 00048 00049 namespace acscomponent { 00050 00056 class ACSComponentImpl : public virtual PortableServer::RefCountServantBase, 00057 public virtual POA_ACS::ACSComponent, 00058 public Logging::Loggable 00059 { 00060 public: 00061 00071 ACSComponentImpl( 00072 const ACE_CString& name, 00073 maci::ContainerServices *containerServices); 00074 00080 virtual ~ACSComponentImpl(); 00081 00092 PortableServer::POA_var getPOA() { return m_containerServices_p->getPOA(); } 00093 00100 const char* componentName() { return m_name.c_str(); } 00101 00102 /* ------------------ [ ACSComponent interface ] ------------------ */ 00103 00115 virtual char * name (); 00116 00125 virtual ::ACS::ComponentStates componentState (); 00126 00127 /*************** Life Cycle methods ***************/ 00128 00129 00144 virtual void initialize(); 00145 00158 virtual void execute(); 00159 00174 virtual void cleanUp(); 00175 00189 virtual void aboutToAbort(); 00190 00196 virtual void __execute(); 00197 00203 virtual void __aboutToAbort(); 00204 00210 virtual void __cleanUp(); 00211 00218 virtual void __initialize(); 00219 00229 maci::ContainerServices *getContainerServices(); 00230 00231 private: 00232 00235 ACE_CString m_name; 00236 00239 //std::auto_ptr<maci::ContainerServices> m_containerServices_p; 00240 Loki::SmartPtr<maci::ContainerServices> m_containerServices_p; 00241 00242 }; 00243 00244 } // namespace acscomponent 00245 00246 00247 #endif 00248