22 #define ORO_MEMORY_POOL 30 #include <transports/corba/ServiceC.h> 53 enum { INITIAL, CALL,
SEND, FINAL } callBackPeer_step;
56 TheServer(
string name) :
TaskContext(name), mi1(
"mi"), mo1(
"mo"), callBackPeer_step(INITIAL), callBackPeer_count(0) {
57 ports()->addEventPort( mi1 );
58 ports()->addPort( mo1 );
59 this->createOperationCallerFactories(
this );
71 double d = 123456.789;
82 int count = ++callBackPeer_count;
84 if (callBackPeer_step == INITIAL) callBackPeer_step = CALL;
86 log(
Info) <<
"Server executes callBackPeer():"<< count <<
endlog();
87 if (callBackPeer_step == CALL) {
88 callBackPeer_step = SEND;
90 op1(
this,
"callBackPeerOwn");
91 log(
Info) <<
"Server finishes call back peer:" << count <<
endlog();
93 else if (callBackPeer_step == SEND) {
94 callBackPeer_step = FINAL;
97 this,
"callBackPeer");
98 log(
Info) <<
"Server finishes send back peer:" << count <<
endlog();
100 log(
Info) <<
"Server finishes callBackPeer():" << count <<
endlog();
105 callBackPeer_count = 0;
106 callBackPeer_step = INITIAL;
118 rtMem = malloc(BUILD_TEST_RT_MEM_POOL_SIZE);
121 assert((
size_t)-1 != freeMem);
129 pid_t pid = getpid();
130 std::ofstream pidfile(
"corba-ipc-server.pid");
131 pidfile << pid <<
endl;
size_t init_memory_pool(size_t mem_pool_size, void *mem_pool)
void callBackPeer(TaskContext *peer, string const &opname)
static RTT_CORBA_API bool InitOrb(int argc, char *argv[], Seconds orb_timeout=0)
static TaskContextServer * Create(TaskContext *tc, bool use_naming=true, bool require_name_service=false)
WriteStatus write(const T &sample)
basic_ostreams & endl(basic_ostreams &s)
OperationInterfacePart * getOperation(std::string name)
static boost::shared_ptr< PluginLoader > Instance()
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
int ORO_main(int argc, char **argv)
corba::TaskContextServer * ts
static Logger::LogFunction endlog()