46 using namespace detail;
60 if ( !
chkPtr(
"addPort",
"PortInterface", &port) )
return port;
67 log(
Warning) <<
"'addPort' "<< port.
getName() <<
": name already in use as Service. Replacing previous service with new one." <<
endlog();
72 log(
Warning) <<
"'addPort' "<< port.
getName() <<
": DataFlowInterface not given to parent. Not adding Service." <<
endlog();
83 for ( Ports::iterator it(
mports.begin());
86 if ( (*it)->getName() == port.
getName() ) {
87 log(
Warning) <<
"'addPort' "<< port.
getName() <<
": name already in use. Disconnecting and replacing previous port with new one." <<
endlog();
98 if ( !
chkPtr(
"addEventPort",
"PortInterface", &port) )
return port;
105 log(
Warning) <<
"'addPort' "<< port.
getName() <<
": name already in use as Service. Replacing previous service with new one." <<
endlog();
110 log(
Warning) <<
"'addPort' "<< port.
getName() <<
": DataFlowInterface not given to parent. Not adding Service." <<
endlog();
119 #ifdef ORO_SIGNALLING_PORTS 120 void DataFlowInterface::setupHandles() {
121 for_each(handles.begin(), handles.end(), boost::bind(&
Handle::connect, _1));
124 void DataFlowInterface::cleanupHandles() {
139 log(
Error) <<
"addLocalEventPort "<< port.
getName() <<
": DataFlowInterface not part of a TaskContext. Will not trigger any TaskContext nor register callback." <<
endlog();
143 #ifdef ORO_SIGNALLING_PORTS 148 handles.push_back(h);
159 #ifndef ORO_SIGNALLING_PORTS 166 for ( Ports::iterator it(
mports.begin());
169 if ( (*it)->getName() == name ) {
180 (*it)->setInterface(0);
187 for ( Ports::iterator it(
mports.begin());
190 if ( (*it)->getName() == name ) {
192 (*it)->setInterface(0);
203 std::vector<std::string> res;
204 for ( Ports::const_iterator it(
mports.begin());
207 res.push_back( (*it)->getName() );
212 for ( Ports::const_iterator it(
mports.begin());
215 if ( (*it)->getName() == name )
221 for ( Ports::const_iterator it(
mports.begin());
224 if ( (*it)->getName() == name )
225 return (*it)->getDescription();
232 srv->doc(description);
248 to->
doc(
"No description set for this Port. Use .doc() to document it.");
256 for ( Ports::iterator it(
mports.begin());
268 log(
Error) <<
"You tried to add a null pointer in '"<< where <<
"' for the object '" << name <<
"'. Fix your code !"<<
endlog();
const std::string & getName() const
base::PortInterface & addPort(const std::string &name, base::PortInterface &port)
void removeLocalPort(const std::string &name)
TaskContext * getOwner() const
Service::shared_ptr provides()
PortNames getPortNames() const
virtual void removeService(std::string const &service_name)
base::PortInterface & addLocalPort(base::PortInterface &port)
const std::string & getName() const
shared_ptr getService(const std::string &service_name)
std::string getPortDescription(const std::string &name) const
base::InputPortInterface & addEventPort(const std::string &name, base::InputPortInterface &port, SlotFunction callback=SlotFunction())
void dataOnPort(base::PortInterface *port)
void setDataOnPortCallback(base::InputPortInterface *port, SlotFunction callback)
base::InputPortInterface & addLocalEventPort(base::InputPortInterface &port, SlotFunction callback=SlotFunction())
boost::shared_ptr< Service > shared_ptr
base::PortInterface * getPort(const std::string &name) const
void removePort(const std::string &name)
virtual Service * createPortObject()
const std::string & doc() const
virtual bool addService(shared_ptr obj)
boost::function< void(base::PortInterface *)> SlotFunction
bool hasService(const std::string &service_name)
std::vector< base::PortInterface * > Ports
bool setPortDescription(const std::string &name, const std::string description)
std::vector< std::string > PortNames
void setInterface(DataFlowInterface *iface)
bool chkPtr(const std::string &where, const std::string &name, const void *ptr)
void dataOnPort(base::PortInterface *port)
void removeDataOnPortCallback(base::PortInterface *port)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
DataFlowInterface(Service *parent=0)
The Handle holds the information, and allows manipulation, of a connection between a internal::Signal...
static Logger::LogFunction endlog()
TaskContext * getOwner() const
Service * createPortObject(const std::string &name)