mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
node: add connect() with reverse path
This commit is contained in:
parent
6c225c8fae
commit
c5e3d3dd4a
1 changed files with 15 additions and 2 deletions
|
@ -105,10 +105,23 @@ public:
|
|||
getSlavePort(const std::string &name) const
|
||||
{ return *portsSlave.at(name); }
|
||||
|
||||
bool connect(const StreamVertex &from, const StreamVertex &to);
|
||||
bool connect(const StreamVertex &from, const StreamVertex &to, bool reverse)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
ret = connect(from, to);
|
||||
|
||||
if (reverse)
|
||||
ret &= connect(to, from);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// easy-usage assuming that the slave IP to connect to only has one slave
|
||||
// port and implements the getDefaultSlavePort() function
|
||||
bool connect(const Node& slaveNode)
|
||||
{ return this->connect(this->getDefaultMasterPort(), slaveNode.getDefaultSlavePort()); }
|
||||
bool connect(const Node &slaveNode, bool reverse = false)
|
||||
{ return this->connect(this->getDefaultMasterPort(), slaveNode.getDefaultSlavePort(), reverse); }
|
||||
|
||||
// used by easy-usage connect, will throw if not implemented by derived node
|
||||
virtual const StreamVertex&
|
||||
|
|
Loading…
Add table
Reference in a new issue