CORBAModule.h

Go to the documentation of this file.
00001 /* ======================================================================== 
00002  * Copyright (C) 2006  Graz University of Technology
00003  *
00004  * This framework is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This framework is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this framework; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  *
00018  * For further information please contact 
00019  * Dieter Schmalstieg
00020  * <schmalstieg@icg.tu-graz.ac.at>
00021  * Graz University of Technology, 
00022  * Institut for Computer Graphics and Vision,
00023  * Inffeldgasse 16a, 8010 Graz, Austria.
00024  * ========================================================================
00025  * PROJECT: OpenTracker
00026  * ======================================================================== */
00033  /* ======================================================================= */
00034 
00044 #ifndef _CORBAMODULE_H
00045 #define _CORBAMODULE_H
00046 
00047 #ifdef USE_CORBA
00048 
00049 #include "../dllinclude.h"
00050 
00051 #include <vector>
00052 
00053 #include <OpenTracker/skeletons/OT_CORBA.hh>
00054 #include <OpenTracker/core/Module.h>
00055 #include <OpenTracker/core/NodeFactory.h>
00056 #include <OpenTracker/network/CORBASink.h>
00057 #include <OpenTracker/network/CORBASource.h>
00058 #ifdef USE_OMNIEVENTS
00059 #include <OpenTracker/network/PushSupp.h>
00060 #include <OpenTracker/network/PushCons.h>
00061 #ifdef USE_SHARED
00062 #include <OpenTracker/network/SharedEngineNode.h>
00063 #endif //USE_SHARED
00064 #endif //USE_OMNIEVENTS
00065 
00066 namespace ot {
00067 
00068 typedef std::vector<CORBASink*> CORBASinkVector;
00069 typedef std::map<CORBASource*, OT_CORBA::OTSource_var> SourceNodeMap;
00070 #ifdef USE_OMNIEVENTS
00071 #ifdef USE_SHARED
00072 typedef std::vector<SharedEngineNode*> SharedEngineNodeVector;
00073 #endif //USE_SHARED
00074 typedef std::vector<PushSupp*> PushSuppVector;
00075 typedef std::vector<PushCons*> PushConsVector;
00076 typedef std::map<PushCons*, CosEventChannelAdmin::ProxyPushSupplier_var> ProxyPushSupplierMap;
00077 #endif //USE_OMNIEVENTS
00078 
00087 class OPENTRACKER_API CORBAModule : public Module, public NodeFactory
00088 {
00089 // Members
00090 protected:
00092     CORBASinkVector sinks;
00093     SourceNodeMap sources;
00094 #ifdef USE_OMNIEVENTS
00095     PushSuppVector pushsupps;
00096     PushConsVector pushconsumers;
00097     ProxyPushSupplierMap proxy_pushsupplier_map;
00098 #ifdef USE_SHARED
00099     SharedEngineNodeVector sharedengines;
00100 #endif
00101 #endif
00102     static bool persistent;
00103 
00104 // Methods
00105 public:
00107  CORBAModule() : Module(), NodeFactory()
00108     {
00109       // Empty constructor
00110     };
00112     virtual ~CORBAModule();
00113 
00114     virtual void init(StringTable& attributes,  ConfigNode * localTree);
00115 
00117     static void initializeORB(int argc, char **argv);
00118 
00120     void runORB();
00121 
00123     void destroyORB();
00124 
00125     static PortableServer::POAManager_var pman;
00126     static PortableServer::POA_var getPOA() { return PortableServer::POA::_duplicate(CORBAModule::poa); };
00127     static PortableServer::POA_var getRootPOA() { return PortableServer::POA::_duplicate(CORBAModule::root_poa); };
00128     static PortableServer::POAManager_var getPOAManager() { return PortableServer::POAManager::_duplicate(pman); }
00129     static CORBA::ORB_var getORB() { return CORBA::ORB::_duplicate(CORBAModule::orb); };
00130     
00132     virtual void clear();
00133     virtual void removeNode(const Node *);
00141     virtual Node * createNode( const std::string& name,  StringTable& attributes);
00146     virtual void pushEvent();
00147     
00148     
00149 private:
00150     static CORBA::ORB_var orb;
00151     //CORBA::Object_var objref;
00152     static PortableServer::POA_var poa;
00153     static PortableServer::POA_var root_poa;
00154     static bool initialised;
00155 
00156 };
00157 
00158 OT_MODULE(CORBAModule);
00159 
00160 } // namespace ot
00161 
00162 #endif //USE_CORBA
00163 
00164 #endif

Generated on Wed Feb 28 15:18:50 2007 for NaviTrack by  doxygen 1.4.6