LoggerConsumer.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
19 #include <coil/stringutil.h>
20 #include <rtm/Typename.h>
21 #include "LoggerSkel.h"
22 #include "LoggerConsumer.h"
23 #include <iostream>
24 
25 namespace RTC
26 {
35  : m_rtobj(NULL)
36  {
37  }
38 
47  {
48  }
49 
57  bool
59  const SDOPackage::ServiceProfile& profile)
60  {
61  if (!m_logger.setObject(profile.service))
62  {
63  // narrowing failed
64  return false;
65  }
66 
67  m_rtobj = &rtobj;
68  m_profile = profile;
70  NVUtil::copyToProperties(prop, profile.properties);
71  return true;
72  }
73 
81  bool
82  LoggerConsumer::reinit(const SDOPackage::ServiceProfile& profile)
83  {
84  if (!m_logger._ptr()->_is_equivalent(profile.service))
85  {
87  if (!tmp.setObject(profile.service))
88  {
89  return false;
90  }
91  m_logger.releaseObject();
92  m_logger.setObject(profile.service);
93  }
94  m_profile= profile;
96  NVUtil::copyToProperties(prop, profile.properties);
97  return true;
98  }
99 
107  const SDOPackage::ServiceProfile&
109  {
110  return m_profile;
111  }
112 
121  {
122  }
123 
124  //============================================================
125  // protected functions
126 
127 }; // namespace RTC
128 
129 extern "C"
130 {
132  {
135  factory.addFactory(CORBA_Util::toRepositoryId<OpenRTM::Logger>(),
140  }
141 };
Component observer SDO service consumer implementation.
RT-Component.
virtual const SDOPackage::ServiceProfile & getProfile() const
getting ServiceProfile
AbstractClass * Creator()
Creator template.
void LoggerConsumerInit()
RT-Component class.
Definition: RTObject.h:89
ReturnCode addFactory(const Identifier &id, Creator creator, Destructor destructor)
Add factory.
Typename function.
CorbaConsumer< OpenRTM::Logger > m_logger
virtual void finalize()
Finalization.
static GlobalFactory< AbstractClass, Identifier, Compare, Creator, Destructor > & instance()
Create instance.
Definition: Singleton.h:131
GlobalFactory template class.
virtual bool setObject(CORBA::Object_ptr obj)
Set Object.
virtual bool reinit(const SDOPackage::ServiceProfile &profile)
Re-initialization.
void copyToProperties(coil::Properties &prop, const SDOPackage::NVList &nv)
Copy NVList to the Proeprties.
Definition: NVUtil.cpp:137
prop
Organization::get_organization_property ();.
void Destructor(AbstractClass *&obj)
Destructor template.
Class represents a set of properties.
Definition: Properties.h:101
RTC::RTObject_impl * m_rtobj
virtual ~LoggerConsumer()
dtor
LoggerConsumer()
ctor of LoggerConsumer
virtual bool init(RTObject_impl &rtobj, const SDOPackage::ServiceProfile &profile)
Initialization.
SDOPackage::ServiceProfile m_profile


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Jun 10 2019 14:07:52