00001 #ifndef IPC_CORE_H
00002 #define IPC_CORE_H
00003
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00017
00018 #include <omniORB4/CORBA.h>
00019 #include <string>
00020 #include <list>
00021
00022 #include <owl/mutex.h>
00023 #include <ipc/exceptions.h>
00024
00035 class IPCCore
00036 {
00037 public:
00038
00042 enum ObjectRefType { Ior,
00043 Corbaloc };
00044
00045 static void init( int & argc, char ** argv ) throw (daq::ipc::AlreadyInitialized, daq::ipc::CannotInitialize);
00046
00047 static void init( const std::list< std::pair < std::string, std::string > > & options )
00048 throw (daq::ipc::AlreadyInitialized, daq::ipc::CannotInitialize);
00049
00050 static std::list< std::pair < std::string, std::string > >
00051 extractOptions( int & argc, char ** argv )
00052 throw (daq::ipc::UnknownOption, daq::ipc::BadOptionValue);
00053
00054 static void shutdown() throw (daq::ipc::NotInitialized,daq::ipc::CorbaException);
00055
00056 static bool isInitialised() throw();
00057
00058 static CORBA::ORB_var getORB () throw(daq::ipc::NotInitialized);
00059
00060 static PortableServer::POA_var getRootPOA () throw(daq::ipc::NotInitialized);
00061
00062 static std::string objectToString( CORBA::Object_ptr obj, ObjectRefType type = Ior )
00063 throw (daq::ipc::NotInitialized,daq::ipc::CorbaException);
00064
00065 static CORBA::Object_ptr stringToObject( const std::string & ref )
00066 throw (daq::ipc::NotInitialized,daq::ipc::CorbaException);
00067
00068 private:
00069 static void atExitFun();
00070
00071 static OWLMutex * guard_;
00072 static CORBA::ORB_ptr orb_;
00073 static PortableServer::POA_ptr poa_;
00074 };
00075
00076 #endif // IPC_CORE_H