OpenRTM-aist  2.1.0
CORBA_RTCUtil.h
Go to the documentation of this file.
1 // -*- C++ -*-
18 #ifndef CORBA_RTCUTIL_H
19 #define CORBA_RTCUTIL_H
20 
21 #include <rtm/RTC.h>
22 #include <rtm/NVUtil.h>
23 #include <rtm/CORBA_SeqUtil.h>
24 #include <rtm/RTObject.h>
25 
26 #include <utility>
27 
28 
29 namespace CORBA_RTCUtil
30 {
165  coil::Properties get_component_profile(const RTC::RTObject_ptr rtc);
177  bool is_existing(const RTC::RTObject_ptr rtc);
189  bool is_alive_in_default_ec(const RTC::RTObject_ptr rtc);
190 
191 
205  RTC::ExecutionContext_ptr get_actual_ec(const RTC::RTObject_ptr rtc,
206  const RTC::UniqueId ec_id = 0);
207 
223  RTC::UniqueId get_ec_id(const RTC::RTObject_ptr rtc,
224  const RTC::ExecutionContext_ptr ec);
225 
241  RTC::ReturnCode_t activate(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id = 0);
242 
258  RTC::ReturnCode_t deactivate(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id = 0);
259 
275  RTC::ReturnCode_t reset(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id = 0);
276 
277 
278 
295  bool get_state(RTC::LifeCycleState &state, const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id = 0);
296 
297 
313  bool is_in_inactive(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id = 0);
314 
315 
330  bool is_in_active(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id = 0);
331 
332 
347  bool is_in_error(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id = 0);
348 
349 
350 
362  CORBA::Double get_default_rate(const RTC::RTObject_ptr rtc);
363 
364 
379  RTC::ReturnCode_t set_default_rate(const RTC::RTObject_ptr rtc,
380  CORBA::Double rate);
381 
382 
396  CORBA::Double get_current_rate(const RTC::RTObject_ptr rtc,
397  const RTC::UniqueId ec_id);
398 
415  RTC::ReturnCode_t set_current_rate(const RTC::RTObject_ptr rtc,
416  const RTC::UniqueId ec_id,
417  const CORBA::Double rate);
418 
419 
434  RTC::ReturnCode_t add_rtc_to_default_ec(const RTC::RTObject_ptr localcomp,
435  const RTC::RTObject_ptr othercomp);
436 
437 
452  RTC::ReturnCode_t remove_rtc_to_default_ec(const RTC::RTObject_ptr localcomp,
453  const RTC::RTObject_ptr othercomp);
454 
455 
468  RTC::RTCList get_participants_rtc(const RTC::RTObject_ptr rtc);
469 
470 
471 
483  coil::vstring get_port_names(const RTC::RTObject_ptr rtc);
484 
485 
497  coil::vstring get_inport_names(const RTC::RTObject_ptr rtc);
498 
499 
511  coil::vstring get_outport_names(const RTC::RTObject_ptr rtc);
512 
513 
525  coil::vstring get_svcport_names(const RTC::RTObject_ptr rtc);
526 
527 
539  coil::vstring get_connector_names(const RTC::PortService_ptr port);
540 
541 
555  coil::vstring get_connector_names(const RTC::RTObject_ptr rtc,
556  const std::string& port_name);
557 
569  coil::vstring get_connector_ids(const RTC::PortService_ptr port);
570 
571 
585  coil::vstring get_connector_ids(const RTC::RTObject_ptr rtc,
586  const std::string& port_name);
587 
588 
606  RTC::ConnectorProfile* create_connector(const std::string& name,
607  const coil::Properties& prop_arg,
608  const RTC::PortService_ptr port0,
609  const RTC::PortService_ptr port1);
610 
624  bool already_connected(const RTC::PortService_ptr localport,
625  const RTC::PortService_ptr otherport);
626 
645  RTC::ReturnCode_t connect(const std::string& name,
646  const coil::Properties& prop,
647  const RTC::PortService_ptr port0,
648  const RTC::PortService_ptr port1);
649 
650 
664  RTC::ReturnCode_t disconnect(const RTC::ConnectorProfile connector_prof);
665 
666 
681  RTC::ReturnCode_t disconnect_connector_name(const RTC::PortService_ptr port_ref, const std::string& conn_name);
682 
683 
684 
699  RTC::ReturnCode_t disconnect_connector_name(const std::string& port_name,
700  const std::string& conn_name);
701 
702 
717  RTC::ReturnCode_t
718  disconnect_connector_id(const RTC::PortService_ptr port_ref,
719  const std::string& conn_id);
720 
721 
736  RTC::ReturnCode_t disconnect_connector_id(const std::string& port_name,
737  const std::string& conn_id);
738 
751  RTC::ReturnCode_t disconnect_all(const RTC::PortService_ptr port_ref);
752 
753 
766  RTC::ReturnCode_t disconnect_all(const std::string& port_name);
767 
780  RTC::PortService_ptr get_port_by_url(const std::string& port_name);
781 
798  RTC::ReturnCode_t disconnect_name(const RTC::PortService_ptr localport,
799  const std::string& othername);
818  RTC::ReturnCode_t connect_multi(const std::string& name,
819  const coil::Properties& prop,
820  const RTC::PortService_ptr port,
821  RTC::PortServiceList& target_ports);
829  struct find_port
830  {
831  const std::string m_name;
841  find_port(std::string name) : m_name(std::move(name)) {}
853  bool operator()(const RTC::PortService_ptr p);
854  };
855 
869  RTC::PortService_ptr get_port_by_name(const RTC::RTObject_ptr rtc,
870  const std::string& name);
871 
894  RTC::ReturnCode_t connect_by_name(const std::string& name, const coil::Properties& prop,
895  const RTC::RTObject_ptr rtc0,
896  const std::string& portName0,
897  const RTC::RTObject_ptr rtc1,
898  const std::string& portName1);
899 
913  coil::Properties get_configuration(const RTC::RTObject_ptr rtc, const std::string& conf_name);
914 
915 
932  std::string get_parameter_by_key(const RTC::RTObject_ptr rtc,
933  const std::string& confset_name,
934  const std::string& value_name);
935 
948  std::string get_active_configuration_name(const RTC::RTObject_ptr rtc);
949 
950 
951 
963  coil::Properties get_active_configuration(const RTC::RTObject_ptr rtc);
964 
965 
983  bool set_configuration(const RTC::RTObject_ptr rtc, const std::string& confset_name, const std::string& value_name, const std::string& value);
984 
985 
986 
1002  bool set_active_configuration(const RTC::RTObject_ptr rtc, const std::string& value_name, const std::string& value);
1003 
1004 
1023  bool set_configuration_parameter(SDOPackage::Configuration_ptr conf,
1024  SDOPackage::ConfigurationSet& confset,
1025  const std::string& value_name,
1026  const std::string& value);
1041  class CorbaURI
1042  {
1043  public:
1088  CorbaURI(std::string uri, const std::string &objkey="");
1121  std::string toString() const;
1139  std::string getProtocol() const;
1156  std::string getHost() const;
1173  unsigned short getPort() const;
1191  bool isAddressOnly() const;
1192  private:
1193  std::string m_protocol;
1194  std::string m_host;
1195  unsigned short m_port;
1196  std::string m_path;
1197  std::string m_fragment;
1198  std::string m_uri;
1199  bool m_addressonly;
1200  };
1201 
1234  {
1235  public:
1261  RTCURIObject(const std::string& uri, bool isrtcname=false, bool isrtcloc=false);
1300  std::string getRTCName() const;
1319  std::string getAddress() const;
1336  bool isRTCNameURI() const;
1353  bool isRTCLocURI() const;
1354  private:
1355  std::string m_rtcpath;
1356  std::string m_address;
1357  bool m_is_rtcname;
1358  bool m_is_rtcloc;
1359  };
1360 
1361 
1362 } // namespace CORBA_RTCUtil
1363 #endif // CORBA_SEQUTIL_H
CORBA sequence utility template functions.
NameValue and NVList utility functions.
RTComponent header.
RT component base class.
CorbaURI class.
Definition: CORBA_RTCUtil.h:1042
bool isAddressOnly() const
std::string getHost() const
std::string getProtocol() const
unsigned short getPort() const
std::string toString() const
CorbaURI(std::string uri, const std::string &objkey="")
Constructor.
RTCURIObject class.
Definition: CORBA_RTCUtil.h:1234
std::string getAddress() const
std::string getRTCName() const
RTCURIObject(const std::string &uri, bool isrtcname=false, bool isrtcloc=false)
Constructor.
Definition: CORBA_RTCUtil.h:30
bool set_active_configuration(const RTC::RTObject_ptr rtc, const std::string &value_name, const std::string &value)
RTC::UniqueId get_ec_id(const RTC::RTObject_ptr rtc, const RTC::ExecutionContext_ptr ec)
CORBA::Double get_default_rate(const RTC::RTObject_ptr rtc)
RTC::ConnectorProfile * create_connector(const std::string &name, const coil::Properties &prop_arg, const RTC::PortService_ptr port0, const RTC::PortService_ptr port1)
bool set_configuration(const RTC::RTObject_ptr rtc, const std::string &confset_name, const std::string &value_name, const std::string &value)
coil::Properties get_configuration(const RTC::RTObject_ptr rtc, const std::string &conf_name)
coil::vstring get_svcport_names(const RTC::RTObject_ptr rtc)
bool get_state(RTC::LifeCycleState &state, const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id=0)
RTC::ReturnCode_t disconnect_connector_name(const RTC::PortService_ptr port_ref, const std::string &conn_name)
coil::Properties get_active_configuration(const RTC::RTObject_ptr rtc)
RTC::ReturnCode_t set_default_rate(const RTC::RTObject_ptr rtc, CORBA::Double rate)
std::string get_active_configuration_name(const RTC::RTObject_ptr rtc)
coil::vstring get_port_names(const RTC::RTObject_ptr rtc)
RTC::ReturnCode_t disconnect_all(const RTC::PortService_ptr port_ref)
RTC::ReturnCode_t activate(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id=0)
coil::vstring get_outport_names(const RTC::RTObject_ptr rtc)
RTC::ReturnCode_t set_current_rate(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id, const CORBA::Double rate)
bool is_alive_in_default_ec(const RTC::RTObject_ptr rtc)
coil::Properties get_component_profile(const RTC::RTObject_ptr rtc)
RTC handling utility functions.
RTC::ReturnCode_t connect_by_name(const std::string &name, const coil::Properties &prop, const RTC::RTObject_ptr rtc0, const std::string &portName0, const RTC::RTObject_ptr rtc1, const std::string &portName1)
RTC::RTCList get_participants_rtc(const RTC::RTObject_ptr rtc)
RTC::ReturnCode_t disconnect_connector_id(const RTC::PortService_ptr port_ref, const std::string &conn_id)
std::string get_parameter_by_key(const RTC::RTObject_ptr rtc, const std::string &confset_name, const std::string &value_name)
RTC::ReturnCode_t disconnect_name(const RTC::PortService_ptr localport, const std::string &othername)
RTC::ExecutionContext_ptr get_actual_ec(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id=0)
RTC::ReturnCode_t connect_multi(const std::string &name, const coil::Properties &prop, const RTC::PortService_ptr port, RTC::PortServiceList &target_ports)
bool is_in_active(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id=0)
RTC::PortService_ptr get_port_by_name(const RTC::RTObject_ptr rtc, const std::string &name)
bool set_configuration_parameter(SDOPackage::Configuration_ptr conf, SDOPackage::ConfigurationSet &confset, const std::string &value_name, const std::string &value)
RTC::ReturnCode_t connect(const std::string &name, const coil::Properties &prop, const RTC::PortService_ptr port0, const RTC::PortService_ptr port1)
bool is_existing(const RTC::RTObject_ptr rtc)
RTC::ReturnCode_t deactivate(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id=0)
coil::vstring get_connector_names(const RTC::PortService_ptr port)
bool is_in_error(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id=0)
coil::vstring get_connector_ids(const RTC::PortService_ptr port)
bool already_connected(const RTC::PortService_ptr localport, const RTC::PortService_ptr otherport)
RTC::PortService_ptr get_port_by_url(const std::string &port_name)
coil::vstring get_inport_names(const RTC::RTObject_ptr rtc)
RTC::ReturnCode_t reset(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id=0)
RTC::ReturnCode_t add_rtc_to_default_ec(const RTC::RTObject_ptr localcomp, const RTC::RTObject_ptr othercomp)
RTC::ReturnCode_t disconnect(const RTC::ConnectorProfile connector_prof)
CORBA::Double get_current_rate(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id)
bool is_in_inactive(const RTC::RTObject_ptr rtc, const RTC::UniqueId ec_id=0)
RTC::ReturnCode_t remove_rtc_to_default_ec(const RTC::RTObject_ptr localcomp, const RTC::RTObject_ptr othercomp)
ExecutionContextHandle_t UniqueId
Definition: ComponentActionListener.h:34
coil::Properties Properties
Definition: RTC.h:72
Definition: CORBA_RTCUtil.h:830
find_port(std::string name)
Definition: CORBA_RTCUtil.h:841
const std::string m_name
Definition: CORBA_RTCUtil.h:831
bool operator()(const RTC::PortService_ptr p)