Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef ORO_CORBA_CONTROLTASK_SERVER_HPP
00039 #define ORO_CORBA_CONTROLTASK_SERVER_HPP
00040
00041 #include <map>
00042 #ifndef _REENTRANT
00043 #define _REENTRANT
00044 #endif
00045 #include "corba.h"
00046 #ifdef CORBA_IS_TAO
00047 #include "TaskContextS.h"
00048 #else
00049 #include "TaskContextC.h"
00050 #endif
00051 #include "../../TaskContext.hpp"
00052 #include "ApplicationServer.hpp"
00053 #include "../../base/ActivityInterface.hpp"
00054
00055 class RTT_corba_CTaskContext_i;
00056 namespace RTT
00057 {namespace corba
00058 {
00065 class RTT_CORBA_API TaskContextServer
00066 : public ApplicationServer
00067 {
00068 protected:
00069 friend class OrbRunner;
00070 friend class TaskContextProxy;
00071
00072 typedef std::map<TaskContext*, TaskContextServer*> ServerMap;
00073 static ServerMap servers;
00074 static base::ActivityInterface* orbrunner;
00075 static bool is_shutdown;
00076
00077 PortableServer::POA_var mpoa;
00078
00079 typedef std::map<TaskContext*, std::string> IorMap;
00080 static IorMap iors;
00081
00085 TaskContextServer(TaskContext* taskcontext, bool use_naming, bool require_name_service);
00086
00087 PortableServer::ServantBase_var mtask_i;
00088 corba::CTaskContext_var mtask;
00089 TaskContext* mtaskcontext;
00090 bool muse_naming;
00091
00096 static void DoShutdownOrb(bool wait_for_completion = true);
00097 public:
00098
00103 ~TaskContextServer();
00104
00110 static void ShutdownOrb(bool wait_for_completion = true);
00111
00115 static void CleanupServers();
00116
00121 static void RunOrb();
00122
00129 static void ThreadOrb();
00130
00136 static void ThreadOrb(int scheduler, int priority = RTT::os::LowestPriority, unsigned cpu_affinity = 0);
00137
00141 static void DestroyOrb();
00142
00152 static TaskContextServer* Create(TaskContext* tc, bool use_naming = true, bool require_name_service = false);
00153
00167 static CTaskContext_ptr CreateServer(TaskContext* tc, bool use_naming = true, bool require_name_service = false);
00168
00173 static void CleanupServer( TaskContext* tc );
00174
00181 CTaskContext_ptr server() const;
00182
00188 static std::string getIOR(TaskContext* tc);
00189
00190
00191 };
00192 }}
00193 #endif