OpenRTM-aist  2.1.0
RTObject.h
Go to the documentation of this file.
1 // -*- C++ -*-
18 #ifndef RTC_RTOBJECT_H
19 #define RTC_RTOBJECT_H
20 
21 // CORBA header include
22 #include <coil/Properties.h>
23 #include <coil/Task.h>
24 
25 #include <rtm/RTC.h>
26 #include <rtm/idl/RTCSkel.h>
27 #include <rtm/idl/OpenRTMSkel.h>
28 #include <rtm/PortBase.h>
29 #include <rtm/PortAdmin.h>
30 #include <rtm/InPortBase.h>
31 #include <rtm/OutPortBase.h>
32 #include <rtm/CorbaPort.h>
33 #include <rtm/ConfigAdmin.h>
34 #include <rtm/SystemLogger.h>
36 #include <rtm/SdoServiceAdmin.h>
38 #include <rtm/FsmActionListener.h>
39 
40 #include <string>
41 #include <vector>
42 
43 #define ECOTHER_OFFSET 1000
44 
45 namespace SDOPackage
46 {
47  class Configuration_impl;
48 } // namespace SDOPackage
49 
50 namespace RTC
51 {
52  class Manager;
53  class ExecutionContextBase;
54  using UniqueId = ExecutionContextHandle_t;
55 
91  : public virtual POA_OpenRTM::DataFlowComponent,
92  public virtual PortableServer::RefCountServantBase
93  {
94  public:
113  explicit RTObject_impl(Manager* manager);
114 
135  RTObject_impl(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
136 
148  ~RTObject_impl() override;
149 
150  protected:
151  //============================================================
152  // Overridden functions
153  //============================================================
181  // The initialize action (on CREATED->ALIVE transition)
182  // formaer rtc_init_entry()
183  virtual ReturnCode_t onInitialize();
184 
212  // The finalize action (on ALIVE->END transition)
213  // formaer rtc_exiting_entry()
214  virtual ReturnCode_t onFinalize();
215 
247  // The startup action when ExecutionContext startup
248  // former rtc_starting_entry()
249  virtual ReturnCode_t onStartup(RTC::UniqueId ec_id);
250 
282  // The shutdown action when ExecutionContext stop
283  // former rtc_stopping_entry()
284  virtual ReturnCode_t onShutdown(RTC::UniqueId ec_id);
285 
317  // The activated action (Active state entry action)
318  // former rtc_active_entry()
319  virtual ReturnCode_t onActivated(RTC::UniqueId ec_id);
320 
352  // The deactivated action (Active state exit action)
353  // former rtc_active_exit()
354  virtual ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
355 
392  // The execution action that is invoked periodically
393  // former rtc_active_do()
394  virtual ReturnCode_t onExecute(RTC::UniqueId ec_id);
395 
427  // The aborting action when main logic error occurred.
428  // former rtc_aborting_entry()
429  virtual ReturnCode_t onAborting(RTC::UniqueId ec_id);
430 
461  // The error action in ERROR state
462  // former rtc_error_do()
463  virtual ReturnCode_t onError(RTC::UniqueId ec_id);
464 
495  // The reset action that is invoked resetting
496  // This is same but different the former rtc_init_entry()
497  virtual ReturnCode_t onReset(RTC::UniqueId ec_id);
498 
535  // The state update action that is invoked after onExecute() action
536  // no corresponding operation exists in OpenRTm-aist-0.2.0
537  virtual ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
538 
574  // The action that is invoked when execution context's rate is changed
575  // no corresponding operation exists in OpenRTm-aist-0.2.0
576  virtual ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
577 
578  public:
579  //============================================================
580  // RTC::LightweightRTObject
581  //============================================================
617  ReturnCode_t initialize() override;
618 
664  ReturnCode_t finalize() override;
665 
709  ReturnCode_t exit() override;
710 
744  CORBA::Boolean is_alive(ExecutionContext_ptr exec_context) override;
745 
773  ExecutionContext_ptr get_context(UniqueId ec_id) override;
774 
793  ExecutionContextList* get_owned_contexts() override;
794 
813  ExecutionContextList* get_participating_contexts() override;
814 
829  ExecutionContextHandle_t
830  get_context_handle(ExecutionContext_ptr cxt) override;
831 
862  UniqueId attach_context(ExecutionContext_ptr exec_context) override;
863 
864  UniqueId bindContext(ExecutionContext_ptr exec_context);
865 
907  ReturnCode_t detach_context(UniqueId ec_id) override;
908 
909  //============================================================
910  // RTC::RTObject
911  //============================================================
931  ComponentProfile* get_component_profile() override;
932 
952  PortServiceList* get_ports() override;
953 
954  //============================================================
955  // RTC::ComponentAction
956  //============================================================
982  ReturnCode_t on_initialize() override;
983 
1008  ReturnCode_t on_finalize() override;
1009 
1038  ReturnCode_t on_startup(UniqueId ec_id) override;
1039 
1068  ReturnCode_t on_shutdown(UniqueId ec_id) override;
1069 
1096  ReturnCode_t on_activated(UniqueId ec_id) override;
1097 
1125  ReturnCode_t on_deactivated(UniqueId ec_id) override;
1126 
1159  ReturnCode_t on_aborting(UniqueId ec_id) override;
1160 
1204  ReturnCode_t on_error(UniqueId ec_id) override;
1205 
1240  ReturnCode_t on_reset(UniqueId ec_id) override;
1241 
1242  //============================================================
1243  // RTC::DataFlowComponentAction
1244  //============================================================
1287  ReturnCode_t on_execute(UniqueId ec_id) override;
1288 
1332  ReturnCode_t on_state_update(UniqueId ec_id) override;
1333 
1370  ReturnCode_t on_rate_changed(UniqueId ec_id) override;
1371 
1372  //============================================================
1373  // SDOPackage::SdoSystemElement
1374  //============================================================
1412  SDOPackage::OrganizationList* get_owned_organizations() override;
1413 
1414  //============================================================
1415  // SDOPackage::SDO
1416  //============================================================
1450  char* get_sdo_id() override;
1451 
1485  char* get_sdo_type() override;
1486 
1523  SDOPackage::DeviceProfile* get_device_profile() override;
1524 
1561  SDOPackage::ServiceProfileList* get_service_profiles() override;
1562 
1604  SDOPackage::ServiceProfile* get_service_profile(const char* id) override;
1605 
1653  SDOPackage::SDOService_ptr get_sdo_service(const char* id) override;
1654 
1699  SDOPackage::Configuration_ptr get_configuration() override;
1700 
1744  SDOPackage::Monitoring_ptr get_monitoring() override;
1745 
1781  SDOPackage::OrganizationList* get_organizations() override;
1782 
1814  SDOPackage::NVList* get_status_list() override;
1815 
1852  CORBA::Any* get_status(const char* name) override;
1853 
1854  //============================================================
1855  // Local interfaces
1856  //============================================================
1876  const char* getInstanceName()
1877  {
1878  RTC_TRACE(("getInstanceName()"));
1879  return m_profile.instance_name;
1880  }
1881 
1901  void setInstanceName(const char* instance_name);
1902 
1922  const char* getTypeName()
1923  {
1924  RTC_TRACE(("getTypeName()"));
1925  return m_profile.type_name;
1926  }
1927 
1947  const char* getDescription()
1948  {
1949  RTC_TRACE(("getDescription()"));
1950  return m_profile.description;
1951  }
1952 
1973  const char* getVersion()
1974  {
1975  RTC_TRACE(("getVersion()"));
1976  return m_profile.version;
1977  }
1978 
1998  const char* getVendor()
1999  {
2000  RTC_TRACE(("getVendor()"));
2001  return m_profile.vendor;
2002  }
2003 
2023  const char* getCategory()
2024  {
2025  RTC_TRACE(("getCategory()"));
2026  return m_profile.category;
2027  }
2028 
2048  std::vector<std::string> getNamingNames();
2049 
2069  void setObjRef(RTObject_ptr rtobj);
2070 
2090  RTObject_ptr getObjRef() const;
2091 
2117  void setProperties(const coil::Properties& prop);
2118 
2141 
2174  template <typename VarType>
2175  bool bindParameter(const char* param_name, VarType& var,
2176  const char* def_val,
2177  bool (*trans)(VarType&, const char*) = coil::stringTo)
2178  {
2179  RTC_TRACE(("bindParameter(%s (default: %s))", param_name, def_val));
2180  m_configsets.bindParameter(param_name, var, def_val, trans);
2181  return true;
2182  }
2183 
2252 
2274  void updateParameters(const char* config_set);
2275 
2309  bool addPort(PortBase& port);
2343  bool addPort(PortService_ptr port);
2377  bool addPort(CorbaPort& port);
2409  void registerPort(PortBase& port);
2441  void registerPort(PortService_ptr port);
2474 
2503  bool addInPort(const char* name, InPortBase& inport);
2504  const std::vector<InPortBase*>& getInPorts() const { return m_inports; }
2505  const std::vector<OutPortBase*>& getOutPorts() const { return m_outports; }
2532  void registerInPort(const char* name, InPortBase& inport);
2533 
2562  bool addOutPort(const char* name, OutPortBase& outport);
2589  void registerOutPort(const char* name, OutPortBase& outport);
2590 
2612  bool removeInPort(InPortBase& inport);
2613 
2635  bool removeOutPort(OutPortBase& outport);
2636 
2658  bool removePort(PortBase& port);
2680  bool removePort(PortService_ptr port);
2702  bool removePort(CorbaPort& port);
2722  void deletePort(PortBase& port);
2742  void deletePort(PortService_ptr port);
2762  void deletePort(CorbaPort& port);
2763 
2783  void deletePortByName(const char* port_name);
2784 
2835  ExecutionContext_ptr getExecutionContext(RTC::UniqueId ec_id);
2836 
2890 
2944  ReturnCode_t setExecutionRate(RTC::UniqueId ec_id, double rate);
2945 
2999 
3038  ReturnCode_t deactivate(RTC::UniqueId ec_id);
3039 
3076  ReturnCode_t activate(RTC::UniqueId ec_id);
3077 
3112  ReturnCode_t reset(RTC::UniqueId ec_id);
3113 
3121  bool addSdoServiceProvider(const SDOPackage::ServiceProfile& prof,
3122  SdoServiceProviderBase* provider);
3123 
3131  bool removeSdoServiceProvider(const char* id);
3132 
3140  bool addSdoServiceConsumer(const SDOPackage::ServiceProfile& prof);
3141 
3149  bool removeSdoServiceConsumer(const char* id);
3150 
3159 
3180  bool readAll();
3181 
3202  bool writeAll();
3203 
3238  void setReadAll(bool read = true, bool completion = false);
3239 
3274  void setWriteAll(bool write = true, bool completion = false);
3275 
3293 
3306 
3319 
3394  void
3396  PreCompActionListener* listener,
3397  bool autoclean = true);
3398 
3399  template <class Listener>
3402  Listener& obj,
3403  void (Listener::*memfunc)(UniqueId ec_id))
3404  {
3405  class Noname
3407  {
3408  public:
3409  Noname(Listener& obj, void (Listener::*memfunc)(UniqueId))
3410  : m_obj(obj), m_memfunc(memfunc)
3411  {
3412  }
3413  void operator()(UniqueId ec_id) override
3414  {
3415  (m_obj.*m_memfunc)(ec_id);
3416  }
3417  private:
3418  Listener& m_obj;
3419  using Memfunc = void (Listener::*)(UniqueId);
3420  Memfunc m_memfunc;
3421  };
3422  Noname* listener(new Noname(obj, memfunc));
3423  addPreComponentActionListener(listener_type, listener, true);
3424  return listener;
3425  }
3426 
3446  void
3448  PreComponentActionListenerType listener_type,
3449  PreComponentActionListener* listener);
3450 
3525  void
3527  PostComponentActionListenerType listener_type,
3528  PostComponentActionListener* listener,
3529  bool autoclean = true);
3530 
3531  template <class Listener>
3534  Listener& obj,
3535  void (Listener::*memfunc)(UniqueId ec_id,
3536  ReturnCode_t ret))
3537  {
3538  class Noname
3540  {
3541  public:
3542  Noname(Listener& obj, void (Listener::*memfunc)(UniqueId, ReturnCode_t))
3543  : m_obj(obj), m_memfunc(memfunc)
3544  {
3545  }
3546  void operator()(UniqueId ec_id, ReturnCode_t ret) override
3547  {
3548  (m_obj.*m_memfunc)(ec_id, ret);
3549  }
3550 
3551  private:
3552  Listener& m_obj;
3553  using Memfunc = void (Listener::*)(UniqueId, ReturnCode_t);
3554  Memfunc m_memfunc;
3555  };
3556  Noname* listener(new Noname(obj, memfunc));
3557  addPostComponentActionListener(listener_type, listener, true);
3558  return listener;
3559  }
3560 
3580  void
3582  PostComponentActionListenerType listener_type,
3583  PostComponentActionListener* listener);
3584 
3638  void
3640  PortActionListener* listener,
3641  bool autoclean = true);
3642 
3643  template <class Listener>
3646  Listener& obj,
3647  void (Listener::*memfunc)(const RTC::PortProfile&))
3648  {
3649  class Noname
3650  : public PortActionListener
3651  {
3652  public:
3653  Noname(Listener& obj,
3654  void (Listener::*memfunc)(const RTC::PortProfile&))
3655  : m_obj(obj), m_memfunc(memfunc)
3656  {
3657  }
3658  void operator()(const RTC::PortProfile& pprofile) override
3659  {
3660  (m_obj.*m_memfunc)(pprofile);
3661  }
3662 
3663  private:
3664  Listener& m_obj;
3665  using Memfunc = void (Listener::*)(const RTC::PortProfile&);
3666  Memfunc m_memfunc;
3667  };
3668  Noname* listener(new Noname(obj, memfunc));
3669  addPortActionListener(listener_type, listener, true);
3670  return listener;
3671  }
3672 
3692  void
3694  PortActionListener* listener);
3695 
3752  ECActionListener* listener,
3753  bool autoclean = true);
3754 
3755  template <class Listener>
3758  Listener& obj,
3759  void (Listener::*memfunc)(UniqueId))
3760  {
3761  class Noname
3762  : public ECActionListener
3763  {
3764  public:
3765  Noname(Listener& obj, void (Listener::*memfunc)(UniqueId))
3766  : m_obj(obj), m_memfunc(memfunc)
3767  {
3768  }
3769  void operator()(UniqueId ec_id) override
3770  {
3771  (m_obj.*m_memfunc)(ec_id);
3772  }
3773 
3774  private:
3775  Listener& m_obj;
3776  using Memfunc = void (Listener::*)(UniqueId);
3777  Memfunc m_memfunc;
3778  };
3779  Noname* listener(new Noname(obj, memfunc));
3780  addExecutionContextActionListener(listener_type, listener, true);
3781  return listener;
3782  }
3783 
3803  void
3805  ECActionListener* listener);
3806 
3862  PortConnectListener* listener,
3863  bool autoclean = true);
3864 
3865  template <class Listener>
3868  Listener& obj,
3869  void (Listener::*memfunc)(const char*,
3870  ConnectorProfile&))
3871  {
3872  class Noname
3873  : public PortConnectListener
3874  {
3875  public:
3876  Noname(Listener& obj,
3877  void (Listener::*memfunc)(const char*, ConnectorProfile&))
3878  : m_obj(obj), m_memfunc(memfunc)
3879  {
3880  }
3881  void operator()(const char* portname, ConnectorProfile& cprofile) override
3882  {
3883  (m_obj.*m_memfunc)(portname, cprofile);
3884  }
3885 
3886  private:
3887  Listener& m_obj;
3888  using Memfunc = void (Listener::*)(const char*, ConnectorProfile&);
3889  Memfunc m_memfunc;
3890  };
3891  Noname* listener(new Noname(obj, memfunc));
3892  addPortConnectListener(listener_type, listener, true);
3893  return listener;
3894  }
3895 
3915  void
3917  PortConnectListener* listener);
3918 
3978  PortConnectRetListener* listener,
3979  bool autoclean = true);
3980 
3981  template <class Listener>
3984  Listener& obj,
3985  void (Listener::*memfunc)(const char*,
3986  ConnectorProfile&,
3987  ReturnCode_t))
3988  {
3989  class Noname
3990  : public PortConnectRetListener
3991  {
3992  public:
3993  Noname(Listener& obj,
3994  void (Listener::*memfunc)(const char*,
3995  ConnectorProfile&,
3996  ReturnCode_t))
3997  : m_obj(obj), m_memfunc(memfunc)
3998  {
3999  }
4000  void operator()(const char* portname,
4001  ConnectorProfile& cprofile,
4002  ReturnCode_t ret) override
4003  {
4004  (m_obj.*m_memfunc)(portname, cprofile, ret);
4005  }
4006 
4007  private:
4008  Listener& m_obj;
4009  using Memfunc = void (Listener::*)(const char*, ConnectorProfile&, ReturnCode_t);
4010  Memfunc m_memfunc;
4011  };
4012  Noname* listener(new Noname(obj, memfunc));
4013  addPortConnectRetListener(listener_type, listener, true);
4014  return listener;
4015  }
4016 
4036  void
4038  PortConnectRetListener* listener);
4039 
4073  ConfigurationParamListener* listener,
4074  bool autoclean = true);
4075 
4076  template <class Listener>
4079  Listener& obj,
4080  void (Listener::*memfunc)(const char*,
4081  const char*))
4082  {
4083  class Noname
4085  {
4086  public:
4087  Noname(Listener& obj,
4088  void (Listener::*memfunc)(const char*, const char*))
4089  : m_obj(obj), m_memfunc(memfunc)
4090  {
4091  }
4092  void operator()(const char* config_set_name,
4093  const char* config_param_name) override
4094  {
4095  (m_obj.*m_memfunc)(config_set_name, config_param_name);
4096  }
4097 
4098  private:
4099  Listener& m_obj;
4100  using Memfunc = void (Listener::*)(const char*, const char*);
4101  Memfunc m_memfunc;
4102  };
4103  Noname* listener(new Noname(obj, memfunc));
4104  addConfigurationParamListener(listener_type, listener, true);
4105  return listener;
4106  }
4107 
4134  listener);
4135 
4168  ConfigurationSetListener* listener,
4169  bool autoclean = true);
4170 
4171  template <class Listener>
4174  Listener& obj,
4175  void (Listener::*memfunc)
4176  (const coil::Properties& config_set))
4177  {
4178  class Noname
4179  : public ConfigurationSetListener
4180  {
4181  public:
4182  Noname(Listener& obj,
4183  void (Listener::*memfunc)(const coil::Properties& config_set))
4184  : m_obj(obj), m_memfunc(memfunc)
4185  {
4186  }
4187  void operator()(const coil::Properties& config_set) override
4188  {
4189  (m_obj.*m_memfunc)(config_set);
4190  }
4191 
4192  private:
4193  Listener& m_obj;
4194  using Memfunc = void (Listener::*)(const coil::Properties&);
4195  Memfunc m_memfunc;
4196  };
4197  Noname* listener(new Noname(obj, memfunc));
4198  addConfigurationSetListener(listener_type, listener, true);
4199  return listener;
4200  }
4201 
4225  ConfigurationSetListener* listener);
4226 
4261  void
4263  ConfigurationSetNameListener* listener,
4264  bool autoclean = true);
4265 
4266  template <class Listener>
4269  Listener& obj,
4270  void (Listener::*memfunc)(const char*))
4271  {
4272  class Noname
4274  {
4275  public:
4276  Noname(Listener& obj, void (Listener::*memfunc)(const char*))
4277  : m_obj(obj), m_memfunc(memfunc)
4278  {
4279  }
4280  void operator()(const char* config_set_name) override
4281  {
4282  (m_obj.*m_memfunc)(config_set_name);
4283  }
4284 
4285  private:
4286  Listener& m_obj;
4287  using Memfunc = void (Listener::*)(const char*);
4288  Memfunc m_memfunc;
4289  };
4290  Noname* listener(new Noname(obj, memfunc));
4291  addConfigurationSetNameListener(type, listener, true);
4292  return listener;
4293  }
4294 
4321  void
4323  ConfigurationSetNameListener* listener);
4324 
4325  //============================================================
4326  // FSM Listener
4399  void
4401  PreFsmActionListener* listener,
4402  bool autoclean = true);
4403 
4404  template <class Listener>
4407  Listener& obj,
4408  void (Listener::*memfunc)(const char* state))
4409  {
4410  class Noname
4411  : public PreFsmActionListener
4412  {
4413  public:
4414  Noname(Listener& obj, void (Listener::*memfunc)(const char*))
4415  : m_obj(obj), m_memfunc(memfunc)
4416  {
4417  }
4418  void operator()(const char* state) override
4419  {
4420  (m_obj.*m_memfunc)(state);
4421  }
4422 
4423  private:
4424  Listener& m_obj;
4425  using Memfunc = void (Listener::*)(const char*);
4426  Memfunc m_memfunc;
4427  };
4428  Noname* listener(new Noname(obj, memfunc));
4429  addPreFsmActionListener(listener_type, listener, true);
4430  return listener;
4431  }
4432 
4452  void
4454  PreFsmActionListener* listener);
4455 
4528  void
4530  PostFsmActionListener* listener,
4531  bool autoclean = true);
4532 
4533  template <class Listener>
4536  Listener& obj,
4537  void (Listener::*memfunc)(const char* state,
4538  ReturnCode_t ret))
4539  {
4540  class Noname
4541  : public PostFsmActionListener
4542  {
4543  public:
4544  Noname(Listener& obj,
4545  void (Listener::*memfunc)(const char*, ReturnCode_t))
4546  : m_obj(obj), m_memfunc(memfunc)
4547  {
4548  }
4549  void operator()(const char* state, ReturnCode_t ret) override
4550  {
4551  (m_obj.*m_memfunc)(state, ret);
4552  }
4553 
4554  private:
4555  Listener& m_obj;
4556  using Memfunc = void (Listener::*)(const char*, ReturnCode_t);
4557  Memfunc m_memfunc;
4558  };
4559  Noname* listener(new Noname(obj, memfunc));
4560  addPostFsmActionListener(listener_type, listener, true);
4561  return listener;
4562  }
4563 
4582  void
4584  PostFsmActionListener* listener);
4585 
4654  void
4656  FsmProfileListener* listener,
4657  bool autoclean = true);
4658 
4659  template <class Listener>
4662  Listener& obj,
4663  void (Listener::*memfunc)(const RTC::PortProfile&))
4664  {
4665  class Noname
4666  : public FsmProfileListener
4667  {
4668  public:
4669  Noname(Listener& obj,
4670  void (Listener::*memfunc)(const RTC::FsmProfile&))
4671  : m_obj(obj), m_memfunc(memfunc)
4672  {
4673  }
4674  void operator()(const RTC::PortProfile& pprofile)
4675  {
4676  (m_obj.*m_memfunc)(pprofile);
4677  }
4678 
4679  private:
4680  Listener& m_obj;
4681  using Memfunc = void (Listener::*)(const RTC::FsmProfile&);
4682  Memfunc m_memfunc;
4683  };
4684  Noname* listener(new Noname(obj, memfunc));
4685  addFsmProfileListener(listener_type, listener, true);
4686  return listener;
4687  }
4688 
4708  void
4710  FsmProfileListener* listener);
4711 
4767  void
4769  FsmStructureListener* listener,
4770  bool autoclean = true);
4771 
4772  template <class Listener>
4775  Listener& obj,
4776  void (Listener::*memfunc)(const RTC::PortProfile&))
4777  {
4778  class Noname
4779  : public FsmStructureListener
4780  {
4781  public:
4782  Noname(Listener& obj,
4783  void (Listener::*memfunc)(const RTC::FsmStructure&))
4784  : m_obj(obj), m_memfunc(memfunc)
4785  {
4786  }
4787  void operator()(const RTC::PortProfile& pprofile)
4788  {
4789  (m_obj.*m_memfunc)(pprofile);
4790  }
4791 
4792  private:
4793  Listener& m_obj;
4794  using Memfunc = void (Listener::*)(const RTC::FsmStructure&);
4795  Memfunc m_memfunc;
4796  };
4797  Noname* listener(new Noname(obj, memfunc));
4798  addFsmStructureListener(listener_type, listener, true);
4799  return listener;
4800  }
4801 
4821  void
4823  FsmStructureListener* listener);
4824 
4825  inline void preOnInitialize(UniqueId ec_id)
4826  {
4828  }
4829 
4830  inline void preOnFinalize(UniqueId ec_id)
4831  {
4833  }
4834 
4835  inline void preOnStartup(UniqueId ec_id)
4836  {
4838  }
4839 
4840  inline void preOnShutdown(UniqueId ec_id)
4841  {
4843  }
4844 
4845  inline void preOnActivated(UniqueId ec_id)
4846  {
4848  }
4849 
4850  inline void preOnDeactivated(UniqueId ec_id)
4851  {
4853  }
4854 
4855  inline void preOnAborting(UniqueId ec_id)
4856  {
4858  }
4859 
4860  inline void preOnError(UniqueId ec_id)
4861  {
4863  }
4864 
4865  inline void preOnReset(UniqueId ec_id)
4866  {
4868  }
4869 
4870  inline void preOnExecute(UniqueId ec_id)
4871  {
4873  }
4874 
4875  inline void preOnStateUpdate(UniqueId ec_id)
4876  {
4878  }
4879 
4880  inline void preOnRateChanged(UniqueId ec_id)
4881  {
4883  }
4884 
4885  inline void postOnInitialize(UniqueId ec_id, ReturnCode_t ret)
4886  {
4888  }
4889 
4890  inline void postOnFinalize(UniqueId ec_id, ReturnCode_t ret)
4891  {
4893  }
4894 
4895  inline void postOnStartup(UniqueId ec_id, ReturnCode_t ret)
4896  {
4898  }
4899 
4900  inline void postOnShutdown(UniqueId ec_id, ReturnCode_t ret)
4901  {
4903  }
4904 
4905  inline void postOnActivated(UniqueId ec_id, ReturnCode_t ret)
4906  {
4908  }
4909 
4910  inline void postOnDeactivated(UniqueId ec_id, ReturnCode_t ret)
4911  {
4913  }
4914 
4915  inline void postOnAborting(UniqueId ec_id, ReturnCode_t ret)
4916  {
4918  }
4919 
4920  inline void postOnError(UniqueId ec_id, ReturnCode_t ret)
4921  {
4923  }
4924 
4925  inline void postOnReset(UniqueId ec_id, ReturnCode_t ret)
4926  {
4928  }
4929 
4930  inline void postOnExecute(UniqueId ec_id, ReturnCode_t ret)
4931  {
4933  }
4934 
4935  inline void postOnStateUpdate(UniqueId ec_id, ReturnCode_t ret)
4936  {
4938  }
4939 
4940  inline void postOnRateChanged(UniqueId ec_id, ReturnCode_t ret)
4941  {
4943  }
4944 
4945  inline void onAddPort(const PortProfile& pprof)
4946  {
4948  }
4949 
4950  inline void onRemovePort(const PortProfile& pprof)
4951  {
4953  }
4954 
4956  {
4959  }
4960 
4962  {
4965  }
4966 
4970  inline void preOnFsmInit(const char* state)
4971  {
4973  }
4974  inline void preOnFsmEntry(const char* state)
4975  {
4977  }
4978  inline void preOnFsmDo(const char* state)
4979  {
4981  }
4982  inline void preOnFsmExit(const char* state)
4983  {
4985  }
4986  inline void preOnFsmStateChange(const char* state)
4987  {
4989  }
4993  inline void postOnFsmInit(const char* state, ReturnCode_t ret)
4994  {
4996  }
4997  inline void postOnFsmEntry(const char* state, ReturnCode_t ret)
4998  {
5000  }
5001  inline void postOnFsmDo(const char* state, ReturnCode_t ret)
5002  {
5004  }
5005  inline void postOnFsmExit(const char* state, ReturnCode_t ret)
5006  {
5008  }
5009  inline void postOnFsmStateChange(const char* state, ReturnCode_t ret)
5010  {
5012  }
5013 
5017  protected:
5033  void shutdown();
5034 
5040  ReturnCode_t initMineEC();
5046  void startMineEC();
5059 
5065  ReturnCode_t getInheritedECOptions(coil::Properties& default_opts);
5066 
5070  ReturnCode_t
5071  getPrivateContextOptions(std::vector<coil::Properties>& ec_args);
5072 
5076  ReturnCode_t
5078 
5082  ReturnCode_t
5083  getContextOptions(std::vector<coil::Properties>& ec_args);
5084 
5088  static ReturnCode_t findExistingEC(coil::Properties& ec_arg,
5093  ReturnCode_t createContexts(std::vector<coil::Properties>& ec_args);
5094 
5100 
5101  protected:
5109  mutable Logger rtclog;
5118 
5126  CORBA::ORB_var m_pORB;
5127 
5135  PortableServer::POA_var m_pPOA;
5136 
5137  //============================================================
5138  // SDO 関係の変数
5139  //============================================================
5147  SDOPackage::OrganizationList m_sdoOwnedOrganizations;
5148 
5156  struct svc_name
5157  {
5158  explicit svc_name(const char* id) : m_id(id) {}
5159  bool operator()(const SDOPackage::ServiceProfile& prof)
5160  {
5161  return m_id == std::string(prof.id);
5162  }
5163  std::string m_id;
5164  }; // struct svc_name
5165 
5174 
5182  SDOPackage::Configuration_var m_pSdoConfig;
5183 
5191  SDOPackage::OrganizationList m_sdoOrganizations;
5192 
5200  SDOPackage::NVList m_sdoStatus;
5201 
5202  //============================================================
5203  // RTC 関係の変数
5204  //============================================================
5212  ComponentProfile m_profile;
5213 
5221  RTObject_var m_objref;
5222 
5231 
5239  std::vector<InPortBase*> m_inports;
5240 
5248  std::vector<OutPortBase*> m_outports;
5249 
5257  ExecutionContextServiceList m_ecMine;
5258 
5266  std::vector<ExecutionContextBase*> m_eclist;
5267 
5275  ExecutionContextServiceList m_ecOther;
5276 
5285 
5294 
5303 
5312 
5321 
5330 
5339 
5357 
5375 
5390 
5405 
5420 
5422 
5424  : public coil::Task
5425  {
5426  public:
5428  void setSdoServiceConsumer(SdoServiceAdmin * sdoservice, const char* id);
5429  int svc() override;
5430 
5431  private:
5432  SdoServiceAdmin *m_sdoservice;
5433  std::string m_id;
5434  };
5436 
5437  //------------------------------------------------------------
5438  // Functor
5439  //------------------------------------------------------------
5447  struct nv_name
5448  {
5449  explicit nv_name(const char* name) : m_name(name) {}
5450  bool operator()(const SDOPackage::NameValue& nv)
5451  {
5452  return m_name == std::string(nv.name);
5453  }
5454  std::string m_name;
5455  }; // struct nv_name
5456 
5464  struct ec_copy
5465  {
5466  explicit ec_copy(ExecutionContextList& eclist)
5467  : m_eclist(eclist)
5468  {
5469  }
5470  void operator()(ExecutionContextService_ptr ecs)
5471  {
5472  if (!::CORBA::is_nil(ecs))
5473  {
5475  ExecutionContext::_duplicate(ecs));
5476  }
5477  }
5478  ExecutionContextList& m_eclist;
5479  }; // struct ec_copy
5487  struct ec_find
5488  {
5489  explicit ec_find(ExecutionContext_ptr& ec)
5490  : m_ec(ExecutionContext::_duplicate(ec))
5491  {
5492  }
5493 #ifdef ORB_IS_ORBEXPRESS
5494  bool operator()(ExecutionContextService_var ecs)
5495  {
5496  try
5497  {
5498  if (!::CORBA::is_nil(ecs.in()))
5499  {
5500  ExecutionContext_var ec;
5501  ec = ExecutionContext::_narrow(ecs.in());
5502  return m_ec->_is_equivalent(ec);
5503  }
5504  }
5505 #else
5506  bool operator()(ExecutionContextService_ptr ecs)
5507  {
5508  try
5509  {
5510  if (!::CORBA::is_nil(ecs))
5511  {
5512  ExecutionContext_var ec;
5513  ec = ExecutionContext::_narrow(ecs);
5514  return m_ec->_is_equivalent(ec);
5515  }
5516  }
5517 #endif
5518  catch (...)
5519  {
5520  return false;
5521  }
5522  return false;
5523  }
5524  ExecutionContext_var m_ec;
5525  }; // struct ec_find
5526 
5535  {
5537  : m_comp(RTC::LightweightRTObject::_duplicate(comp))
5538  {
5539  }
5540  void operator()(ExecutionContextService_ptr ec)
5541  {
5542  if (!::CORBA::is_nil(ec) && !ec->_non_existent())
5543  {
5544  RTC::LifeCycleState state = ec->get_component_state(m_comp);
5545  if (state == RTC::ACTIVE_STATE)
5546  {
5547  ec->deactivate_component(
5548  RTC::LightweightRTObject::_duplicate(m_comp));
5549  }
5550  else if (state == RTC::ERROR_STATE)
5551  {
5552  ec->reset_component(
5553  RTC::LightweightRTObject::_duplicate(m_comp));
5554  }
5555  }
5556  }
5558  }; // struct deactivate_comps
5559  }; // class RTObject_impl
5560 } // namespace RTC
5561 
5562 #endif // RTC_RTOBJECT
component action listener class
Configuration Administration classes.
CorbaPort class.
component action listener class
RTC::Port implementation for InPort.
InPortBase base class.
RTC's Port administration class.
RTC's Port base class.
port's internal action listener classes
RTComponent header.
SDO service administration class.
RT component logger class.
#define RTC_TRACE(fmt)
Trace level log output macro.
Definition: SystemLogger.h:687
ComponentActionListeners class.
Definition: ComponentActionListener.h:1026
bool notify(PreComponentActionListenerType type, UniqueId ec_id)
Definition: ComponentActionListener.h:1260
ConfigAdmin class.
Definition: ConfigAdmin.h:612
bool bindParameter(const char *param_name, VarType &var, const char *def_val, bool(*trans)(VarType &, const char *)=coil::stringTo)
Setup for configuration parameters.
Definition: ConfigAdmin.h:693
ConfigurationParamListener class.
Definition: ConfigurationListener.h:75
ConfigurationSetListener class.
Definition: ConfigurationListener.h:191
ConfigurationSetNameListener class.
Definition: ConfigurationListener.h:304
RT Conponent CORBA service/consumer Port.
Definition: CorbaPort.h:625
ExecutionContextActionListener class.
Definition: ComponentActionListener.h:521
A base class for ExecutionContext.
Definition: ExecutionContextBase.h:366
FsmActionListeners class.
Definition: FsmActionListener.h:1445
bool notify(PreFsmActionListenerType type, const char *state)
Definition: FsmActionListener.h:1679
FsmProfileListener class.
Definition: FsmActionListener.h:723
FsmStructureListener class.
Definition: FsmActionListener.h:942
Port for InPort.
Definition: InPortBase.h:70
Logger class.
Definition: SystemLogger.h:101
Manager class.
Definition: Manager.h:91
Output base class.
Definition: OutPortBase.h:229
PortActionListener class.
Definition: ComponentActionListener.h:411
PortAdmin class.
Definition: PortAdmin.h:55
Port base class.
Definition: PortBase.h:132
PortConnectListener class.
Definition: PortConnectListener.h:84
PortConnectListeners class.
Definition: PortConnectListener.h:487
PortConnectRetListener class.
Definition: PortConnectListener.h:204
PostComponentActionListener class.
Definition: ComponentActionListener.h:290
PostFsmActionListener class.
Definition: FsmActionListener.h:475
PreComponentActionListener class.
Definition: ComponentActionListener.h:123
PreFsmActionListener class.
Definition: FsmActionListener.h:232
void setSdoServiceConsumer(SdoServiceAdmin *sdoservice, const char *id)
RT-Component class.
Definition: RTObject.h:93
void postOnInitialize(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4885
UniqueId bindContext(ExecutionContext_ptr exec_context)
ComponentActionListeners m_actionListeners
ComponentActionListener holder.
Definition: RTObject.h:5389
const char * getCategory()
[local interface] Get category information
Definition: RTObject.h:2023
ConfigurationParamListener * addConfigurationParamListener(ConfigurationParamListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const char *, const char *))
Definition: RTObject.h:4078
void addExecutionContextActionListener(ECActionListenerType listener_type, ECActionListener *listener, bool autoclean=true)
bool removeSdoServiceConsumer(const char *id)
[local interface] Remove a SDO service provider
const std::vector< InPortBase * > & getInPorts() const
Definition: RTObject.h:2504
char * get_sdo_type() override
[SDO interface] Get SDO type
ReturnCode_t on_startup(UniqueId ec_id) override
[ComponentAction CORBA interface] Startup RTC
void onAttachExecutionContext(UniqueId ec_id)
Definition: RTObject.h:4955
const char * getDescription()
[local interface] GetDescription
Definition: RTObject.h:1947
void setInstanceName(const char *instance_name)
[local interface] Set instance name
const char * getTypeName()
[local interface] Get type name
Definition: RTObject.h:1922
void startMineEC()
Starting my EC This function start mine ECs. This is called from only initialize().
bool addOutPort(const char *name, OutPortBase &outport)
[local interface] Register DataOutPort
ExecutionContext_ptr getExecutionContext(RTC::UniqueId ec_id)
[local interface] Getting current execution context
void registerOutPort(const char *name, OutPortBase &outport)
[local interface] Register DataOutPort
virtual ReturnCode_t onError(RTC::UniqueId ec_id)
Callback function for error handling.
PortActionListener * addPortActionListener(PortActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const RTC::PortProfile &))
Definition: RTObject.h:3645
virtual ReturnCode_t onShutdown(RTC::UniqueId ec_id)
Callback function for shutdown action.
virtual ReturnCode_t onRateChanged(RTC::UniqueId ec_id)
Callback function to change execution cycle.
void removePortConnectRetListener(PortConnectRetListenerType listener_type, PortConnectRetListener *listener)
Removing PortConnectRet type listener.
void addConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener *listener, bool autoclean=true)
Adding ConfigurationParamListener.
ReturnCode_t detach_context(UniqueId ec_id) override
[CORBA interface] Detach ExecutionContext.
ReturnCode_t createContexts(std::vector< coil::Properties > &ec_args)
creating, initializing and binding context
ReturnCode_t exit() override
[CORBA interface]top the RTC's execution context(s) and finalize it along with its contents.
void removePortConnectListener(PortConnectListenerType listener_type, PortConnectListener *listener)
Removing PortConnect type listener.
RTObject_impl(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
Constructor.
void preOnFsmEntry(const char *state)
Definition: RTObject.h:4974
bool removeSdoServiceProvider(const char *id)
[local interface] Remove a SDO service provider
PostFsmActionListener * addPostFsmActionListener(PostFsmActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const char *state, ReturnCode_t ret))
Definition: RTObject.h:4535
ReturnCode_t on_state_update(UniqueId ec_id) override
[DataFlowComponentAction CORBA interface] Secondary Periodic Operation of RTC
void postOnFsmExit(const char *state, ReturnCode_t ret)
Definition: RTObject.h:5005
void postOnReset(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4925
void addPortConnectListener(PortConnectListenerType listener_type, PortConnectListener *listener, bool autoclean=true)
Adding PortConnect type listener.
void preOnFsmExit(const char *state)
Definition: RTObject.h:4982
void postOnFsmInit(const char *state, ReturnCode_t ret)
Definition: RTObject.h:4993
void removePreComponentActionListener(PreComponentActionListenerType listener_type, PreComponentActionListener *listener)
Removing PreComponentAction type listener.
void postOnStartup(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4895
bool m_readAllCompletion
flag for readAll()
Definition: RTObject.h:5356
void finalizeMineEC()
Finalize my EC This function finalize mine ECs. This is called from only exit().
ConfigurationSetListener * addConfigurationSetListener(ConfigurationSetListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const coil::Properties &config_set))
Definition: RTObject.h:4173
void postOnDeactivated(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4910
ReturnCode_t reset(RTC::UniqueId ec_id)
[local interface] Resetting and go to Inactive state
void registerInPort(const char *name, InPortBase &inport)
[local interface] Register DataInPort
CORBA::ORB_var m_pORB
The pointer to the ORB.
Definition: RTObject.h:5126
void preOnActivated(UniqueId ec_id)
Definition: RTObject.h:4845
void removeFsmStructureListener(FsmStructureListenerType listener_type, FsmStructureListener *listener)
Removing FsmStructure type listener.
PreComponentActionListener * addPreComponentActionListener(PreCompActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(UniqueId ec_id))
Definition: RTObject.h:3401
SdoServiceConsumerTerminator * m_sdoconterm
Definition: RTObject.h:5435
void preOnShutdown(UniqueId ec_id)
Definition: RTObject.h:4840
coil::Properties & getProperties()
[local interface] Get RTC property
void postOnActivated(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4905
void addPostComponentActionListener(PostComponentActionListenerType listener_type, PostComponentActionListener *listener, bool autoclean=true)
void preOnAborting(UniqueId ec_id)
Definition: RTObject.h:4855
ECActionListener * addExecutionContextActionListener(ECActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(UniqueId))
Definition: RTObject.h:3757
PreFsmActionListener * addPreFsmActionListener(PreFsmActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const char *state))
Definition: RTObject.h:4406
SDOPackage::OrganizationList m_sdoOwnedOrganizations
SDO owned organization list.
Definition: RTObject.h:5147
void preOnStateUpdate(UniqueId ec_id)
Definition: RTObject.h:4875
ReturnCode_t getPrivateContextOptions(std::vector< coil::Properties > &ec_args)
getting individual EC options from RTC's configuration file
bool removePort(CorbaPort &port)
[local interface] Unregister Port
ReturnCode_t setExecutionRate(RTC::UniqueId ec_id, double rate)
[local interface] Setting current context' execution rate
virtual ReturnCode_t onStateUpdate(RTC::UniqueId ec_id)
Callback function to update the state.
SDOPackage::ServiceProfile * get_service_profile(const char *id) override
[SDO interface] Get specified ServiceProfile
bool removeOutPort(OutPortBase &outport)
[local interface] Unregister OutPort
void registerPort(PortBase &port)
[local interface] Register Port
bool writeAll()
The write() method of all OutPort is called.
const char * getVersion()
[local interface] Get version information
Definition: RTObject.h:1973
RTObject_ptr getObjRef() const
[local interface] Get the object reference
SdoServiceAdmin m_sdoservice
SDO Service Administrator Object.
Definition: RTObject.h:5320
void preOnInitialize(UniqueId ec_id)
Definition: RTObject.h:4825
std::vector< ExecutionContextBase * > m_eclist
List of ExecutionContextBase.
Definition: RTObject.h:5266
bool removeInPort(InPortBase &inport)
[local interface] Unregister InPort
void preOnFinalize(UniqueId ec_id)
Definition: RTObject.h:4830
void postOnStateUpdate(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4935
ReturnCode_t finalize() override
[CORBA interface] Finalize the RTC for destruction
SDOPackage::DeviceProfile * get_device_profile() override
[SDO interface] Get SDO DeviceProfile list
void addPortActionListener(PortActionListenerType listener_type, PortActionListener *listener, bool autoclean=true)
Adding PortAction type listener.
void removeSdoServiceConsumerStartThread(const char *id)
[local interface] Remove a SDO service provider
void onRemovePort(const PortProfile &pprof)
Definition: RTObject.h:4950
~RTObject_impl() override
Virtual destructor.
ExecutionContextServiceList m_ecOther
List of participating ExecutionContextService.
Definition: RTObject.h:5275
void deletePortByName(const char *port_name)
[local interface] Delete Port by specifying its name
void addConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener *listener, bool autoclean=true)
Adding ConfigurationSetNameListener.
void addFsmProfileListener(FsmProfileListenerType listener_type, FsmProfileListener *listener, bool autoclean=true)
Adding FsmProfile type listener.
void postOnRateChanged(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4940
SDOPackage::NVList * get_status_list() override
[SDO interface] Get SDO Status list
void preOnStartup(UniqueId ec_id)
Definition: RTObject.h:4835
virtual ReturnCode_t onStartup(RTC::UniqueId ec_id)
Callback function for startup action.
CORBA::Any * get_status(const char *name) override
[SDO interface] Get SDO Status
void preOnFsmDo(const char *state)
Definition: RTObject.h:4978
void postOnFsmDo(const char *state, ReturnCode_t ret)
Definition: RTObject.h:5001
std::vector< InPortBase * > m_inports
List of InPortBase*.
Definition: RTObject.h:5239
void preOnRateChanged(UniqueId ec_id)
Definition: RTObject.h:4880
bool readAll()
Readout the value from All InPorts.
ReturnCode_t on_deactivated(UniqueId ec_id) override
[ComponentAction CORBA interface] Deactivate RTC
void addPostFsmActionListener(PostFsmActionListenerType listener_type, PostFsmActionListener *listener, bool autoclean=true)
Adding PostFsmAction type listener.
Manager * m_pManager
Manager object.
Definition: RTObject.h:5117
void setINSObjRef(RTC::LightweightRTObject_ptr obj)
ReturnCode_t getGlobalContextOptions(coil::Properties &global_ec_props)
getting global EC options from rtc.conf
ReturnCode_t on_aborting(UniqueId ec_id) override
[ComponentAction CORBA interface] Transition to Error State
SDOPackage::OrganizationList * get_organizations() override
[SDO interface] Get Organization list
void removeConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener *listener)
Removing ConfigurationParamListener.
virtual ReturnCode_t onActivated(RTC::UniqueId ec_id)
Callback function to activate.
const char * getVendor()
[local interface] Get vendor
Definition: RTObject.h:1998
SDOPackage::ServiceProfileList * get_service_profiles() override
[SDO interface] Get SDO ServiceProfile
PortConnectRetListener * addPortConnectRetListener(PortConnectRetListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const char *, ConnectorProfile &, ReturnCode_t))
Definition: RTObject.h:3983
FsmStructureListener * addFsmStructureListener(FsmStructureListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const RTC::PortProfile &))
Definition: RTObject.h:4774
void postOnShutdown(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4900
void removePortActionListener(PortActionListenerType listener_type, PortActionListener *listener)
Removing PortAction type listener.
bool bindParameter(const char *param_name, VarType &var, const char *def_val, bool(*trans)(VarType &, const char *)=coil::stringTo)
Setup for configuration parameters.
Definition: RTObject.h:2175
FsmActionListeners m_fsmActionListeners
ComponentActionListener holder.
Definition: RTObject.h:5419
SDOPackage::OrganizationList m_sdoOrganizations
SDO organization.
Definition: RTObject.h:5191
bool m_writeAllCompletion
flag for writeAll()
Definition: RTObject.h:5374
SDOPackage::Configuration_var m_pSdoConfig
The pointer to the SDO Configuration Interface.
Definition: RTObject.h:5182
static bool isOwnExecutionContext(RTC::UniqueId ec_id)
[local interface] Checking if the current context is own context
double getExecutionRate(RTC::UniqueId ec_id)
[local interface] Getting current context' execution rate
void preOnExecute(UniqueId ec_id)
Definition: RTObject.h:4870
bool addPort(CorbaPort &port)
[local interface] Register Port
SDOPackage::Configuration_impl * m_pSdoConfigImpl
The pointer to the SDO Configuration Object.
Definition: RTObject.h:5173
ReturnCode_t on_activated(UniqueId ec_id) override
[ComponentAction CORBA interface] Activate RTC
SDOPackage::Monitoring_ptr get_monitoring() override
[SDO interface] Get Monitoring object
SDOPackage::NVList m_sdoStatus
SDO Status.
Definition: RTObject.h:5200
ReturnCode_t on_execute(UniqueId ec_id) override
[DataFlowComponentAction CORBA interface] Primary Periodic Operation of RTC
bool m_writeAll
flag for writeAll()
Definition: RTObject.h:5338
bool removePort(PortBase &port)
[local interface] Unregister Port
void finalizeContexts()
The ExecutionContextBase list is deleted.
ConfigurationSetNameListener * addConfigurationSetNameListener(ConfigurationSetNameListenerType type, Listener &obj, void(Listener::*memfunc)(const char *))
Definition: RTObject.h:4268
void postOnFsmEntry(const char *state, ReturnCode_t ret)
Definition: RTObject.h:4997
FsmProfileListener * addFsmProfileListener(FsmProfileListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const RTC::PortProfile &))
Definition: RTObject.h:4661
void removePostFsmActionListener(PostFsmActionListenerType listener_type, PostFsmActionListener *listener)
Removing PostFsmAction type listener.
UniqueId attach_context(ExecutionContext_ptr exec_context) override
[CORBA interface] Attach ExecutionContext
PostComponentActionListener * addPostComponentActionListener(PostCompActionListenerType listener_type, Listener &obj, void(Listener::*memfunc)(UniqueId ec_id, ReturnCode_t ret))
Definition: RTObject.h:3533
ReturnCode_t on_reset(UniqueId ec_id) override
[ComponentAction CORBA interface] Resetting RTC
void preOnFsmStateChange(const char *state)
Definition: RTObject.h:4986
bool m_created
Created Status Flag.
Definition: RTObject.h:5284
bool addPort(PortBase &port)
[local interface] Register Port
virtual ReturnCode_t onReset(RTC::UniqueId ec_id)
Callback function to reset.
ReturnCode_t on_shutdown(UniqueId ec_id) override
[ComponentAction CORBA interface] Shutdown RTC
const char * getInstanceName()
[local interface] Get instance name
Definition: RTObject.h:1876
ReturnCode_t initialize() override
[CORBA interface] Initialize the RTC that realizes this interface.
ReturnCode_t on_error(UniqueId ec_id) override
[ComponentAction CORBA interface] Error Processing of RTC
coil::Properties m_properties
RTC's Property.
Definition: RTObject.h:5302
ReturnCode_t on_rate_changed(UniqueId ec_id) override
[DataFlowComponentAction CORBA interface] Notify rate changed
void addConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener *listener, bool autoclean=true)
Adding ConfigurationSetListener.
ReturnCode_t activate(RTC::UniqueId ec_id)
[local interface] Make transition to Active state
ConfigAdmin & getConfigService()
Getting configuration service.
Definition: RTObject.h:2251
bool removePort(PortService_ptr port)
[local interface] Unregister Port
Logger rtclog
Logger stream.
Definition: RTObject.h:5109
ComponentProfile m_profile
ComponentProfile.
Definition: RTObject.h:5212
ReturnCode_t getInheritedECOptions(coil::Properties &default_opts)
Get inherited EC options This function getting inherited EC options. This is called from only initMin...
ExecutionContextList * get_owned_contexts() override
[CORBA interface] Get ExecutionContextList.
static ReturnCode_t findExistingEC(coil::Properties &ec_arg, RTC::ExecutionContextBase *&ec)
fiding existing EC from the factory
virtual ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
Callback function to deactivate.
bool addSdoServiceProvider(const SDOPackage::ServiceProfile &prof, SdoServiceProviderBase *provider)
[local interface] Set a SDO service provider
void addPreFsmActionListener(PreFsmActionListenerType listener_type, PreFsmActionListener *listener, bool autoclean=true)
Adding PreFsmAction type listener.
ReturnCode_t getContextOptions(std::vector< coil::Properties > &ec_args)
getting EC options
ExecutionContextList * get_participating_contexts() override
[CORBA interface] Get participating ExecutionContextList.
void shutdown()
Shutdown RTC This operation ececutes RTC's termination. This unregisters all Ports,...
void removeConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener *listener)
Removing ConfigurationSetNameListener.
void addPreComponentActionListener(PreCompActionListenerType listener_type, PreCompActionListener *listener, bool autoclean=true)
void preOnReset(UniqueId ec_id)
Definition: RTObject.h:4865
std::vector< std::string > getNamingNames()
[local interface] Get Naming Server information
void addFsmStructureListener(FsmStructureListenerType listener_type, FsmStructureListener *listener, bool autoclean=true)
Adding FsmStructure type listener.
void postOnError(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4920
void postOnFsmStateChange(const char *state, ReturnCode_t ret)
Definition: RTObject.h:5009
void setObjRef(RTObject_ptr rtobj)
[local interface] Set the object reference
void removeConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener *listener)
Removing ConfigurationSetListener.
void postOnAborting(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4915
virtual ReturnCode_t onExecute(RTC::UniqueId ec_id)
Callback function to execute periodically.
bool addInPort(const char *name, InPortBase &inport)
[local interface] Register DataInPort
void preOnFsmInit(const char *state)
Definition: RTObject.h:4970
ExecutionContextServiceList m_ecMine
List of owned ExecutionContextService.
Definition: RTObject.h:5257
void postOnExecute(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4930
void onAddPort(const PortProfile &pprof)
Definition: RTObject.h:4945
void deletePort(PortService_ptr port)
[local interface] Unregister Port
void deletePort(PortBase &port)
[local interface] Unregister Port
RTC::LightweightRTObject_var m_insref
Definition: RTObject.h:5421
PortAdmin m_portAdmin
List of Port Object reference.
Definition: RTObject.h:5230
void postOnFinalize(UniqueId ec_id, ReturnCode_t ret)
Definition: RTObject.h:4890
void preOnError(UniqueId ec_id)
Definition: RTObject.h:4860
const std::vector< OutPortBase * > & getOutPorts() const
Definition: RTObject.h:2505
virtual ReturnCode_t onInitialize()
Callback function to initialize.
void removeExecutionContextActionListener(ECActionListenerType listener_type, ECActionListener *listener)
Removing ExecutionContextAction type listener.
void updateParameters(const char *config_set)
Update configuration parameters (by ID)
PortableServer::POA_var m_pPOA
The pointer to the POA.
Definition: RTObject.h:5135
void preOnDeactivated(UniqueId ec_id)
Definition: RTObject.h:4850
bool m_exiting
RTC Finalize Status Flag.
Definition: RTObject.h:5293
void registerPort(PortService_ptr port)
[local interface] Register Port
bool addPort(PortService_ptr port)
[local interface] Register Port
SDOPackage::Configuration_ptr get_configuration() override
[SDO interface] Get Configuration object
void finalizePorts()
Unregister All Ports.
bool addSdoServiceConsumer(const SDOPackage::ServiceProfile &prof)
[local interface] Set a SDO service provider
ReturnCode_t deactivate(RTC::UniqueId ec_id)
[local interface] Make transition to Inactive state
ComponentProfile * get_component_profile() override
[RTObject CORBA interface] Get RTC's profile
virtual ReturnCode_t onFinalize()
Callback function to finalize.
void removeFsmProfileListener(FsmProfileListenerType listener_type, FsmProfileListener *listener)
Removing FsmProfile type listener.
void setWriteAll(bool write=true, bool completion=false)
Set whether to execute the writeAll() method.
CORBA::Boolean is_alive(ExecutionContext_ptr exec_context) override
[CORBA interface] Confirm whether RTC is the alive state
RTObject_var m_objref
Object reference.
Definition: RTObject.h:5221
ReturnCode_t on_initialize() override
[ComponentAction CORBA interface] Initialize RTC
void deletePort(CorbaPort &port)
[local interface] Unregister Port
void onDetachExecutionContext(UniqueId ec_id)
Definition: RTObject.h:4961
ConfigAdmin m_configsets
Configuration Administrator Object.
Definition: RTObject.h:5311
void setProperties(const coil::Properties &prop)
[local interface] Set RTC property
void finalizeOtherEC()
Finalize my EC This function detaching the RTC from others' ECs. This is called from only exit().
void initSdoService()
initialize SDO service stuff This function calles SdoService's initialize().
PortConnectListener * addPortConnectListener(PortConnectListenerType listener_type, Listener &obj, void(Listener::*memfunc)(const char *, ConnectorProfile &))
Definition: RTObject.h:3867
void setReadAll(bool read=true, bool completion=false)
Set whether to execute the readAll() method.
bool m_readAll
flag for readAll()
Definition: RTObject.h:5329
PortConnectListeners m_portconnListeners
PortConnectListener holder.
Definition: RTObject.h:5404
ReturnCode_t on_finalize() override
[ComponentAction CORBA interface] Finalize RTC
void registerPort(CorbaPort &port)
[local interface] Register Port
ExecutionContextHandle_t get_context_handle(ExecutionContext_ptr cxt) override
[CORBA interface] Return a handle of a ExecutionContext
ReturnCode_t initMineEC()
Initialize my EC This function initializes mine ECs. This is called from only initialize().
void addPortConnectRetListener(PortConnectRetListenerType listener_type, PortConnectRetListener *listener, bool autoclean=true)
Adding PortConnectRet type listener.
void removePreFsmActionListener(PreFsmActionListenerType listener_type, PreFsmActionListener *listener)
Removing PreFsmAction type listener.
char * get_sdo_id() override
[SDO interface] Get the SDO ID
SDOPackage::SDOService_ptr get_sdo_service(const char *id) override
[SDO interface] Get specified SDO Service's reference
std::vector< OutPortBase * > m_outports
List of OutPortBase*.
Definition: RTObject.h:5248
void removePostComponentActionListener(PostComponentActionListenerType listener_type, PostComponentActionListener *listener)
Removing PostComponentAction type listener.
ExecutionContext_ptr get_context(UniqueId ec_id) override
[CORBA interface] Get ExecutionContext.
virtual ReturnCode_t onAborting(RTC::UniqueId ec_id)
Callback function to abort.
PortServiceList * get_ports() override
[RTObject CORBA interface] Get Ports
SDOPackage::OrganizationList * get_owned_organizations() override
[SDO interface] Get Organization list
RTObject_impl(Manager *manager)
Constructor.
Definition: SdoServiceAdmin.h:151
Definition: SdoServiceProviderBase.h:136
Configuration implementation class.
Definition: SdoConfiguration.h:152
void push_back(CorbaSequence &seq, SequenceElement elem)
Push the new element back to the CORBA sequence.
Definition: CORBA_SeqUtil.h:175
RTC::LightweightRTObject_var LightweightRTObject_var
Definition: ExecutionContextWorker.h:38
RTC::LightweightRTObject_ptr LightweightRTObject_ptr
Definition: ExecutionContextWorker.h:37
RT-Component.
PortConnectListenerType
The types of ConnectorDataListener.
Definition: PortConnectListener.h:51
PortConnectRetListenerType
The types of PortConnectRetListenerType.
Definition: PortConnectListener.h:163
ExecutionContextActionListenerType
The types of ExecutionContextActionListener.
Definition: ComponentActionListener.h:494
FsmStructureListenerType
The types of FsmStructureListener.
Definition: FsmActionListener.h:812
ConfigurationSetNameListenerType
The types of ConfigurationSetNameListener.
Definition: ConfigurationListener.h:272
ConfigurationSetListenerType
The types of ConfigurationSetListener.
Definition: ConfigurationListener.h:161
ExecutionContextHandle_t UniqueId
Definition: ComponentActionListener.h:34
PreComponentActionListenerType
The types of ConnectorDataListener.
Definition: ComponentActionListener.h:60
PortActionListenerType
The types of PortActionListener.
Definition: ComponentActionListener.h:384
coil::Properties Properties
Definition: RTC.h:72
PreFsmActionListenerType
The types of PreFsmActionListener.
Definition: FsmActionListener.h:90
PostFsmActionListenerType
The types of PostFsmActionListener.
Definition: FsmActionListener.h:333
FsmProfileListenerType
The types of FsmProfileListener.
Definition: FsmActionListener.h:575
PostComponentActionListenerType
The types of ConnectorDataListener.
Definition: ComponentActionListener.h:226
ConfigurationParamListenerType
The types of ConnectorDataListener.
Definition: ConfigurationListener.h:46
SDO Package.
Definition: InPortConsumer.h:35
Functor to deactivate RTC.
Definition: RTObject.h:5535
deactivate_comps(LightweightRTObject_ptr comp)
Definition: RTObject.h:5536
LightweightRTObject_var m_comp
Definition: RTObject.h:5557
void operator()(ExecutionContextService_ptr ec)
Definition: RTObject.h:5540
Functor to copy ExecutionContext.
Definition: RTObject.h:5465
ExecutionContextList & m_eclist
Definition: RTObject.h:5478
ec_copy(ExecutionContextList &eclist)
Definition: RTObject.h:5466
void operator()(ExecutionContextService_ptr ecs)
Definition: RTObject.h:5470
Functor to find ExecutionContext.
Definition: RTObject.h:5488
bool operator()(ExecutionContextService_ptr ecs)
Definition: RTObject.h:5506
ExecutionContext_var m_ec
Definition: RTObject.h:5524
ec_find(ExecutionContext_ptr &ec)
Definition: RTObject.h:5489
Functor to find NVList.
Definition: RTObject.h:5448
bool operator()(const SDOPackage::NameValue &nv)
Definition: RTObject.h:5450
nv_name(const char *name)
Definition: RTObject.h:5449
std::string m_name
Definition: RTObject.h:5454
Functor to find from SDOService Profile List by id.
Definition: RTObject.h:5157
svc_name(const char *id)
Definition: RTObject.h:5158
bool operator()(const SDOPackage::ServiceProfile &prof)
Definition: RTObject.h:5159
std::string m_id
Definition: RTObject.h:5163