EchoCORBA.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <coil/Properties.h>
4 #include "IEcho.h"
5 #include "EchoCORBASkel.h"
6 
7 //------------------------------------------------------------
8 // Echo servant for CORBA
9 //------------------------------------------------------------
10 class EchoServant
11  : public virtual doil::CORBA::CORBAServantBase,
12  public virtual POA_EchoCORBA::EchoSample
13 {
14 public:
16  : doil::CORBA::CORBAServantBase(impl)
17  {
18  std::cout << "EchoCORBAServant" << std::endl;
19  std::cout << "id : " << impl->id() << std::endl;
20  std::cout << "name: " << impl->name() << std::endl;
21  m_impl = dynamic_cast<IEcho*>(impl);
22  // std::cout << "id : " << m_impl->id() << std::endl;
23  // std::cout << "name: " << m_impl->name() << std::endl;
24  if (m_impl == NULL)
25  {
26  std::cout << "Error!!!!!: cast failed in EchoCORBAServant" << std::endl;
27  throw std::bad_alloc();
28  }
29  std::cout << " was created" << std::endl;
30  }
31  virtual ~EchoServant()
32  {
33  std::cout << "EchoServant: " << name() << " deleted." << std::endl;
34  }
35  void echo(const char* msg)
36  {
37  m_impl->echo(msg);
38  }
39 private:
41 };
42 
43 extern "C"
44 {
45  using namespace doil::CORBA;
47  {
48  std::cout << "EchoCORBAInit";
49  CORBAManager::instance().registerFactory("EchoSample",
50  doil::New<EchoServant>,
51  doil::Delete<EchoServant>);
52  std::cout << " done" << std::endl;
53  }
54 }
void echo(std::string msg)
virtual const char * name() const
EchoServant(doil::ImplBase *impl)
Definition: EchoCORBA.cpp:15
CORBA manager for doil.
void EchoCORBAInit(coil::Properties &prop)
Definition: EchoCORBA.cpp:46
virtual const char * id()=0
Definition: IEcho.h:9
prop
Organization::get_organization_property ();.
EchoImpl * m_impl
virtual const char * name()=0
Class represents a set of properties.
Definition: Properties.h:101
virtual ~EchoServant()
Definition: EchoCORBA.cpp:31
IEcho * m_impl
Definition: EchoCORBA.cpp:40
void echo(const char *msg)
Definition: EchoCORBA.cpp:35


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Jun 6 2019 19:25:58