[openrtm-commit:02200] r2824 - branches/FSM4RTC/OpenRTM-aist/src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 1月 10日 (火) 11:11:15 JST
Author: n-ando
Date: 2017-01-10 11:11:15 +0900 (Tue, 10 Jan 2017)
New Revision: 2824
Modified:
branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/OutPortBase.cpp
branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp
branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp
branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp
Log:
[FSM4RTC,compat,new prop] PortProfile/ConnectorProfile "dataport.io_mode" has been added. refs #3688
Modified: branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/OutPortBase.cpp
===================================================================
--- branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/OutPortBase.cpp 2017-01-10 00:49:21 UTC (rev 2823)
+++ branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/OutPortBase.cpp 2017-01-10 02:11:15 UTC (rev 2824)
@@ -96,6 +96,9 @@
coil::eraseBlank(pubs);
RTC_DEBUG(("available subscription_type: %s", pubs.c_str()));
addProperty("dataport.subscription_type", pubs.c_str());
+ // FSM4RTC formal/16-04-01 p.25
+ // In the FSM4RTC specification, publisher type is defined as "io_mode"
+ addProperty("dataport.io_mode", pubs.c_str());
};
Modified: branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp
===================================================================
--- branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2017-01-10 00:49:21 UTC (rev 2823)
+++ branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2017-01-10 02:11:15 UTC (rev 2824)
@@ -187,8 +187,14 @@
PublisherBase* OutPortPushConnector::createPublisher(ConnectorInfo& info)
{
std::string pub_type;
- pub_type = info.properties.getProperty("subscription_type",
- "flush");
+ pub_type = info.properties.getProperty("io_mode");
+ if (pub_type.empty())
+ {
+ pub_type = info.properties.getProperty("subscription_type", "flush");
+ if (pub_type == "flush") { info.properties["io_mode"] = "block"; }
+ else if (pub_type == "new") { info.properties["io_mode"] = "nonblock"; }
+ else { info.properties["io_mode"] = pub_type; }
+ }
coil::normalize(pub_type);
return PublisherFactory::instance().createObject(pub_type);
}
Modified: branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp
===================================================================
--- branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp 2017-01-10 00:49:21 UTC (rev 2823)
+++ branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp 2017-01-10 02:11:15 UTC (rev 2824)
@@ -231,6 +231,15 @@
::RTC::PublisherFlush>,
::coil::Destructor< ::RTC::PublisherBase,
::RTC::PublisherFlush>);
+ // FSM4RTC formal/16-04-01 p.25
+ // In the FSM4RTC specification, publisher type is defined as "io_mode"
+ // Publisher "flush" is functionally equals to "io_mode: block".
+ ::RTC::PublisherFactory::
+ instance().addFactory("block",
+ ::coil::Creator< ::RTC::PublisherBase,
+ ::RTC::PublisherFlush>,
+ ::coil::Destructor< ::RTC::PublisherBase,
+ ::RTC::PublisherFlush>);
}
};
Modified: branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp
===================================================================
--- branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp 2017-01-10 00:49:21 UTC (rev 2823)
+++ branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp 2017-01-10 02:11:15 UTC (rev 2824)
@@ -584,5 +584,14 @@
::RTC::PublisherNew>,
::coil::Destructor< ::RTC::PublisherBase,
::RTC::PublisherNew>);
+ // FSM4RTC formal/16-04-01 p.25
+ // In the FSM4RTC specification, publisher type is defined as "io_mode"
+ // Publisher "new" is functionally equals to "io_mode: nonblock".
+ ::RTC::PublisherFactory::
+ instance().addFactory("nonblock",
+ ::coil::Creator< ::RTC::PublisherBase,
+ ::RTC::PublisherNew>,
+ ::coil::Destructor< ::RTC::PublisherBase,
+ ::RTC::PublisherNew>);
}
};
More information about the openrtm-commit
mailing list