OutPortBase.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
20 #include <iostream>
21 #include <algorithm>
22 #include <functional>
23 #include <iterator>
24 #include <coil/stringutil.h>
25 
26 #include <rtm/ConnectorBase.h>
29 #include <rtm/OutPortBase.h>
30 #include <rtm/PublisherBase.h>
31 
32 
33 namespace RTC
34 {
43  {
45  : m_factory(OutPortProviderFactory::instance())
46  {
47  }
49  {
51  }
53  };
54 
63  {
65  {
66  }
68  {
69  delete c;
70  }
71  };
72 
73 
81  OutPortBase::OutPortBase(const char* name, const char* data_type)
82  : PortBase(name), m_littleEndian(true)
83  {
84  RTC_DEBUG(("Port name: %s", name));
85 
86  RTC_DEBUG(("setting port.port_type: DataOutPort"));
87  addProperty("port.port_type", "DataOutPort");
88 
89  RTC_DEBUG(("setting dataport.data_type: %s", data_type));
90  addProperty("dataport.data_type", data_type);
91 
92  // publisher list
94  std::string pubs = coil::flatten(factory.getIdentifiers());
95 
96  // blank characters are deleted for RTSE's bug
97  coil::eraseBlank(pubs);
98  RTC_DEBUG(("available subscription_type: %s", pubs.c_str()));
99  addProperty("dataport.subscription_type", pubs.c_str());
100 
101  };
102 
111  {
112  RTC_TRACE(("~OutPortBase()"));
113  // connector のクリーンナップ std::for_each(m_connectors.begin(), m_connectors.end(), connector_cleanup()); } /*! * @if jp * @brief プロパティの初期化 * @else * @brief Initializing properties * @endif */ void OutPortBase::init(coil::Properties& prop) { RTC_TRACE(("init()")); RTC_PARANOID(("given properties:")); RTC_DEBUG_STR((prop)); // merge properties to PortProfile.properties m_properties << prop; NVList nv; NVUtil::copyFromProperties(nv, m_properties); CORBA_SeqUtil::push_back_list(m_profile.properties, nv); RTC_PARANOID(("updated properties:")); RTC_DEBUG_STR((m_properties)); configure(); initConsumers(); initProviders(); int num(-1); if (!coil::stringTo(num, m_properties.getProperty("connection_limit","-1").c_str())) { RTC_ERROR(("invalid connection_limit value: %s", m_properties.getProperty("connection_limit").c_str())); } setConnectionLimit(num); } /*! * @if jp * @brief プロパティを取得する * @else * @brief Get properties * @endif */ coil::Properties& OutPortBase::properties() { RTC_TRACE(("properties()")); return m_properties; } /*! * @if jp * @brief Connector を取得 * @else * @brief Connector list * @endif */ const std::vector<OutPortConnector*>& OutPortBase::connectors() { RTC_TRACE(("connectors(): size = %d", m_connectors.size())); return m_connectors; } /*! * @if jp * @brief ConnectorProfile を取得 * @else * @brief ConnectorProfile list * @endif */ ConnectorInfoList OutPortBase::getConnectorProfiles() { RTC_TRACE(("getConnectorProfiles(): size = %d", m_connectors.size())); ConnectorInfoList profs; for (int i(0), len(m_connectors.size()); i < len; ++i) { profs.push_back(m_connectors[i]->profile()); } return profs; } /*! * @if jp * @brief ConnectorId を取得 * @else * @brief ConnectorId list * @endif */ coil::vstring OutPortBase::getConnectorIds() { coil::vstring ids; for (int i(0), len(m_connectors.size()); i < len; ++i) { ids.push_back(m_connectors[i]->id()); } RTC_TRACE(("getConnectorIds(): %s", coil::flatten(ids).c_str())); return ids; } /*! * @if jp * @brief Connectorの名前を取得 * @else * @brief Connector name list * @endif */ coil::vstring OutPortBase::getConnectorNames() { coil::vstring names; for (int i(0), len(m_connectors.size()); i < len; ++i) { names.push_back(m_connectors[i]->name()); } RTC_TRACE(("getConnectorNames(): %s", coil::flatten(names).c_str())); return names; } /*! * @if jp * @brief ConnectorをIDで取得 * @else * @brief Getting Connector by ID * @endif */ OutPortConnector* OutPortBase::getConnectorById(const char* id) { RTC_TRACE(("getConnectorById(id = %s)", id)); std::string sid(id); for (int i(0), len(m_connectors.size()); i < len; ++i) { if (sid == m_connectors[i]->id()) { return m_connectors[i]; } } RTC_WARN(("ConnectorProfile with the id(%s) not found.", id)); return 0; } /*! * @if jp * @brief Connectorを名前で取得 * @else * @brief Getting ConnectorProfile by name * @endif */ OutPortConnector* OutPortBase::getConnectorByName(const char* name) { RTC_TRACE(("getConnectorByName(name = %s)", name)); std::string sname(name); for (int i(0), len(m_connectors.size()); i < len; ++i) { if (sname == m_connectors[i]->name()) { return m_connectors[i]; } } RTC_WARN(("ConnectorProfile with the name(%s) not found.", name)); return 0; } /*! * @if jp * @brief ConnectorProfileをIDで取得 * @else * @brief Getting ConnectorProfile by name * @endif */ bool OutPortBase::getConnectorProfileById(const char* id, ConnectorInfo& prof) { RTC_TRACE(("getConnectorProfileById(id = %s)", id)); OutPortConnector* conn(getConnectorById(id)); if (conn == 0) { return false; } prof = conn->profile(); return true; } /*! * @if jp * @brief ConnectorProfileを名前で取得 * @else * @brief Getting ConnectorProfile by name * @endif */ bool OutPortBase::getConnectorProfileByName(const char* name, ConnectorInfo& prof) { RTC_TRACE(("getConnectorProfileByName(name = %s)", name)); OutPortConnector* conn(getConnectorByName(name)); if (conn == 0) { return false; } prof = conn->profile(); return true; } /*! * @if jp * @brief OutPortを activates する * @else * @brief Activate all Port interfaces * @endif */ void OutPortBase::activateInterfaces() { RTC_TRACE(("activateInterfaces()")); for (int i(0), len(m_connectors.size()); i < len; ++i) { m_connectors[i]->activate(); } } /*! * @if jp * @brief 全ての Port のインターフェースを deactivates する * @else * @brief Deactivate all Port interfaces * @endif */ void OutPortBase::deactivateInterfaces() { RTC_TRACE(("deactivateInterfaces()")); for (int i(0), len(m_connectors.size()); i < len; ++i) { m_connectors[i]->deactivate(); } } /*! * @if jp * @brief ConnectorDataListener リスナを追加する * * バッファ書き込みまたは読み出しイベントに関連する各種リスナを設定する。 * * @else * @brief Adding BufferDataListener type listener * * @endif */ void OutPortBase:: addConnectorDataListener(ConnectorDataListenerType type, ConnectorDataListener* listener, bool autoclean) { if (type < CONNECTOR_DATA_LISTENER_NUM) { RTC_TRACE(("addConnectorDataListener(%s)", ConnectorDataListener::toString(type))); m_listeners.connectorData_[type].addListener(listener, autoclean); return; } RTC_ERROR(("addConnectorDataListener(): Unknown Listener Type")); return; } /*! * @if jp * @brief ConnectorDataListener リスナを削除する * * @else * @brief Removing ConnectorDataListener type listener * * @endif */ void OutPortBase:: removeConnectorDataListener(ConnectorDataListenerType type, ConnectorDataListener* listener) { if (type < CONNECTOR_DATA_LISTENER_NUM) { RTC_TRACE(("removeConnectorDataListener(%s)", ConnectorDataListener::toString(type))); m_listeners.connectorData_[type].removeListener(listener); return; } RTC_ERROR(("removeConnectorDataListener(): Unknown Listener Type")); return; } /*! * @if jp * @brief ConnectorListener リスナを追加する * * @else * @brief Adding ConnectorListener type listener * * @endif */ void OutPortBase::addConnectorListener(ConnectorListenerType type, ConnectorListener* listener, bool autoclean) { if (type < CONNECTOR_LISTENER_NUM) { RTC_TRACE(("addConnectorListener(%s)", ConnectorListener::toString(type))); m_listeners.connector_[type].addListener(listener, autoclean); return; } RTC_ERROR(("addConnectorListener(): Unknown Listener Type")); return; } /*! * @if jp * @brief ConnectorListener リスナを削除する * * @else * @brief Removing ConnectorListener type listener * * @endif */ void OutPortBase::removeConnectorListener(ConnectorListenerType type, ConnectorListener* listener) { if (type < CONNECTOR_LISTENER_NUM) { RTC_TRACE(("removeConnectorListener(%s)", ConnectorListener::toString(type))); m_listeners.connector_[type].removeListener(listener); return; } RTC_ERROR(("removeConnectorListener(): Unknown Listener Type")); return; } /*! * @if jp * @brief endian 設定がlittleか否か返す * @else * @brief return it whether endian setting is little * @endif */ bool OutPortBase::isLittleEndian() { return m_littleEndian; } /*! * @if jp * @brief [CORBA interface] Port の接続を行う * @else * @brief [CORBA interface] Connect the Port * @endif */ ReturnCode_t OutPortBase::connect(ConnectorProfile& connector_profile) throw (CORBA::SystemException) { RTC_TRACE(("OutPortBase::connect()")); // endian infomation check CORBA::Long index(NVUtil::find_index(connector_profile.properties, "dataport.serializer.cdr.endian")); if (index < 0) { RTC_TRACE(("ConnectorProfile dataport.serializer.cdr.endian set.")); // endian infomation set CORBA_SeqUtil::push_back(connector_profile.properties, NVUtil::newNV("dataport.serializer.cdr.endian", "little,big")); } return PortBase::connect(connector_profile); } //====================================================================== // protected member functions //====================================================================== /*! * @if jp * @brief OutPortの設定を行う * @else * @brief Configureing outport * @endif */ void OutPortBase::configure() { } /*! * @if jp * @brief Interface情報を公開する * @else * @brief Publish interface information * @endif */ ReturnCode_t OutPortBase::publishInterfaces(ConnectorProfile& cprof) { RTC_TRACE(("publishInterfaces()")); ReturnCode_t returnvalue = _publishInterfaces(); if(returnvalue!=RTC::RTC_OK) { return returnvalue; } // prop: [port.outport]. coil::Properties prop(m_properties); { coil::Properties conn_prop; NVUtil::copyToProperties(conn_prop, cprof.properties); prop << conn_prop.getNode("dataport"); // marge ConnectorProfile /* * marge ConnectorProfile for buffer property. * e.g. * prof[buffer.write.full_policy] * << cprof[dataport.outport.buffer.write.full_policy] */ prop << conn_prop.getNode("dataport.outport"); } RTC_DEBUG(("ConnectorProfile::properties are as follows.")); RTC_PARANOID_STR((prop)); /* * ここで, ConnectorProfile からの properties がマージされたため、 * prop["dataflow_type"]: データフロータイプ * prop["interface_type"]: インターフェースタイプ * などがアクセス可能になる。 */ std::string dflow_type(prop["dataflow_type"]); coil::normalize(dflow_type); if (dflow_type == "push") { RTC_PARANOID(("dataflow_type = push .... do nothing")); return RTC::RTC_OK; } else if (dflow_type == "pull") { RTC_PARANOID(("dataflow_type = pull .... create PullConnector")); OutPortProvider* provider(createProvider(cprof, prop)); if (provider == 0) { return RTC::BAD_PARAMETER; } // create OutPortPullConnector OutPortConnector* connector(createConnector(cprof, prop, provider)); if (connector == 0) { return RTC::RTC_ERROR; } // connector set provider->setConnector(connector); RTC_DEBUG(("publishInterface() successfully finished.")); return RTC::RTC_OK; } RTC_ERROR(("unsupported dataflow_type")); return RTC::BAD_PARAMETER; } /*! * @if jp * @brief Interface情報を取得する * @else * @brief Subscribe interface * @endif */ ReturnCode_t OutPortBase::subscribeInterfaces(const ConnectorProfile& cprof) { RTC_TRACE(("subscribeInterfaces()")); // prop: [port.outport]. coil::Properties prop(m_properties); { coil::Properties conn_prop; NVUtil::copyToProperties(conn_prop, cprof.properties); prop << conn_prop.getNode("dataport"); // marge ConnectorProfile /* * marge ConnectorProfile for buffer property. * e.g. * prof[buffer.write.full_policy] * << cprof[dataport.outport.buffer.write.full_policy] */ prop << conn_prop.getNode("dataport.outport"); } RTC_DEBUG(("ConnectorProfile::properties are as follows.")); RTC_DEBUG_STR((prop)); bool littleEndian; if (!checkEndian(prop, littleEndian)) { RTC_ERROR(("unsupported endian")); return RTC::UNSUPPORTED; } RTC_TRACE(("endian: %s", m_littleEndian ? "little":"big")); /* * ここで, ConnectorProfile からの properties がマージされたため、 * prop["dataflow_type"]: データフロータイプ * prop["interface_type"]: インターフェースタイプ * などがアクセス可能になる。 */ std::string& dflow_type(prop["dataflow_type"]); coil::normalize(dflow_type); if (dflow_type == "push") { RTC_PARANOID(("dataflow_type is push.")); // interface InPortConsumer* consumer(createConsumer(cprof, prop)); if (consumer == 0) { return RTC::BAD_PARAMETER; } // create OutPortPushConnector OutPortConnector* connector(createConnector(cprof, prop, consumer)); if (connector == 0) { return RTC::RTC_ERROR; } RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } else if (dflow_type == "pull") { RTC_PARANOID(("dataflow_type is pull.")); // set endian type OutPortConnector* conn(getConnectorById(cprof.connector_id)); if (conn == 0) { RTC_ERROR(("specified connector not found: %s", (const char*)cprof.connector_id)); return RTC::RTC_ERROR; } conn->setEndian(littleEndian); RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } RTC_ERROR(("unsupported dataflow_type: %s", dflow_type.c_str())); return RTC::BAD_PARAMETER; } /*! * @if jp * @brief 登録されているInterface情報を解除する * @else * @brief Unsubscribe interface * @endif */ void OutPortBase::unsubscribeInterfaces(const ConnectorProfile& connector_profile) { RTC_TRACE(("unsubscribeInterfaces()")); std::string id(connector_profile.connector_id); RTC_PARANOID(("connector_id: %s", id.c_str())); ConnectorList::iterator it(m_connectors.begin()); while (it != m_connectors.end()) { if (id == (*it)->id()) { // Connector's dtor must call disconnect() delete *it; m_connectors.erase(it); RTC_TRACE(("delete connector: %s", id.c_str())); return; } ++it; } RTC_ERROR(("specified connector not found: %s", id.c_str())); return; } /*! * @if jp * @brief OutPort provider の初期化 * @else * @brief OutPort provider initialization * @endif */ void OutPortBase::initProviders() { RTC_TRACE(("initProviders()")); // create OutPort providers OutPortProviderFactory& factory(OutPortProviderFactory::instance()); coil::vstring provider_types(factory.getIdentifiers()); RTC_PARANOID(("available OutPortProviders: %s", coil::flatten(provider_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("provider_types") && coil::normalize(m_properties["provider_types"]) != "all") { RTC_DEBUG(("allowed providers: %s", m_properties["provider_types"].c_str())); coil::vstring temp_types(provider_types); provider_types.clear(); coil::vstring active_types(coil::split(m_properties["provider_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(provider_types)); } #endif // OutPortProvider supports "pull" dataflow type if (provider_types.size() > 0) { RTC_DEBUG(("dataflow_type pull is supported")); appendProperty("dataport.dataflow_type", "pull"); appendProperty("dataport.interface_type", coil::flatten(provider_types).c_str()); } m_providerTypes = provider_types; } /*! * @if jp * @brief InPort consumer の初期化 * @else * @brief InPort consumer initialization * @endif */ void OutPortBase::initConsumers() { RTC_TRACE(("initConsumers()")); // create InPort consumers InPortConsumerFactory& factory(InPortConsumerFactory::instance()); coil::vstring consumer_types(factory.getIdentifiers()); RTC_PARANOID(("available InPortConsumer: %s", coil::flatten(consumer_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("consumer_types") && coil::normalize(m_properties["consumer_types"]) != "all") { RTC_DEBUG(("allowed consumers: %s", m_properties["consumer_types"].c_str())); coil::vstring temp_types(consumer_types); consumer_types.clear(); coil::vstring active_types(coil::split(m_properties["consumer_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(consumer_types)); } #endif // InPortConsumer supports "push" dataflow type if (consumer_types.size() > 0) { RTC_PARANOID(("dataflow_type push is supported")); appendProperty("dataport.dataflow_type", "push"); appendProperty("dataport.interface_type", coil::flatten(consumer_types).c_str()); } m_consumerTypes = consumer_types; } /*! * @if jp * @brief シリアライザのエンディアンをチェックする * @else * @brief Checking endian flag of serializer * @endif */ bool OutPortBase::checkEndian(const coil::Properties& prop, bool& littleEndian) { // old version check if(prop.hasKey("serializer") == NULL) { littleEndian = true; return true; } // endian type check std::string endian_type(prop.getProperty("serializer.cdr.endian", "")); RTC_DEBUG(("endian_type: %s", endian_type.c_str())); coil::normalize(endian_type); std::vector<std::string> endian(coil::split(endian_type, ",")); if(endian.empty()) { return false; } if(endian[0] == "little") { littleEndian = true; return true; } else if(endian[0] == "big") { littleEndian = false; return true; } return false; } /*! * @if jp * @brief OutPort provider の生成 * @else * @brief OutPort provider creation * @endif */ OutPortProvider* OutPortBase::createProvider(ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_providerTypes, prop["interface_type"])) { RTC_ERROR(("no provider found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_providerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); OutPortProvider* provider; provider = OutPortProviderFactory:: instance().createObject(prop["interface_type"].c_str()); if (provider != 0) { RTC_TRACE(("provider created")); provider->init(prop.getNode("provider")); #ifndef ORB_IS_RTORB if (!provider->publishInterface(cprof.properties)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #else // ORB_IS_RTORB ::SDOPackage::NVList_ptr prop_ref(cprof.properties); if (!provider->publishInterface(*prop_ref)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #endif // ORB_IS_RTORB return provider; } RTC_ERROR(("provider creation failed")); return 0; } /*! * @if jp * @brief InPort consumer の生成 * @else * @brief InPort consumer creation * @endif */ InPortConsumer* OutPortBase::createConsumer(const ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_consumerTypes, prop["interface_type"])) { RTC_ERROR(("no consumer found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_consumerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); InPortConsumer* consumer; consumer = InPortConsumerFactory:: instance().createObject(prop["interface_type"].c_str()); if (consumer != 0) { RTC_TRACE(("consumer created")); consumer->init(prop.getNode("consumer")); if (!consumer->subscribeInterface(cprof.properties)) { RTC_ERROR(("interface subscription failed.")); InPortConsumerFactory::instance().deleteObject(consumer); return 0; } return consumer; } RTC_ERROR(("consumer creation failed")); return 0; } /*! * @if jp * @brief OutPortPushConnector の生成 * @else * @brief OutPortPushConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, InPortConsumer* consumer) { #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPushConnector(profile, consumer, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPushConnector created")); // endian type set connector->setEndian(m_littleEndian); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPushConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } /*! * @if jp * @brief OutPortPullConnector の生成 * @else * @brief OutPortPullConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, OutPortProvider* provider) { RTC_VERBOSE(("createConnector()")); #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPullConnector(profile, provider, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPullConnector created")); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPullConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } }; // end of namespace RTM
114  std::for_each(m_connectors.begin(),
115  m_connectors.end(),
117  }
118 
127  {
128  RTC_TRACE(("init()"));
129  RTC_PARANOID(("given properties:"));
130  RTC_DEBUG_STR((prop));
131 
132  // merge properties to PortProfile.properties
133  m_properties << prop;
134  NVList nv;
137  RTC_PARANOID(("updated properties:"));
139 
140  configure();
141 
142  initConsumers();
143  initProviders();
144  int num(-1);
145  if (!coil::stringTo(num,
146  m_properties.getProperty("connection_limit","-1").c_str()))
147  {
148  RTC_ERROR(("invalid connection_limit value: %s",
149  m_properties.getProperty("connection_limit").c_str()));
150  }
151 
152  setConnectionLimit(num);
153  }
154 
163  {
164  RTC_TRACE(("properties()"));
165  return m_properties;
166  }
167 
175  const std::vector<OutPortConnector*>& OutPortBase::connectors()
176  {
177  RTC_TRACE(("connectors(): size = %d", m_connectors.size()));
178  return m_connectors;
179  }
180 
189  {
190  RTC_TRACE(("getConnectorProfiles(): size = %d", m_connectors.size()));
191  ConnectorInfoList profs;
192  for (int i(0), len(m_connectors.size()); i < len; ++i)
193  {
194  profs.push_back(m_connectors[i]->profile());
195  }
196  return profs;
197  }
198 
207  {
208  coil::vstring ids;
209  for (int i(0), len(m_connectors.size()); i < len; ++i)
210  {
211  ids.push_back(m_connectors[i]->id());
212  }
213  RTC_TRACE(("getConnectorIds(): %s", coil::flatten(ids).c_str()));
214  return ids;
215  }
216 
225  {
226  coil::vstring names;
227  for (int i(0), len(m_connectors.size()); i < len; ++i)
228  {
229  names.push_back(m_connectors[i]->name());
230  }
231  RTC_TRACE(("getConnectorNames(): %s", coil::flatten(names).c_str()));
232  return names;
233  }
234 
243  {
244  RTC_TRACE(("getConnectorById(id = %s)", id));
245 
246  std::string sid(id);
247  for (int i(0), len(m_connectors.size()); i < len; ++i)
248  {
249  if (sid == m_connectors[i]->id())
250  {
251  return m_connectors[i];
252  }
253  }
254  RTC_WARN(("ConnectorProfile with the id(%s) not found.", id));
255  return 0;
256  }
257 
266  {
267  RTC_TRACE(("getConnectorByName(name = %s)", name));
268 
269  std::string sname(name);
270  for (int i(0), len(m_connectors.size()); i < len; ++i)
271  {
272  if (sname == m_connectors[i]->name())
273  {
274  return m_connectors[i];
275  }
276  }
277  RTC_WARN(("ConnectorProfile with the name(%s) not found.", name));
278  return 0;
279  }
280 
289  ConnectorInfo& prof)
290  {
291  RTC_TRACE(("getConnectorProfileById(id = %s)", id));
293  if (conn == 0)
294  {
295  return false;
296  }
297  prof = conn->profile();
298  return true;
299  }
300 
309  ConnectorInfo& prof)
310  {
311  RTC_TRACE(("getConnectorProfileByName(name = %s)", name));
313  if (conn == 0)
314  {
315  return false;
316  }
317  prof = conn->profile();
318  return true;
319  }
320 
329  {
330  RTC_TRACE(("activateInterfaces()"));
331 
332  for (int i(0), len(m_connectors.size()); i < len; ++i)
333  {
334  m_connectors[i]->activate();
335  }
336  }
337 
346  {
347  RTC_TRACE(("deactivateInterfaces()"));
348 
349  for (int i(0), len(m_connectors.size()); i < len; ++i)
350  {
351  m_connectors[i]->deactivate();
352  }
353  }
354 
355 
367  void OutPortBase::
369  ConnectorDataListener* listener,
370  bool autoclean)
371  {
372  if (type < CONNECTOR_DATA_LISTENER_NUM)
373  {
374  RTC_TRACE(("addConnectorDataListener(%s)",
376  m_listeners.connectorData_[type].addListener(listener, autoclean);
377  return;
378  }
379  RTC_ERROR(("addConnectorDataListener(): Unknown Listener Type"));
380  return;
381  }
382 
392  void OutPortBase::
394  ConnectorDataListener* listener)
395  {
396  if (type < CONNECTOR_DATA_LISTENER_NUM)
397  {
398  RTC_TRACE(("removeConnectorDataListener(%s)",
400  m_listeners.connectorData_[type].removeListener(listener);
401  return;
402  }
403  RTC_ERROR(("removeConnectorDataListener(): Unknown Listener Type"));
404  return;
405  }
406 
417  ConnectorListener* listener,
418  bool autoclean)
419  {
420  if (type < CONNECTOR_LISTENER_NUM)
421  {
422  RTC_TRACE(("addConnectorListener(%s)",
424  m_listeners.connector_[type].addListener(listener, autoclean);
425  return;
426  }
427  RTC_ERROR(("addConnectorListener(): Unknown Listener Type"));
428  return;
429  }
430 
441  ConnectorListener* listener)
442  {
443  if (type < CONNECTOR_LISTENER_NUM)
444  {
445  RTC_TRACE(("removeConnectorListener(%s)",
447  m_listeners.connector_[type].removeListener(listener);
448  return;
449  }
450  RTC_ERROR(("removeConnectorListener(): Unknown Listener Type"));
451  return;
452  }
453 
462  {
463  return m_littleEndian;
464  }
465 
473  ReturnCode_t OutPortBase::connect(ConnectorProfile& connector_profile)
474  throw (CORBA::SystemException)
475  {
476  RTC_TRACE(("OutPortBase::connect()"));
477 
478  // endian infomation check
479  CORBA::Long index(NVUtil::find_index(connector_profile.properties,
480  "dataport.serializer.cdr.endian"));
481  if (index < 0)
482  {
483  RTC_TRACE(("ConnectorProfile dataport.serializer.cdr.endian set."));
484  // endian infomation set
485  CORBA_SeqUtil::push_back(connector_profile.properties,
486  NVUtil::newNV("dataport.serializer.cdr.endian", "little,big"));
487  }
488  return PortBase::connect(connector_profile);
489  }
490 
491 
492  //======================================================================
493  // protected member functions
494  //======================================================================
503  {
504 
505  }
506 
507 
516  {
517  RTC_TRACE(("publishInterfaces()"));
518 
519  ReturnCode_t returnvalue = _publishInterfaces();
520  if(returnvalue!=RTC::RTC_OK)
521  {
522  return returnvalue;
523  }
524 
525  // prop: [port.outport].
527  {
528  coil::Properties conn_prop;
529  NVUtil::copyToProperties(conn_prop, cprof.properties);
530  prop << conn_prop.getNode("dataport"); // marge ConnectorProfile
531  /*
532  * marge ConnectorProfile for buffer property.
533  * e.g.
534  * prof[buffer.write.full_policy]
535  * << cprof[dataport.outport.buffer.write.full_policy]
536  */
537  prop << conn_prop.getNode("dataport.outport");
538  }
539  RTC_DEBUG(("ConnectorProfile::properties are as follows."));
540  RTC_PARANOID_STR((prop));
541 
542  /*
543  * ここで, ConnectorProfile からの properties がマージされたため、
544  * prop["dataflow_type"]: データフロータイプ * prop["interface_type"]: インターフェースタイプ * などがアクセス可能になる。 */ std::string dflow_type(prop["dataflow_type"]); coil::normalize(dflow_type); if (dflow_type == "push") { RTC_PARANOID(("dataflow_type = push .... do nothing")); return RTC::RTC_OK; } else if (dflow_type == "pull") { RTC_PARANOID(("dataflow_type = pull .... create PullConnector")); OutPortProvider* provider(createProvider(cprof, prop)); if (provider == 0) { return RTC::BAD_PARAMETER; } // create OutPortPullConnector OutPortConnector* connector(createConnector(cprof, prop, provider)); if (connector == 0) { return RTC::RTC_ERROR; } // connector set provider->setConnector(connector); RTC_DEBUG(("publishInterface() successfully finished.")); return RTC::RTC_OK; } RTC_ERROR(("unsupported dataflow_type")); return RTC::BAD_PARAMETER; } /*! * @if jp * @brief Interface情報を取得する * @else * @brief Subscribe interface * @endif */ ReturnCode_t OutPortBase::subscribeInterfaces(const ConnectorProfile& cprof) { RTC_TRACE(("subscribeInterfaces()")); // prop: [port.outport]. coil::Properties prop(m_properties); { coil::Properties conn_prop; NVUtil::copyToProperties(conn_prop, cprof.properties); prop << conn_prop.getNode("dataport"); // marge ConnectorProfile /* * marge ConnectorProfile for buffer property. * e.g. * prof[buffer.write.full_policy] * << cprof[dataport.outport.buffer.write.full_policy] */ prop << conn_prop.getNode("dataport.outport"); } RTC_DEBUG(("ConnectorProfile::properties are as follows.")); RTC_DEBUG_STR((prop)); bool littleEndian; if (!checkEndian(prop, littleEndian)) { RTC_ERROR(("unsupported endian")); return RTC::UNSUPPORTED; } RTC_TRACE(("endian: %s", m_littleEndian ? "little":"big")); /* * ここで, ConnectorProfile からの properties がマージされたため、 * prop["dataflow_type"]: データフロータイプ * prop["interface_type"]: インターフェースタイプ * などがアクセス可能になる。 */ std::string& dflow_type(prop["dataflow_type"]); coil::normalize(dflow_type); if (dflow_type == "push") { RTC_PARANOID(("dataflow_type is push.")); // interface InPortConsumer* consumer(createConsumer(cprof, prop)); if (consumer == 0) { return RTC::BAD_PARAMETER; } // create OutPortPushConnector OutPortConnector* connector(createConnector(cprof, prop, consumer)); if (connector == 0) { return RTC::RTC_ERROR; } RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } else if (dflow_type == "pull") { RTC_PARANOID(("dataflow_type is pull.")); // set endian type OutPortConnector* conn(getConnectorById(cprof.connector_id)); if (conn == 0) { RTC_ERROR(("specified connector not found: %s", (const char*)cprof.connector_id)); return RTC::RTC_ERROR; } conn->setEndian(littleEndian); RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } RTC_ERROR(("unsupported dataflow_type: %s", dflow_type.c_str())); return RTC::BAD_PARAMETER; } /*! * @if jp * @brief 登録されているInterface情報を解除する * @else * @brief Unsubscribe interface * @endif */ void OutPortBase::unsubscribeInterfaces(const ConnectorProfile& connector_profile) { RTC_TRACE(("unsubscribeInterfaces()")); std::string id(connector_profile.connector_id); RTC_PARANOID(("connector_id: %s", id.c_str())); ConnectorList::iterator it(m_connectors.begin()); while (it != m_connectors.end()) { if (id == (*it)->id()) { // Connector's dtor must call disconnect() delete *it; m_connectors.erase(it); RTC_TRACE(("delete connector: %s", id.c_str())); return; } ++it; } RTC_ERROR(("specified connector not found: %s", id.c_str())); return; } /*! * @if jp * @brief OutPort provider の初期化 * @else * @brief OutPort provider initialization * @endif */ void OutPortBase::initProviders() { RTC_TRACE(("initProviders()")); // create OutPort providers OutPortProviderFactory& factory(OutPortProviderFactory::instance()); coil::vstring provider_types(factory.getIdentifiers()); RTC_PARANOID(("available OutPortProviders: %s", coil::flatten(provider_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("provider_types") && coil::normalize(m_properties["provider_types"]) != "all") { RTC_DEBUG(("allowed providers: %s", m_properties["provider_types"].c_str())); coil::vstring temp_types(provider_types); provider_types.clear(); coil::vstring active_types(coil::split(m_properties["provider_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(provider_types)); } #endif // OutPortProvider supports "pull" dataflow type if (provider_types.size() > 0) { RTC_DEBUG(("dataflow_type pull is supported")); appendProperty("dataport.dataflow_type", "pull"); appendProperty("dataport.interface_type", coil::flatten(provider_types).c_str()); } m_providerTypes = provider_types; } /*! * @if jp * @brief InPort consumer の初期化 * @else * @brief InPort consumer initialization * @endif */ void OutPortBase::initConsumers() { RTC_TRACE(("initConsumers()")); // create InPort consumers InPortConsumerFactory& factory(InPortConsumerFactory::instance()); coil::vstring consumer_types(factory.getIdentifiers()); RTC_PARANOID(("available InPortConsumer: %s", coil::flatten(consumer_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("consumer_types") && coil::normalize(m_properties["consumer_types"]) != "all") { RTC_DEBUG(("allowed consumers: %s", m_properties["consumer_types"].c_str())); coil::vstring temp_types(consumer_types); consumer_types.clear(); coil::vstring active_types(coil::split(m_properties["consumer_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(consumer_types)); } #endif // InPortConsumer supports "push" dataflow type if (consumer_types.size() > 0) { RTC_PARANOID(("dataflow_type push is supported")); appendProperty("dataport.dataflow_type", "push"); appendProperty("dataport.interface_type", coil::flatten(consumer_types).c_str()); } m_consumerTypes = consumer_types; } /*! * @if jp * @brief シリアライザのエンディアンをチェックする * @else * @brief Checking endian flag of serializer * @endif */ bool OutPortBase::checkEndian(const coil::Properties& prop, bool& littleEndian) { // old version check if(prop.hasKey("serializer") == NULL) { littleEndian = true; return true; } // endian type check std::string endian_type(prop.getProperty("serializer.cdr.endian", "")); RTC_DEBUG(("endian_type: %s", endian_type.c_str())); coil::normalize(endian_type); std::vector<std::string> endian(coil::split(endian_type, ",")); if(endian.empty()) { return false; } if(endian[0] == "little") { littleEndian = true; return true; } else if(endian[0] == "big") { littleEndian = false; return true; } return false; } /*! * @if jp * @brief OutPort provider の生成 * @else * @brief OutPort provider creation * @endif */ OutPortProvider* OutPortBase::createProvider(ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_providerTypes, prop["interface_type"])) { RTC_ERROR(("no provider found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_providerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); OutPortProvider* provider; provider = OutPortProviderFactory:: instance().createObject(prop["interface_type"].c_str()); if (provider != 0) { RTC_TRACE(("provider created")); provider->init(prop.getNode("provider")); #ifndef ORB_IS_RTORB if (!provider->publishInterface(cprof.properties)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #else // ORB_IS_RTORB ::SDOPackage::NVList_ptr prop_ref(cprof.properties); if (!provider->publishInterface(*prop_ref)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #endif // ORB_IS_RTORB return provider; } RTC_ERROR(("provider creation failed")); return 0; } /*! * @if jp * @brief InPort consumer の生成 * @else * @brief InPort consumer creation * @endif */ InPortConsumer* OutPortBase::createConsumer(const ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_consumerTypes, prop["interface_type"])) { RTC_ERROR(("no consumer found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_consumerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); InPortConsumer* consumer; consumer = InPortConsumerFactory:: instance().createObject(prop["interface_type"].c_str()); if (consumer != 0) { RTC_TRACE(("consumer created")); consumer->init(prop.getNode("consumer")); if (!consumer->subscribeInterface(cprof.properties)) { RTC_ERROR(("interface subscription failed.")); InPortConsumerFactory::instance().deleteObject(consumer); return 0; } return consumer; } RTC_ERROR(("consumer creation failed")); return 0; } /*! * @if jp * @brief OutPortPushConnector の生成 * @else * @brief OutPortPushConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, InPortConsumer* consumer) { #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPushConnector(profile, consumer, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPushConnector created")); // endian type set connector->setEndian(m_littleEndian); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPushConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } /*! * @if jp * @brief OutPortPullConnector の生成 * @else * @brief OutPortPullConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, OutPortProvider* provider) { RTC_VERBOSE(("createConnector()")); #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPullConnector(profile, provider, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPullConnector created")); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPullConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } }; // end of namespace RTM
545  * prop["interface_type"]: インターフェースタイプ * などがアクセス可能になる。 */ std::string dflow_type(prop["dataflow_type"]); coil::normalize(dflow_type); if (dflow_type == "push") { RTC_PARANOID(("dataflow_type = push .... do nothing")); return RTC::RTC_OK; } else if (dflow_type == "pull") { RTC_PARANOID(("dataflow_type = pull .... create PullConnector")); OutPortProvider* provider(createProvider(cprof, prop)); if (provider == 0) { return RTC::BAD_PARAMETER; } // create OutPortPullConnector OutPortConnector* connector(createConnector(cprof, prop, provider)); if (connector == 0) { return RTC::RTC_ERROR; } // connector set provider->setConnector(connector); RTC_DEBUG(("publishInterface() successfully finished.")); return RTC::RTC_OK; } RTC_ERROR(("unsupported dataflow_type")); return RTC::BAD_PARAMETER; } /*! * @if jp * @brief Interface情報を取得する * @else * @brief Subscribe interface * @endif */ ReturnCode_t OutPortBase::subscribeInterfaces(const ConnectorProfile& cprof) { RTC_TRACE(("subscribeInterfaces()")); // prop: [port.outport]. coil::Properties prop(m_properties); { coil::Properties conn_prop; NVUtil::copyToProperties(conn_prop, cprof.properties); prop << conn_prop.getNode("dataport"); // marge ConnectorProfile /* * marge ConnectorProfile for buffer property. * e.g. * prof[buffer.write.full_policy] * << cprof[dataport.outport.buffer.write.full_policy] */ prop << conn_prop.getNode("dataport.outport"); } RTC_DEBUG(("ConnectorProfile::properties are as follows.")); RTC_DEBUG_STR((prop)); bool littleEndian; if (!checkEndian(prop, littleEndian)) { RTC_ERROR(("unsupported endian")); return RTC::UNSUPPORTED; } RTC_TRACE(("endian: %s", m_littleEndian ? "little":"big")); /* * ここで, ConnectorProfile からの properties がマージされたため、 * prop["dataflow_type"]: データフロータイプ * prop["interface_type"]: インターフェースタイプ * などがアクセス可能になる。 */ std::string& dflow_type(prop["dataflow_type"]); coil::normalize(dflow_type); if (dflow_type == "push") { RTC_PARANOID(("dataflow_type is push.")); // interface InPortConsumer* consumer(createConsumer(cprof, prop)); if (consumer == 0) { return RTC::BAD_PARAMETER; } // create OutPortPushConnector OutPortConnector* connector(createConnector(cprof, prop, consumer)); if (connector == 0) { return RTC::RTC_ERROR; } RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } else if (dflow_type == "pull") { RTC_PARANOID(("dataflow_type is pull.")); // set endian type OutPortConnector* conn(getConnectorById(cprof.connector_id)); if (conn == 0) { RTC_ERROR(("specified connector not found: %s", (const char*)cprof.connector_id)); return RTC::RTC_ERROR; } conn->setEndian(littleEndian); RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } RTC_ERROR(("unsupported dataflow_type: %s", dflow_type.c_str())); return RTC::BAD_PARAMETER; } /*! * @if jp * @brief 登録されているInterface情報を解除する * @else * @brief Unsubscribe interface * @endif */ void OutPortBase::unsubscribeInterfaces(const ConnectorProfile& connector_profile) { RTC_TRACE(("unsubscribeInterfaces()")); std::string id(connector_profile.connector_id); RTC_PARANOID(("connector_id: %s", id.c_str())); ConnectorList::iterator it(m_connectors.begin()); while (it != m_connectors.end()) { if (id == (*it)->id()) { // Connector's dtor must call disconnect() delete *it; m_connectors.erase(it); RTC_TRACE(("delete connector: %s", id.c_str())); return; } ++it; } RTC_ERROR(("specified connector not found: %s", id.c_str())); return; } /*! * @if jp * @brief OutPort provider の初期化 * @else * @brief OutPort provider initialization * @endif */ void OutPortBase::initProviders() { RTC_TRACE(("initProviders()")); // create OutPort providers OutPortProviderFactory& factory(OutPortProviderFactory::instance()); coil::vstring provider_types(factory.getIdentifiers()); RTC_PARANOID(("available OutPortProviders: %s", coil::flatten(provider_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("provider_types") && coil::normalize(m_properties["provider_types"]) != "all") { RTC_DEBUG(("allowed providers: %s", m_properties["provider_types"].c_str())); coil::vstring temp_types(provider_types); provider_types.clear(); coil::vstring active_types(coil::split(m_properties["provider_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(provider_types)); } #endif // OutPortProvider supports "pull" dataflow type if (provider_types.size() > 0) { RTC_DEBUG(("dataflow_type pull is supported")); appendProperty("dataport.dataflow_type", "pull"); appendProperty("dataport.interface_type", coil::flatten(provider_types).c_str()); } m_providerTypes = provider_types; } /*! * @if jp * @brief InPort consumer の初期化 * @else * @brief InPort consumer initialization * @endif */ void OutPortBase::initConsumers() { RTC_TRACE(("initConsumers()")); // create InPort consumers InPortConsumerFactory& factory(InPortConsumerFactory::instance()); coil::vstring consumer_types(factory.getIdentifiers()); RTC_PARANOID(("available InPortConsumer: %s", coil::flatten(consumer_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("consumer_types") && coil::normalize(m_properties["consumer_types"]) != "all") { RTC_DEBUG(("allowed consumers: %s", m_properties["consumer_types"].c_str())); coil::vstring temp_types(consumer_types); consumer_types.clear(); coil::vstring active_types(coil::split(m_properties["consumer_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(consumer_types)); } #endif // InPortConsumer supports "push" dataflow type if (consumer_types.size() > 0) { RTC_PARANOID(("dataflow_type push is supported")); appendProperty("dataport.dataflow_type", "push"); appendProperty("dataport.interface_type", coil::flatten(consumer_types).c_str()); } m_consumerTypes = consumer_types; } /*! * @if jp * @brief シリアライザのエンディアンをチェックする * @else * @brief Checking endian flag of serializer * @endif */ bool OutPortBase::checkEndian(const coil::Properties& prop, bool& littleEndian) { // old version check if(prop.hasKey("serializer") == NULL) { littleEndian = true; return true; } // endian type check std::string endian_type(prop.getProperty("serializer.cdr.endian", "")); RTC_DEBUG(("endian_type: %s", endian_type.c_str())); coil::normalize(endian_type); std::vector<std::string> endian(coil::split(endian_type, ",")); if(endian.empty()) { return false; } if(endian[0] == "little") { littleEndian = true; return true; } else if(endian[0] == "big") { littleEndian = false; return true; } return false; } /*! * @if jp * @brief OutPort provider の生成 * @else * @brief OutPort provider creation * @endif */ OutPortProvider* OutPortBase::createProvider(ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_providerTypes, prop["interface_type"])) { RTC_ERROR(("no provider found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_providerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); OutPortProvider* provider; provider = OutPortProviderFactory:: instance().createObject(prop["interface_type"].c_str()); if (provider != 0) { RTC_TRACE(("provider created")); provider->init(prop.getNode("provider")); #ifndef ORB_IS_RTORB if (!provider->publishInterface(cprof.properties)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #else // ORB_IS_RTORB ::SDOPackage::NVList_ptr prop_ref(cprof.properties); if (!provider->publishInterface(*prop_ref)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #endif // ORB_IS_RTORB return provider; } RTC_ERROR(("provider creation failed")); return 0; } /*! * @if jp * @brief InPort consumer の生成 * @else * @brief InPort consumer creation * @endif */ InPortConsumer* OutPortBase::createConsumer(const ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_consumerTypes, prop["interface_type"])) { RTC_ERROR(("no consumer found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_consumerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); InPortConsumer* consumer; consumer = InPortConsumerFactory:: instance().createObject(prop["interface_type"].c_str()); if (consumer != 0) { RTC_TRACE(("consumer created")); consumer->init(prop.getNode("consumer")); if (!consumer->subscribeInterface(cprof.properties)) { RTC_ERROR(("interface subscription failed.")); InPortConsumerFactory::instance().deleteObject(consumer); return 0; } return consumer; } RTC_ERROR(("consumer creation failed")); return 0; } /*! * @if jp * @brief OutPortPushConnector の生成 * @else * @brief OutPortPushConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, InPortConsumer* consumer) { #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPushConnector(profile, consumer, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPushConnector created")); // endian type set connector->setEndian(m_littleEndian); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPushConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } /*! * @if jp * @brief OutPortPullConnector の生成 * @else * @brief OutPortPullConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, OutPortProvider* provider) { RTC_VERBOSE(("createConnector()")); #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPullConnector(profile, provider, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPullConnector created")); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPullConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } }; // end of namespace RTM
546  * などがアクセス可能になる。
547  */
548  std::string dflow_type(prop["dataflow_type"]);
549  coil::normalize(dflow_type);
550 
551  if (dflow_type == "push")
552  {
553  RTC_PARANOID(("dataflow_type = push .... do nothing"));
554  return RTC::RTC_OK;
555  }
556  else if (dflow_type == "pull")
557  {
558  RTC_PARANOID(("dataflow_type = pull .... create PullConnector"));
559 
560  OutPortProvider* provider(createProvider(cprof, prop));
561  if (provider == 0)
562  {
563  return RTC::BAD_PARAMETER;
564  }
565 
566  // create OutPortPullConnector
567  OutPortConnector* connector(createConnector(cprof, prop, provider));
568  if (connector == 0)
569  {
570  return RTC::RTC_ERROR;
571  }
572 
573  // connector set
574  provider->setConnector(connector);
575 
576  RTC_DEBUG(("publishInterface() successfully finished."));
577  return RTC::RTC_OK;
578  }
579 
580  RTC_ERROR(("unsupported dataflow_type"));
581 
582  return RTC::BAD_PARAMETER;
583  }
584 
592  ReturnCode_t OutPortBase::subscribeInterfaces(const ConnectorProfile& cprof)
593  {
594  RTC_TRACE(("subscribeInterfaces()"));
595 
596  // prop: [port.outport].
598  {
599  coil::Properties conn_prop;
600  NVUtil::copyToProperties(conn_prop, cprof.properties);
601  prop << conn_prop.getNode("dataport"); // marge ConnectorProfile
602  /*
603  * marge ConnectorProfile for buffer property.
604  * e.g.
605  * prof[buffer.write.full_policy]
606  * << cprof[dataport.outport.buffer.write.full_policy]
607  */
608  prop << conn_prop.getNode("dataport.outport");
609  }
610  RTC_DEBUG(("ConnectorProfile::properties are as follows."));
611  RTC_DEBUG_STR((prop));
612 
613  bool littleEndian;
614  if (!checkEndian(prop, littleEndian))
615  {
616  RTC_ERROR(("unsupported endian"));
617  return RTC::UNSUPPORTED;
618  }
619  RTC_TRACE(("endian: %s", m_littleEndian ? "little":"big"));
620 
621  /*
622  * ここで, ConnectorProfile からの properties がマージされたため、
623  * prop["dataflow_type"]: データフロータイプ * prop["interface_type"]: インターフェースタイプ * などがアクセス可能になる。 */ std::string& dflow_type(prop["dataflow_type"]); coil::normalize(dflow_type); if (dflow_type == "push") { RTC_PARANOID(("dataflow_type is push.")); // interface InPortConsumer* consumer(createConsumer(cprof, prop)); if (consumer == 0) { return RTC::BAD_PARAMETER; } // create OutPortPushConnector OutPortConnector* connector(createConnector(cprof, prop, consumer)); if (connector == 0) { return RTC::RTC_ERROR; } RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } else if (dflow_type == "pull") { RTC_PARANOID(("dataflow_type is pull.")); // set endian type OutPortConnector* conn(getConnectorById(cprof.connector_id)); if (conn == 0) { RTC_ERROR(("specified connector not found: %s", (const char*)cprof.connector_id)); return RTC::RTC_ERROR; } conn->setEndian(littleEndian); RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } RTC_ERROR(("unsupported dataflow_type: %s", dflow_type.c_str())); return RTC::BAD_PARAMETER; } /*! * @if jp * @brief 登録されているInterface情報を解除する * @else * @brief Unsubscribe interface * @endif */ void OutPortBase::unsubscribeInterfaces(const ConnectorProfile& connector_profile) { RTC_TRACE(("unsubscribeInterfaces()")); std::string id(connector_profile.connector_id); RTC_PARANOID(("connector_id: %s", id.c_str())); ConnectorList::iterator it(m_connectors.begin()); while (it != m_connectors.end()) { if (id == (*it)->id()) { // Connector's dtor must call disconnect() delete *it; m_connectors.erase(it); RTC_TRACE(("delete connector: %s", id.c_str())); return; } ++it; } RTC_ERROR(("specified connector not found: %s", id.c_str())); return; } /*! * @if jp * @brief OutPort provider の初期化 * @else * @brief OutPort provider initialization * @endif */ void OutPortBase::initProviders() { RTC_TRACE(("initProviders()")); // create OutPort providers OutPortProviderFactory& factory(OutPortProviderFactory::instance()); coil::vstring provider_types(factory.getIdentifiers()); RTC_PARANOID(("available OutPortProviders: %s", coil::flatten(provider_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("provider_types") && coil::normalize(m_properties["provider_types"]) != "all") { RTC_DEBUG(("allowed providers: %s", m_properties["provider_types"].c_str())); coil::vstring temp_types(provider_types); provider_types.clear(); coil::vstring active_types(coil::split(m_properties["provider_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(provider_types)); } #endif // OutPortProvider supports "pull" dataflow type if (provider_types.size() > 0) { RTC_DEBUG(("dataflow_type pull is supported")); appendProperty("dataport.dataflow_type", "pull"); appendProperty("dataport.interface_type", coil::flatten(provider_types).c_str()); } m_providerTypes = provider_types; } /*! * @if jp * @brief InPort consumer の初期化 * @else * @brief InPort consumer initialization * @endif */ void OutPortBase::initConsumers() { RTC_TRACE(("initConsumers()")); // create InPort consumers InPortConsumerFactory& factory(InPortConsumerFactory::instance()); coil::vstring consumer_types(factory.getIdentifiers()); RTC_PARANOID(("available InPortConsumer: %s", coil::flatten(consumer_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("consumer_types") && coil::normalize(m_properties["consumer_types"]) != "all") { RTC_DEBUG(("allowed consumers: %s", m_properties["consumer_types"].c_str())); coil::vstring temp_types(consumer_types); consumer_types.clear(); coil::vstring active_types(coil::split(m_properties["consumer_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(consumer_types)); } #endif // InPortConsumer supports "push" dataflow type if (consumer_types.size() > 0) { RTC_PARANOID(("dataflow_type push is supported")); appendProperty("dataport.dataflow_type", "push"); appendProperty("dataport.interface_type", coil::flatten(consumer_types).c_str()); } m_consumerTypes = consumer_types; } /*! * @if jp * @brief シリアライザのエンディアンをチェックする * @else * @brief Checking endian flag of serializer * @endif */ bool OutPortBase::checkEndian(const coil::Properties& prop, bool& littleEndian) { // old version check if(prop.hasKey("serializer") == NULL) { littleEndian = true; return true; } // endian type check std::string endian_type(prop.getProperty("serializer.cdr.endian", "")); RTC_DEBUG(("endian_type: %s", endian_type.c_str())); coil::normalize(endian_type); std::vector<std::string> endian(coil::split(endian_type, ",")); if(endian.empty()) { return false; } if(endian[0] == "little") { littleEndian = true; return true; } else if(endian[0] == "big") { littleEndian = false; return true; } return false; } /*! * @if jp * @brief OutPort provider の生成 * @else * @brief OutPort provider creation * @endif */ OutPortProvider* OutPortBase::createProvider(ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_providerTypes, prop["interface_type"])) { RTC_ERROR(("no provider found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_providerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); OutPortProvider* provider; provider = OutPortProviderFactory:: instance().createObject(prop["interface_type"].c_str()); if (provider != 0) { RTC_TRACE(("provider created")); provider->init(prop.getNode("provider")); #ifndef ORB_IS_RTORB if (!provider->publishInterface(cprof.properties)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #else // ORB_IS_RTORB ::SDOPackage::NVList_ptr prop_ref(cprof.properties); if (!provider->publishInterface(*prop_ref)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #endif // ORB_IS_RTORB return provider; } RTC_ERROR(("provider creation failed")); return 0; } /*! * @if jp * @brief InPort consumer の生成 * @else * @brief InPort consumer creation * @endif */ InPortConsumer* OutPortBase::createConsumer(const ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_consumerTypes, prop["interface_type"])) { RTC_ERROR(("no consumer found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_consumerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); InPortConsumer* consumer; consumer = InPortConsumerFactory:: instance().createObject(prop["interface_type"].c_str()); if (consumer != 0) { RTC_TRACE(("consumer created")); consumer->init(prop.getNode("consumer")); if (!consumer->subscribeInterface(cprof.properties)) { RTC_ERROR(("interface subscription failed.")); InPortConsumerFactory::instance().deleteObject(consumer); return 0; } return consumer; } RTC_ERROR(("consumer creation failed")); return 0; } /*! * @if jp * @brief OutPortPushConnector の生成 * @else * @brief OutPortPushConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, InPortConsumer* consumer) { #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPushConnector(profile, consumer, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPushConnector created")); // endian type set connector->setEndian(m_littleEndian); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPushConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } /*! * @if jp * @brief OutPortPullConnector の生成 * @else * @brief OutPortPullConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, OutPortProvider* provider) { RTC_VERBOSE(("createConnector()")); #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPullConnector(profile, provider, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPullConnector created")); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPullConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } }; // end of namespace RTM
624  * prop["interface_type"]: インターフェースタイプ * などがアクセス可能になる。 */ std::string& dflow_type(prop["dataflow_type"]); coil::normalize(dflow_type); if (dflow_type == "push") { RTC_PARANOID(("dataflow_type is push.")); // interface InPortConsumer* consumer(createConsumer(cprof, prop)); if (consumer == 0) { return RTC::BAD_PARAMETER; } // create OutPortPushConnector OutPortConnector* connector(createConnector(cprof, prop, consumer)); if (connector == 0) { return RTC::RTC_ERROR; } RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } else if (dflow_type == "pull") { RTC_PARANOID(("dataflow_type is pull.")); // set endian type OutPortConnector* conn(getConnectorById(cprof.connector_id)); if (conn == 0) { RTC_ERROR(("specified connector not found: %s", (const char*)cprof.connector_id)); return RTC::RTC_ERROR; } conn->setEndian(littleEndian); RTC_DEBUG(("subscribeInterfaces() successfully finished.")); return RTC::RTC_OK; } RTC_ERROR(("unsupported dataflow_type: %s", dflow_type.c_str())); return RTC::BAD_PARAMETER; } /*! * @if jp * @brief 登録されているInterface情報を解除する * @else * @brief Unsubscribe interface * @endif */ void OutPortBase::unsubscribeInterfaces(const ConnectorProfile& connector_profile) { RTC_TRACE(("unsubscribeInterfaces()")); std::string id(connector_profile.connector_id); RTC_PARANOID(("connector_id: %s", id.c_str())); ConnectorList::iterator it(m_connectors.begin()); while (it != m_connectors.end()) { if (id == (*it)->id()) { // Connector's dtor must call disconnect() delete *it; m_connectors.erase(it); RTC_TRACE(("delete connector: %s", id.c_str())); return; } ++it; } RTC_ERROR(("specified connector not found: %s", id.c_str())); return; } /*! * @if jp * @brief OutPort provider の初期化 * @else * @brief OutPort provider initialization * @endif */ void OutPortBase::initProviders() { RTC_TRACE(("initProviders()")); // create OutPort providers OutPortProviderFactory& factory(OutPortProviderFactory::instance()); coil::vstring provider_types(factory.getIdentifiers()); RTC_PARANOID(("available OutPortProviders: %s", coil::flatten(provider_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("provider_types") && coil::normalize(m_properties["provider_types"]) != "all") { RTC_DEBUG(("allowed providers: %s", m_properties["provider_types"].c_str())); coil::vstring temp_types(provider_types); provider_types.clear(); coil::vstring active_types(coil::split(m_properties["provider_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(provider_types)); } #endif // OutPortProvider supports "pull" dataflow type if (provider_types.size() > 0) { RTC_DEBUG(("dataflow_type pull is supported")); appendProperty("dataport.dataflow_type", "pull"); appendProperty("dataport.interface_type", coil::flatten(provider_types).c_str()); } m_providerTypes = provider_types; } /*! * @if jp * @brief InPort consumer の初期化 * @else * @brief InPort consumer initialization * @endif */ void OutPortBase::initConsumers() { RTC_TRACE(("initConsumers()")); // create InPort consumers InPortConsumerFactory& factory(InPortConsumerFactory::instance()); coil::vstring consumer_types(factory.getIdentifiers()); RTC_PARANOID(("available InPortConsumer: %s", coil::flatten(consumer_types).c_str())); #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION if (m_properties.hasKey("consumer_types") && coil::normalize(m_properties["consumer_types"]) != "all") { RTC_DEBUG(("allowed consumers: %s", m_properties["consumer_types"].c_str())); coil::vstring temp_types(consumer_types); consumer_types.clear(); coil::vstring active_types(coil::split(m_properties["consumer_types"], ",")); std::sort(temp_types.begin(), temp_types.end()); std::sort(active_types.begin(), active_types.end()); std::set_intersection(temp_types.begin(), temp_types.end(), active_types.begin(), active_types.end(), std::back_inserter(consumer_types)); } #endif // InPortConsumer supports "push" dataflow type if (consumer_types.size() > 0) { RTC_PARANOID(("dataflow_type push is supported")); appendProperty("dataport.dataflow_type", "push"); appendProperty("dataport.interface_type", coil::flatten(consumer_types).c_str()); } m_consumerTypes = consumer_types; } /*! * @if jp * @brief シリアライザのエンディアンをチェックする * @else * @brief Checking endian flag of serializer * @endif */ bool OutPortBase::checkEndian(const coil::Properties& prop, bool& littleEndian) { // old version check if(prop.hasKey("serializer") == NULL) { littleEndian = true; return true; } // endian type check std::string endian_type(prop.getProperty("serializer.cdr.endian", "")); RTC_DEBUG(("endian_type: %s", endian_type.c_str())); coil::normalize(endian_type); std::vector<std::string> endian(coil::split(endian_type, ",")); if(endian.empty()) { return false; } if(endian[0] == "little") { littleEndian = true; return true; } else if(endian[0] == "big") { littleEndian = false; return true; } return false; } /*! * @if jp * @brief OutPort provider の生成 * @else * @brief OutPort provider creation * @endif */ OutPortProvider* OutPortBase::createProvider(ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_providerTypes, prop["interface_type"])) { RTC_ERROR(("no provider found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_providerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); OutPortProvider* provider; provider = OutPortProviderFactory:: instance().createObject(prop["interface_type"].c_str()); if (provider != 0) { RTC_TRACE(("provider created")); provider->init(prop.getNode("provider")); #ifndef ORB_IS_RTORB if (!provider->publishInterface(cprof.properties)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #else // ORB_IS_RTORB ::SDOPackage::NVList_ptr prop_ref(cprof.properties); if (!provider->publishInterface(*prop_ref)) { RTC_ERROR(("publishing interface information error")); OutPortProviderFactory::instance().deleteObject(provider); return 0; } #endif // ORB_IS_RTORB return provider; } RTC_ERROR(("provider creation failed")); return 0; } /*! * @if jp * @brief InPort consumer の生成 * @else * @brief InPort consumer creation * @endif */ InPortConsumer* OutPortBase::createConsumer(const ConnectorProfile& cprof, coil::Properties& prop) { if (!prop["interface_type"].empty() && !coil::includes((coil::vstring)m_consumerTypes, prop["interface_type"])) { RTC_ERROR(("no consumer found")); RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); RTC_DEBUG(("interface_types: %s", coil::flatten(m_consumerTypes).c_str())); return 0; } RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str())); InPortConsumer* consumer; consumer = InPortConsumerFactory:: instance().createObject(prop["interface_type"].c_str()); if (consumer != 0) { RTC_TRACE(("consumer created")); consumer->init(prop.getNode("consumer")); if (!consumer->subscribeInterface(cprof.properties)) { RTC_ERROR(("interface subscription failed.")); InPortConsumerFactory::instance().deleteObject(consumer); return 0; } return consumer; } RTC_ERROR(("consumer creation failed")); return 0; } /*! * @if jp * @brief OutPortPushConnector の生成 * @else * @brief OutPortPushConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, InPortConsumer* consumer) { #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPushConnector(profile, consumer, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPushConnector created")); // endian type set connector->setEndian(m_littleEndian); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPushConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } /*! * @if jp * @brief OutPortPullConnector の生成 * @else * @brief OutPortPullConnector creation * @endif */ OutPortConnector* OutPortBase::createConnector(const ConnectorProfile& cprof, coil::Properties& prop, OutPortProvider* provider) { RTC_VERBOSE(("createConnector()")); #ifndef ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil::refToVstring(cprof.ports), prop); #else // ORB_IS_RTORB ConnectorInfo profile(cprof.name, cprof.connector_id, CORBA_SeqUtil:: refToVstring(RTC::PortServiceList(cprof.ports)), prop); #endif // ORB_IS_RTORB OutPortConnector* connector(0); try { connector = new OutPortPullConnector(profile, provider, m_listeners); if (connector == 0) { RTC_ERROR(("old compiler? new returned 0;")); return 0; } RTC_TRACE(("OutPortPullConnector created")); m_connectors.push_back(connector); RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size())); return connector; } catch (std::bad_alloc& e) { RTC_ERROR(("OutPortPullConnector creation failed")); return 0; } RTC_FATAL(("never comes here: createConnector()")); return 0; } }; // end of namespace RTM
625  * などがアクセス可能になる。
626  */
627  std::string& dflow_type(prop["dataflow_type"]);
628  coil::normalize(dflow_type);
629 
630  if (dflow_type == "push")
631  {
632  RTC_PARANOID(("dataflow_type is push."));
633 
634  // interface
635  InPortConsumer* consumer(createConsumer(cprof, prop));
636  if (consumer == 0)
637  {
638  return RTC::BAD_PARAMETER;
639  }
640 
641  // create OutPortPushConnector
642  OutPortConnector* connector(createConnector(cprof, prop, consumer));
643  if (connector == 0)
644  {
645  return RTC::RTC_ERROR;
646  }
647 
648  RTC_DEBUG(("subscribeInterfaces() successfully finished."));
649  return RTC::RTC_OK;
650  }
651  else if (dflow_type == "pull")
652  {
653  RTC_PARANOID(("dataflow_type is pull."));
654 
655  // set endian type
656  OutPortConnector* conn(getConnectorById(cprof.connector_id));
657  if (conn == 0)
658  {
659  RTC_ERROR(("specified connector not found: %s",
660  (const char*)cprof.connector_id));
661  return RTC::RTC_ERROR;
662  }
663  conn->setEndian(littleEndian);
664  RTC_DEBUG(("subscribeInterfaces() successfully finished."));
665  return RTC::RTC_OK;
666  }
667 
668  RTC_ERROR(("unsupported dataflow_type: %s", dflow_type.c_str()));
669  return RTC::BAD_PARAMETER;
670  }
671 
679  void
680  OutPortBase::unsubscribeInterfaces(const ConnectorProfile& connector_profile)
681  {
682  RTC_TRACE(("unsubscribeInterfaces()"));
683 
684  std::string id(connector_profile.connector_id);
685  RTC_PARANOID(("connector_id: %s", id.c_str()));
686 
687  ConnectorList::iterator it(m_connectors.begin());
688 
689  while (it != m_connectors.end())
690  {
691  if (id == (*it)->id())
692  {
693  // Connector's dtor must call disconnect()
694  delete *it;
695  m_connectors.erase(it);
696  RTC_TRACE(("delete connector: %s", id.c_str()));
697  return;
698  }
699  ++it;
700  }
701  RTC_ERROR(("specified connector not found: %s", id.c_str()));
702  return;
703  }
704 
713  {
714  RTC_TRACE(("initProviders()"));
715 
716  // create OutPort providers
718  coil::vstring provider_types(factory.getIdentifiers());
719  RTC_PARANOID(("available OutPortProviders: %s",
720  coil::flatten(provider_types).c_str()));
721 
722 #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION
723  if (m_properties.hasKey("provider_types") &&
724  coil::normalize(m_properties["provider_types"]) != "all")
725  {
726  RTC_DEBUG(("allowed providers: %s",
727  m_properties["provider_types"].c_str()));
728 
729  coil::vstring temp_types(provider_types);
730  provider_types.clear();
732  active_types(coil::split(m_properties["provider_types"], ","));
733 
734  std::sort(temp_types.begin(), temp_types.end());
735  std::sort(active_types.begin(), active_types.end());
736  std::set_intersection(temp_types.begin(), temp_types.end(),
737  active_types.begin(), active_types.end(),
738  std::back_inserter(provider_types));
739  }
740 #endif
741 
742  // OutPortProvider supports "pull" dataflow type
743  if (provider_types.size() > 0)
744  {
745  RTC_DEBUG(("dataflow_type pull is supported"));
746  appendProperty("dataport.dataflow_type", "pull");
747  appendProperty("dataport.interface_type",
748  coil::flatten(provider_types).c_str());
749  }
750 
751  m_providerTypes = provider_types;
752  }
753 
762  {
763  RTC_TRACE(("initConsumers()"));
764 
765  // create InPort consumers
767  coil::vstring consumer_types(factory.getIdentifiers());
768  RTC_PARANOID(("available InPortConsumer: %s",
769  coil::flatten(consumer_types).c_str()));
770 
771 #ifndef RTC_NO_DATAPORTIF_ACTIVATION_OPTION
772  if (m_properties.hasKey("consumer_types") &&
773  coil::normalize(m_properties["consumer_types"]) != "all")
774  {
775  RTC_DEBUG(("allowed consumers: %s",
776  m_properties["consumer_types"].c_str()));
777 
778  coil::vstring temp_types(consumer_types);
779  consumer_types.clear();
781  active_types(coil::split(m_properties["consumer_types"], ","));
782 
783  std::sort(temp_types.begin(), temp_types.end());
784  std::sort(active_types.begin(), active_types.end());
785  std::set_intersection(temp_types.begin(), temp_types.end(),
786  active_types.begin(), active_types.end(),
787  std::back_inserter(consumer_types));
788  }
789 #endif
790 
791  // InPortConsumer supports "push" dataflow type
792  if (consumer_types.size() > 0)
793  {
794  RTC_PARANOID(("dataflow_type push is supported"));
795  appendProperty("dataport.dataflow_type", "push");
796  appendProperty("dataport.interface_type",
797  coil::flatten(consumer_types).c_str());
798  }
799 
800  m_consumerTypes = consumer_types;
801  }
802 
811  bool& littleEndian)
812  {
813  // old version check
814  if(prop.hasKey("serializer") == NULL)
815  {
816  littleEndian = true;
817  return true;
818  }
819 
820  // endian type check
821  std::string endian_type(prop.getProperty("serializer.cdr.endian", ""));
822  RTC_DEBUG(("endian_type: %s", endian_type.c_str()));
823  coil::normalize(endian_type);
824  std::vector<std::string> endian(coil::split(endian_type, ","));
825 
826  if(endian.empty()) { return false; }
827  if(endian[0] == "little")
828  {
829  littleEndian = true;
830  return true;
831  }
832  else if(endian[0] == "big")
833  {
834  littleEndian = false;
835  return true;
836  }
837  return false;
838  }
839 
849  {
850  if (!prop["interface_type"].empty() &&
851  !coil::includes((coil::vstring)m_providerTypes, prop["interface_type"]))
852  {
853  RTC_ERROR(("no provider found"));
854  RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str()));
855  RTC_DEBUG(("interface_types: %s",
856  coil::flatten(m_providerTypes).c_str()));
857  return 0;
858  }
859 
860  RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str()));
862  provider = OutPortProviderFactory::
863  instance().createObject(prop["interface_type"].c_str());
864 
865  if (provider != 0)
866  {
867  RTC_TRACE(("provider created"));
868  provider->init(prop.getNode("provider"));
869 
870 #ifndef ORB_IS_RTORB
871  if (!provider->publishInterface(cprof.properties))
872  {
873  RTC_ERROR(("publishing interface information error"));
874  OutPortProviderFactory::instance().deleteObject(provider);
875  return 0;
876  }
877 #else // ORB_IS_RTORB
878  ::SDOPackage::NVList_ptr prop_ref(cprof.properties);
879  if (!provider->publishInterface(*prop_ref))
880  {
881  RTC_ERROR(("publishing interface information error"));
882  OutPortProviderFactory::instance().deleteObject(provider);
883  return 0;
884  }
885 #endif // ORB_IS_RTORB
886  return provider;
887  }
888 
889  RTC_ERROR(("provider creation failed"));
890  return 0;
891  }
892 
893 
901  InPortConsumer* OutPortBase::createConsumer(const ConnectorProfile& cprof,
903  {
904  if (!prop["interface_type"].empty() &&
905  !coil::includes((coil::vstring)m_consumerTypes, prop["interface_type"]))
906  {
907  RTC_ERROR(("no consumer found"));
908  RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str()));
909  RTC_DEBUG(("interface_types: %s",
910  coil::flatten(m_consumerTypes).c_str()));
911  return 0;
912  }
913 
914  RTC_DEBUG(("interface_type: %s", prop["interface_type"].c_str()));
915  InPortConsumer* consumer;
916  consumer = InPortConsumerFactory::
917  instance().createObject(prop["interface_type"].c_str());
918 
919  if (consumer != 0)
920  {
921  RTC_TRACE(("consumer created"));
922  consumer->init(prop.getNode("consumer"));
923 
924  if (!consumer->subscribeInterface(cprof.properties))
925  {
926  RTC_ERROR(("interface subscription failed."));
927  InPortConsumerFactory::instance().deleteObject(consumer);
928  return 0;
929  }
930 
931  return consumer;
932  }
933 
934  RTC_ERROR(("consumer creation failed"));
935  return 0;
936  }
937 
946  OutPortBase::createConnector(const ConnectorProfile& cprof,
948  InPortConsumer* consumer)
949  {
950 #ifndef ORB_IS_RTORB
951  ConnectorInfo profile(cprof.name,
952  cprof.connector_id,
953  CORBA_SeqUtil::refToVstring(cprof.ports),
954  prop);
955 #else // ORB_IS_RTORB
956  ConnectorInfo profile(cprof.name,
957  cprof.connector_id,
958  CORBA_SeqUtil::
959  refToVstring(RTC::PortServiceList(cprof.ports)),
960  prop);
961 #endif // ORB_IS_RTORB
962 
963  OutPortConnector* connector(0);
964  try
965  {
966  connector = new OutPortPushConnector(profile, consumer, m_listeners);
967 
968  if (connector == 0)
969  {
970  RTC_ERROR(("old compiler? new returned 0;"));
971  return 0;
972  }
973  RTC_TRACE(("OutPortPushConnector created"));
974 
975  // endian type set
976  connector->setEndian(m_littleEndian);
977  m_connectors.push_back(connector);
978  RTC_PARANOID(("connector pushback done: size = %d",
979  m_connectors.size()));
980  return connector;
981  }
982  catch (std::bad_alloc& e)
983  {
984  RTC_ERROR(("OutPortPushConnector creation failed"));
985  return 0;
986  }
987  RTC_FATAL(("never comes here: createConnector()"));
988  return 0;
989  }
990 
999  OutPortBase::createConnector(const ConnectorProfile& cprof,
1002  {
1003  RTC_VERBOSE(("createConnector()"));
1004 #ifndef ORB_IS_RTORB
1005  ConnectorInfo profile(cprof.name,
1006  cprof.connector_id,
1007  CORBA_SeqUtil::refToVstring(cprof.ports),
1008  prop);
1009 #else // ORB_IS_RTORB
1010  ConnectorInfo profile(cprof.name,
1011  cprof.connector_id,
1012  CORBA_SeqUtil::
1013  refToVstring(RTC::PortServiceList(cprof.ports)),
1014  prop);
1015 #endif // ORB_IS_RTORB
1016 
1017  OutPortConnector* connector(0);
1018  try
1019  {
1020  connector = new OutPortPullConnector(profile, provider, m_listeners);
1021 
1022  if (connector == 0)
1023  {
1024  RTC_ERROR(("old compiler? new returned 0;"));
1025  return 0;
1026  }
1027  RTC_TRACE(("OutPortPullConnector created"));
1028 
1029  m_connectors.push_back(connector);
1030  RTC_PARANOID(("connector pushback done: size = %d", m_connectors.size()));
1031  return connector;
1032  }
1033  catch (std::bad_alloc& e)
1034  {
1035  RTC_ERROR(("OutPortPullConnector creation failed"));
1036  return 0;
1037  }
1038  RTC_FATAL(("never comes here: createConnector()"));
1039  return 0;
1040  }
1041 
1042 }; // end of namespace RTM
SDOPackage::NameValue newNV(const char *name, Value value)
Create NameValue.
Definition: NVUtil.h:79
void removeListener(ConnectorListener *listener)
Remove the listener.
OutPortConnector * getConnectorById(const char *id)
Getting ConnectorProfile by ID.
void configure()
Configureing outport.
InPortConsumer abstract class.
#define RTC_ERROR(fmt)
Error log output macro.
Definition: SystemLogger.h:422
virtual ~OutPortBase(void)
Destructor.
void initProviders()
OutPort provider initialization.
std::string normalize(std::string &str)
Erase the head/tail blank and replace upper case to lower case.
Definition: stringutil.cpp:308
ConnectorInfoList getConnectorProfiles()
ConnectorProfile list.
void addConnectorDataListener(ConnectorDataListenerType listener_type, ConnectorDataListener *listener, bool autoclean=true)
Adding BufferDataListener type listener.
virtual void init(coil::Properties &prop)=0
Initializing configuration.
coil::vstring getConnectorNames()
Connector name list.
RT-Component.
coil::vstring getConnectorIds()
ConnectorId list.
OutPortConnector * getConnectorByName(const char *name)
Getting Connector by name.
std::vector< OutPortConnector * > m_connectors
Connection list.
Definition: OutPortBase.h:1032
void initConsumers()
InPort consumer initialization.
bool stringTo(To &val, const char *str)
Convert the given std::string to object.
Definition: stringutil.h:597
ConnectorDataListener class.
void addConnectorListener(ConnectorListenerType callback_type, ConnectorListener *listener, bool autoclean=true)
Adding ConnectorListener type listener.
ReturnCode_t
Definition: doil.h:53
void addListener(ConnectorDataListener *listener, bool autoclean)
Add the listener.
std::vector< std::pair< std::string, std::string > > NVList
Definition: IRTC.h:67
ConnectorListenerHolder connector_[CONNECTOR_LISTENER_NUM]
ConnectorListenerType listener array The ConnectorListenerType listener is stored.
virtual void setConnector(OutPortConnector *connector)=0
set Connector
void removeListener(ConnectorDataListener *listener)
Remove the listener.
coil::Properties m_properties
Properties.
Definition: OutPortBase.h:1024
void eraseBlank(std::string &str)
Erase blank characters of string.
Definition: stringutil.cpp:242
void removeConnectorListener(ConnectorListenerType callback_type, ConnectorListener *listener)
Removing BufferDataListener type listener.
virtual void setEndian(const bool endian_type)
Setting an endian type.
ConnectorListeners m_listeners
ConnectorDataListener listener.
Definition: OutPortBase.h:1064
virtual ReturnCode_t connect(ConnectorProfile &connector_profile)
[CORBA interface] Connect the Port
Definition: PortBase.cpp:181
vstring split(const std::string &input, const std::string &delimiter, bool ignore_empty)
Split string by delimiter.
Definition: stringutil.cpp:346
virtual void unsubscribeInterfaces(const ConnectorProfile &connector_profile)
Disconnect the interface connection.
std::vector< ConnectorInfo > ConnectorInfoList
void addListener(ConnectorListener *listener, bool autoclean)
Add the listener.
static GlobalFactory< AbstractClass, Identifier, Compare, Creator, Destructor > & instance()
Create instance.
Definition: Singleton.h:131
bool isLittleEndian()
return it whether endian setting.
GlobalFactory template class.
OutPortConnector * createConnector(const ConnectorProfile &cprof, coil::Properties &prop, InPortConsumer *consumer)
OutPortPushConnector creation.
void operator()(OutPortConnector *c)
Definition: OutPortBase.cpp:67
virtual ReturnCode_t publishInterfaces(ConnectorProfile &connector_profile)
Publish interface information.
#define RTC_WARN(fmt)
Warning log output macro.
Definition: SystemLogger.h:444
Properties * hasKey(const char *key) const
Check whether key exists in the children.
Definition: Properties.cpp:522
#define RTC_FATAL(fmt)
Error log output macro.
Definition: SystemLogger.h:400
#define RTC_DEBUG_STR(str)
Definition: SystemLogger.h:489
#define RTC_PARANOID(fmt)
Paranoid level log output macro.
Definition: SystemLogger.h:555
std::vector< Identifier > getIdentifiers()
Get factory ID list.
std::vector< std::string > vstring
Definition: stringutil.h:37
ConnectorDataListenerType
The types of ConnectorDataListener.
const CORBA::Long find_index(const SDOPackage::NVList &nv, const char *name)
Return the index of element specified by name from NVList.
Definition: NVUtil.cpp:227
static const char * toString(ConnectorListenerType type)
Convert ConnectorListenerType into the string.
Connector base class.
void removeConnectorDataListener(ConnectorDataListenerType listener_type, ConnectorDataListener *listener)
Removing BufferDataListener type listener.
ConnectorDataListenerHolder connectorData_[CONNECTOR_DATA_LISTENER_NUM]
ConnectorDataListenerType listener array The ConnectorDataListenerType listener is stored...
void appendProperty(const char *key, const char *value)
Append NameValue data to PortProfile&#39;s properties.
Definition: PortBase.h:1907
#define RTC_DEBUG(fmt)
Debug level log output macro.
Definition: SystemLogger.h:488
const std::string & getProperty(const std::string &key) const
Search for the property with the specified key in this property.
Definition: Properties.cpp:160
std::string flatten(vstring sv)
Create CSV file from the given string list.
Definition: stringutil.cpp:554
void copyToProperties(coil::Properties &prop, const SDOPackage::NVList &nv)
Copy NVList to the Proeprties.
Definition: NVUtil.cpp:137
#define RTC_TRACE(fmt)
bool getConnectorProfileById(const char *id, ConnectorInfo &prof)
Getting ConnectorProfile by name.
list index
Definition: rtimages.py:10
Push type connector class.
void deleteObject(const Identifier &id, AbstractClass *&obj)
Delete factory object.
bool m_littleEndian
Connected Endian.
Definition: OutPortBase.h:1056
OutPortBase(const char *name, const char *data_type)
Constructor.
Definition: OutPortBase.cpp:81
void init(coil::Properties &prop)
Initializing properties.
virtual ReturnCode_t connect(ConnectorProfile &connector_profile)
[CORBA interface] Connect the Port
OutPortProvider * createProvider(ConnectorProfile &cprof, coil::Properties &prop)
OutPort provider creation.
coil::vstring m_consumerTypes
Available consumers.
Definition: OutPortBase.h:1048
prop
Organization::get_organization_property ();.
Publisher base class.
InPortBase base class.
PortProfile m_profile
PortProfile of the Port.
Definition: PortBase.h:2070
virtual void init(coil::Properties &prop)
Initializing configuration.
ConnectorListenerType
The types of ConnectorListener.
Functor to delete Providers.
Definition: OutPortBase.cpp:42
Class represents a set of properties.
Definition: Properties.h:101
static const char * toString(ConnectorDataListenerType type)
Convert ConnectorDataListenerType into the string.
bool checkEndian(const coil::Properties &prop, bool &littleEndian)
Checking endian flag of serializer.
std::vector< IPortService * > PortServiceList
Definition: IPortService.h:39
OutPortPull type connector class.
virtual void activateInterfaces()
Activate all Port interfaces.
bool getConnectorProfileByName(const char *name, ConnectorInfo &prof)
Getting ConnectorProfile by name.
coil::vstring m_providerTypes
Available providers.
Definition: OutPortBase.h:1040
virtual bool publishInterface(SDOPackage::NVList &properties)
Publish interface information.
void operator()(OutPortProvider *p)
Definition: OutPortBase.cpp:48
void push_back_list(CorbaSequence &seq1, const CorbaSequence &seq2)
Merge the elements of the CORBA sequence.
void push_back(CorbaSequence &seq, SequenceElement elem)
Push the new element back to the CORBA sequence.
void copyFromProperties(SDOPackage::NVList &nv, const coil::Properties &prop)
Copy the properties to NVList.
Definition: NVUtil.cpp:108
Functor to delete Connectors.
Definition: OutPortBase.cpp:62
virtual ReturnCode_t subscribeInterfaces(const ConnectorProfile &connector_profile)
Subscribe to the interface.
Properties & getNode(const std::string &key)
Get node of properties.
Definition: Properties.cpp:460
const std::vector< OutPortConnector * > & connectors()
Connector list.
bool includes(const vstring &list, std::string value, bool ignore_case)
Include if a string is included in string list.
Definition: stringutil.cpp:437
InPortConsumer * createConsumer(const ConnectorProfile &cprof, coil::Properties &prop)
InPort consumer creation.
coil::vstring refToVstring(const CorbaRefSequence &objlist)
void addProperty(const char *key, ValueType value)
Add NameValue data to PortProfile&#39;s properties.
Definition: PortBase.h:1876
CORBA IOR helper functions.
virtual void deactivateInterfaces()
Deactivate all Port interfaces.
#define RTC_VERBOSE(fmt)
Verbose level log output macro.
Definition: SystemLogger.h:533
Functor for_each(CorbaSequence &seq, Functor f)
Apply the functor to all CORBA sequence elements.
Definition: CORBA_SeqUtil.h:98
const ConnectorInfo & profile()
Getting Profile.
#define RTC_PARANOID_STR(str)
Definition: SystemLogger.h:556
virtual ReturnCode_t _publishInterfaces(void)
Publish interface information.
Definition: PortBase.cpp:315
OutPortProviderFactory & m_factory
Definition: OutPortBase.cpp:52
virtual void setConnectionLimit(int limit_value)
Set the maximum number of connections.
Definition: PortBase.cpp:700
virtual bool subscribeInterface(const SDOPackage::NVList &properties)=0
Subscribe the data send notification.
coil::Properties & properties()
Get properties.


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