00001 #ifndef _STATIC_CONTAINER_H 00002 #define _STATIC_CONTAINER_H 00003 /******************************************************************************* 00004 * ALMA - Atacama Large Millimiter Array 00005 * (c) European Southern Observatory, 2004 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: taskStaticContainer.h,v 1.10 2012/05/02 16:09:52 acaproni Exp $" 00022 * 00023 * who when what 00024 * -------- -------- ---------------------------------------------- 00025 * bjeram 2004-09-27 created 00026 */ 00027 00028 /************************************************************************ 00029 * 00030 *---------------------------------------------------------------------- 00031 */ 00032 00033 #ifndef __cplusplus 00034 #error This is a C++ include file and cannot be used from plain C 00035 #endif 00036 00037 #include <memory> 00038 00039 #include <maciContainerImpl.h> 00040 #include <maciLibraryManager.h> 00041 #include "AlarmSourceThread.h" 00042 #include <acserr.h> 00043 #include <ace/ARGV.h> 00044 00045 class StaticContainer 00046 { 00047 public: 00048 StaticContainer(); 00049 00050 void init(int argc, char **argv, const char *containerName=0 ); 00051 void done(); 00052 00053 CORBA::Object_ptr createComponentWithName(const char *name); 00054 00055 CORBA::Object_ptr createComponent(const char *libname); 00056 00057 CORBA::Object_ptr createComponent(const char* name, const char *libname); 00058 00059 void destroyComponent(CORBA::Object_ptr obj); 00060 00061 void executeRunCmd(const char* param); // this should not be part of generic static container 00062 protected: 00063 00064 void initCORBA(int &argc, char **argv); 00065 void doneCORBA(); 00066 00067 maci::ContainerImpl container_m; 00068 maci::LibraryManager dllmgr_m; 00069 00070 LoggingProxy *m_logger; 00071 bool services_m; 00072 00073 CORBA::ORB_var orb_m; 00074 PortableServer::POAManager_var poaManager_m; 00075 PortableServer::POA_var poaRoot_m; 00076 PortableServer::POA_var componentPOA_m; 00077 00078 // ACE_CString libName; 00079 ACE_CString containerName_m; 00080 ACE_CString componentName_m; 00081 00082 ACE_ARGV containerArgv; 00083 00084 // The thread for the alarm source 00085 std::auto_ptr<acsalarm::AlarmSourceThread> m_alarmThread_ap; 00086 00087 };//class StaticContainer 00088 00089 00090 #endif