EchoIce.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <coil/Properties.h>
3 #include <doil/ice/IceManager.h>
4 #include "IEcho.h"
5 #include "EchoIceSkel.h"
6 
7 //------------------------------------------------------------
8 // Echo servant for Ice
9 //------------------------------------------------------------
10 namespace EchoIce
11 {
13  : public virtual Demo::EchoSample,
14  public virtual doil::Ice::IceServantBase
15 {
16 public:
18  : doil::Ice::IceServantBase(impl)
19  {
20  std::cout << "EchoIceServant";
21  m_impl = dynamic_cast<IEcho*>(impl);
22  if (m_impl == NULL) throw std::bad_alloc();
23  std::cout << " created." << std::endl;
24  }
25  virtual ~EchoServant()
26  {
27  std::cout << "EchoServant: " << name() << " deleted." << std::endl;
28  }
29  virtual void echo(const std::string& msg, const Ice::Current&)
30  {
31  std::cout << "servant" << name() << "::echo() was called" << std::endl;
32  m_impl->echo(msg);
33  }
34 private:
36 };
37 };
38 extern "C"
39 {
40  using namespace doil::Ice;
42  {
43  std::cout << "EchoIceInit";
44  IceManager::instance().registerFactory("EchoSample",
45  doil::New<EchoIce::EchoServant>,
46  doil::Delete<EchoIce::EchoServant>);
47  std::cout << " done" << std::endl;
48  }
49 }
Ice manager for doil.
virtual const char * name() const
virtual void echo(std::string msg)=0
virtual void echo(const std::string &msg, const Ice::Current &)
Definition: EchoIce.cpp:29
virtual ~EchoServant()
Definition: EchoIce.cpp:25
EchoServant(doil::ImplBase *impl)
Definition: EchoIce.cpp:17
Definition: IEcho.h:9
prop
Organization::get_organization_property ();.
Class represents a set of properties.
Definition: Properties.h:101
void EchoIceInit(coil::Properties &prop)
Definition: EchoIce.cpp:41


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Feb 28 2022 23:00:43