ControlTaskServer.hpp
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 #include "../rtt-config.h"
00043 #ifndef _REENTRANT
00044 #define _REENTRANT
00045 #endif
00046 #include "corba.h"
00047 #ifdef CORBA_IS_TAO
00048 #include <tao/corba.h>
00049 #include "ControlTaskS.h"
00050 #else
00051 #include <omniORB4/CORBA.h>
00052 #include "ControlTaskC.h"
00053 #endif
00054 #include "../TaskContext.hpp"
00055 #include "ApplicationServer.hpp"
00056 #include "../ActivityInterface.hpp"
00057
00058 namespace RTT
00059 {namespace Corba
00060 {
00061 class OrbRunner;
00062 class ControlTaskProxy;
00063
00070 class RTT_CORBA_API ControlTaskServer
00071 : public ApplicationServer
00072 {
00073 protected:
00074 friend class OrbRunner;
00075 friend class ControlTaskProxy;
00076
00077 typedef std::map<TaskContext*, ControlTaskServer*> ServerMap;
00078 static ServerMap servers;
00079 static ActivityInterface* orbrunner;
00080
00084 ControlTaskServer(TaskContext* taskcontext, bool use_naming);
00085
00086 Corba::ControlTask_var mtask;
00087 TaskContext* mtaskcontext;
00088 bool muse_naming;
00089
00094 ~ControlTaskServer();
00095
00100 static void DoShutdownOrb(bool wait_for_completion = true);
00101 public:
00102
00108 static void ShutdownOrb(bool wait_for_completion = true);
00109
00113 static void CleanupServers();
00114
00119 static void RunOrb();
00120
00126 static void ThreadOrb();
00127
00131 static void DestroyOrb();
00132
00140 static ControlTaskServer* Create(TaskContext* tc, bool use_naming = true);
00141
00151 static ControlTask_ptr CreateServer(TaskContext* tc, bool use_naming = true);
00152
00158 ControlTask_ptr server() const;
00159 };
00160 }}
00161 #endif