From 2f343847567151d4bd7249215d2aba230c9ba75d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 15 Dec 2015 19:56:52 +0100 Subject: [PATCH] corba: moved CORBA_PORTS_DISABLE_SIGNAL checks from headers to implementation Signed-off-by: Johannes Meyer --- rtt/transports/corba/CorbaLib.cpp | 2 +- rtt/transports/corba/CorbaTemplateProtocol.hpp | 4 ++-- rtt/transports/corba/CorbaTypeTransporter.hpp | 2 +- rtt/transports/corba/DataFlowI.cpp | 14 ++++++++++++-- rtt/transports/corba/RemoteChannelElement.hpp | 14 ++++++++++---- rtt/transports/corba/RemotePorts.cpp | 7 ++++++- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/rtt/transports/corba/CorbaLib.cpp b/rtt/transports/corba/CorbaLib.cpp index ecd496776..12effc981 100644 --- a/rtt/transports/corba/CorbaLib.cpp +++ b/rtt/transports/corba/CorbaLib.cpp @@ -115,7 +115,7 @@ namespace RTT { virtual base::ChannelElementBase* buildDataStorage(ConnPolicy const& policy) const { return 0; } - virtual CRemoteChannelElement_i* createChannelElement_i(DataFlowInterface*, ::PortableServer::POA* poa, bool) const { + virtual CRemoteChannelElement_i* createChannelElement_i(DataFlowInterface*, ::PortableServer::POA* poa, bool, bool) const { Logger::In in("CorbaFallBackProtocol"); log(Error) << "Could create Channel : data type not known to CORBA Transport." <::DataSourceType PropertyType; - CRemoteChannelElement_i* createChannelElement_i(DataFlowInterface* sender,PortableServer::POA_ptr poa, bool is_pull) const - { return new RemoteChannelElement(*this, sender, poa, is_pull); } + CRemoteChannelElement_i* createChannelElement_i(DataFlowInterface* sender,PortableServer::POA_ptr poa, bool is_pull, bool is_signalling) const + { return new RemoteChannelElement(*this, sender, poa, is_pull, is_signalling); } /** * Create an transportable object for a \a protocol which contains the value of \a source. diff --git a/rtt/transports/corba/CorbaTypeTransporter.hpp b/rtt/transports/corba/CorbaTypeTransporter.hpp index 0e0e49741..7674bcb2f 100644 --- a/rtt/transports/corba/CorbaTypeTransporter.hpp +++ b/rtt/transports/corba/CorbaTypeTransporter.hpp @@ -83,7 +83,7 @@ namespace RTT { * @param poa The POA to manage the server code. * @return the created CChannelElement_i. */ - virtual CRemoteChannelElement_i* createChannelElement_i(DataFlowInterface* sender, ::PortableServer::POA* poa, bool is_pull) const = 0; + virtual CRemoteChannelElement_i* createChannelElement_i(DataFlowInterface* sender, ::PortableServer::POA* poa, bool is_pull, bool is_signalling) const = 0; /** * The CORBA transport does not support creating 'CORBA' streams. diff --git a/rtt/transports/corba/DataFlowI.cpp b/rtt/transports/corba/DataFlowI.cpp index 478e8dee8..aaa2d7dd0 100644 --- a/rtt/transports/corba/DataFlowI.cpp +++ b/rtt/transports/corba/DataFlowI.cpp @@ -392,8 +392,13 @@ CChannelElement_ptr CDataFlowInterface_i::buildChannelOutput( ConnPolicy policy2 = toRTT(corba_policy); ChannelElementBase::shared_ptr end = type_info->buildChannelOutput(*port); +#ifndef CORBA_PORTS_DISABLE_SIGNAL + bool is_signalling = true; +#else + bool is_signalling = false; +#endif CRemoteChannelElement_i* this_element = - transporter->createChannelElement_i(mdf, mpoa, corba_policy.pull); + transporter->createChannelElement_i(mdf, mpoa, corba_policy.pull, is_signalling); this_element->setCDataFlowInterface(this); /* @@ -480,7 +485,12 @@ CChannelElement_ptr CDataFlowInterface_i::buildChannelInput( // The channel element that exposes our channel in CORBA CRemoteChannelElement_i* this_element; - PortableServer::ServantBase_var servant = this_element = transporter->createChannelElement_i(mdf, mpoa, corba_policy.pull); +#ifndef CORBA_PORTS_DISABLE_SIGNAL + bool is_signalling = true; +#else + bool is_signalling = false; +#endif + PortableServer::ServantBase_var servant = this_element = transporter->createChannelElement_i(mdf, mpoa, corba_policy.pull, is_signalling); this_element->setCDataFlowInterface(this); // Attach the corba channel element first (so OOB is after corba). diff --git a/rtt/transports/corba/RemoteChannelElement.hpp b/rtt/transports/corba/RemoteChannelElement.hpp index 683f44a6a..9de0337f7 100644 --- a/rtt/transports/corba/RemoteChannelElement.hpp +++ b/rtt/transports/corba/RemoteChannelElement.hpp @@ -73,16 +73,22 @@ namespace RTT { PortableServer::ObjectId_var oid; + /** + * If signalling is false, no remoteSignal() calls will be forwarded to remote channel elements. + */ + bool signalling; + public: /** * Create a channel element for remote data exchange. * @param transport The type specific object that will be used to marshal the data. * @param poa The POA that manages the underlying CRemoteChannelElement_i. */ - RemoteChannelElement(CorbaTypeTransporter const& transport, DataFlowInterface* sender, PortableServer::POA_ptr poa, bool is_pull) + RemoteChannelElement(CorbaTypeTransporter const& transport, DataFlowInterface* sender, PortableServer::POA_ptr poa, bool is_pull, bool is_signalling) : CRemoteChannelElement_i(transport, poa) , valid(true), pull(is_pull) , msender(sender) + , signalling(is_signalling) { // Big note about cleanup: The RTT will dispose this object through // the ChannelElement refcounting. So we only need to inform the @@ -138,9 +144,9 @@ namespace RTT { if ( pull ) { try { -#ifndef CORBA_PORTS_DISABLE_SIGNAL - remote_side->remoteSignal(); -#endif + if (signalling) { + remote_side->remoteSignal(); + } } #ifdef CORBA_IS_OMNIORB catch(CORBA::SystemException& e) diff --git a/rtt/transports/corba/RemotePorts.cpp b/rtt/transports/corba/RemotePorts.cpp index d188c4641..323a5170a 100644 --- a/rtt/transports/corba/RemotePorts.cpp +++ b/rtt/transports/corba/RemotePorts.cpp @@ -148,9 +148,14 @@ RTT::base::ChannelElementBase::shared_ptr RemoteInputPort::buildRemoteChannelOut // Input side is now ok and waiting for us to complete. We build our corba channel element too // and connect it to the remote side and vice versa. +#ifndef CORBA_PORTS_DISABLE_SIGNAL + bool is_signalling = true; +#else + bool is_signalling = false; +#endif CRemoteChannelElement_i* local = static_cast(type->getProtocol(ORO_CORBA_PROTOCOL_ID)) - ->createChannelElement_i(output_port.getInterface(), mpoa, policy.pull); + ->createChannelElement_i(output_port.getInterface(), mpoa, policy.pull, is_signalling); CRemoteChannelElement_var proxy = local->_this(); local->setRemoteSide(remote);