39 #ifndef CORBA_REMOTE_CHANNEL_ELEMENT_H 40 #define CORBA_REMOTE_CHANNEL_ELEMENT_H 72 PortableServer::ObjectId_var oid;
96 oid =
mpoa->activate_object(
this);
119 CORBA::SystemException
146 #ifndef RTT_CORBA_PORTS_DISABLE_SIGNAL 150 #ifdef CORBA_IS_OMNIORB 151 catch(CORBA::SystemException& e)
153 log(
Error) <<
"caught CORBA exception while signalling our remote endpoint: " << e._name() <<
" " << e.NP_minorString() << endlog();
157 catch(CORBA::Exception& e)
159 log(
Error) <<
"caught CORBA exception while signalling our remote endpoint: " << e._name() << endlog();
167 while ( this->
read(sample,
false) ==
NewData && valid) {
185 catch(CORBA::Exception&) {}
188 catch(CORBA::Exception&) {}
195 CORBA::SystemException
208 mpoa->deactivate_object(oid);
210 catch(CORBA::Exception&) {}
215 bool success =
false;
223 catch(CORBA::Exception&) {}
234 mpoa->deactivate_object(oid);
236 catch(CORBA::Exception&) {}
259 CORBA::Any_var remote_value;
266 ref_data_source.
ref();
274 #ifdef CORBA_IS_OMNIORB 275 catch(CORBA::SystemException& e)
277 log(
Error) <<
"caught CORBA exception while reading a remote channel: " << e._name() <<
" " << e.NP_minorString() << endlog();
282 catch(CORBA::Exception& e)
284 log(
Error) <<
"caught CORBA exception while reading a remote channel: " << e._name() << endlog();
294 CORBA::SystemException
300 value_data_source.
ref();
308 log(
Error) <<
"CORBA Transport failed to create Any for " << value_data_source.
getTypeName() <<
" while it should have!" <<endlog();
311 sample =
new CORBA::Any();
330 assert(
remote_side.in() != 0 &&
"Got write() without remote side. Need buffer OR remote side but neither was present.");
335 CORBA::Any write_any;
340 const_ref_data_source.
ref();
346 #ifndef RTT_CORBA_PORTS_WRITE_ONEWAY 354 #ifdef CORBA_IS_OMNIORB 355 catch(CORBA::SystemException& e)
357 log(
Error) <<
"caught CORBA exception while marshalling: " << e._name() <<
" " << e.NP_minorString() << endlog();
361 catch(CORBA::Exception& e)
363 log(
Error) <<
"caught CORBA exception while marshalling: " << e._name() << endlog();
372 CORBA::SystemException
376 value_data_source.
ref();
388 CORBA::SystemException
391 (void)
write(sample);
409 if ( CORBA::is_nil(
remote_side.in()) )
return true;
412 assert(
remote_side.in() != 0 &&
"Got inputReady() without remote side.");
416 #ifdef CORBA_IS_OMNIORB 417 catch(CORBA::SystemException& e)
419 log(
Error) <<
"caught CORBA exception while checking a remote channel: " << e._name() <<
" " << e.NP_minorString() << endlog();
423 catch(CORBA::Exception& e)
425 log(
Error) <<
"caught CORBA exception while checking a remote channel: " << e._name() << endlog();
453 assert(
remote_side.in() != 0 &&
"Got channelReady() request without remote side.");
459 #ifdef CORBA_IS_OMNIORB 460 catch(CORBA::SystemException& e)
462 log(
Error) <<
"caught CORBA exception while marshalling: " << e._name() <<
" " << e.NP_minorString() << endlog();
466 catch(CORBA::Exception& e)
468 log(
Error) <<
"caught CORBA exception while marshalling: " << e._name() << endlog();
477 CORBA::SystemException
512 return "CorbaRemoteChannelElement";
virtual std::string getRemoteURI() const
This function returns the URI of the next channel element in the logical chain.
virtual std::string getLocalURI() const
This function return the URI of this element.
boost::call_traits< T >::param_type param_t
boost::intrusive_ptr< ChannelElement< T > > shared_ptr
The Interface of a TaskContext which exposes its data-flow ports.
virtual bool channelReady(ChannelElementBase::shared_ptr const &caller, ConnPolicy const &policy, internal::ConnID *conn_id=0)
This is called on the output half of a new connection by the connection factory in order to notify th...
virtual bool isRemoteElement() const
This function may be used to identify, if the current element uses a network transport, to send the data to the next Element in the logical chain.
virtual bool channelReady(const CConnPolicy &cp) ACE_THROW_SPEC((CORBA
CORBA IDL function.
A DataSource which is used to manipulate a reference to an external value, by means of a pointer...
virtual bool channelReady(base::ChannelElementBase::shared_ptr const &caller, ConnPolicy const &policy, internal::ConnID *conn_id)
This is called on the output half of a new connection by the connection factory in order to notify th...
FlowStatus
Returns the status of a data flow read operation.
void deregisterChannel(CChannelElement_ptr channel)
Deregisters the given channel from the channel list.
virtual CORBA::Any_ptr createAny(base::DataSourceBase::shared_ptr source) const =0
Evaluate source and create an any which contains the value of source.
void _remove_ref()
Decrease the reference count, called from the CORBA side.
virtual WriteStatus data_sample(typename base::ChannelElement< T >::param_t sample)
CWriteStatus write(const ::CORBA::Any &sample) ACE_THROW_SPEC((CORBA
CORBA IDL function.
CFlowStatus read(::CORBA::Any_out sample, bool copy_old_data) ACE_THROW_SPEC((CORBA
CORBA IDL function.
RTT::corba::CorbaTypeTransporter const & transport
Base class for CORBA channel servers.
A connection policy object describes how a given connection should behave.
void set(typename AssignableDataSource< T >::param_t t)
RTT::ConnPolicy toRTT(RTT::corba::CConnPolicy const &corba_policy)
Converts a Corba CConnPolicy object to a RTT ConPolicy object.
A DataSource which is used to manipulate a const reference to an external value, by means of a pointe...
bool pull
If true, then the sink will have to pull data.
void _add_ref()
Increase the reference count, called from the CORBA side.
virtual std::string getRemoteURI() const
This function returns the URI of the next channel element in the logical chain.
virtual bool signal()
Signals that there is new data available on this channel By default, the channel element forwards the...
shared_ptr getInput()
Returns the current input channel element.
virtual void disconnect(bool forward)
Performs a disconnection of this channel's endpoints.
Implements the CRemoteChannelElement of the CORBA IDL interface.
A typed version of ChannelElementBase.
virtual bool inputReady(base::ChannelElementBase::shared_ptr const &caller)
This is called by an input port when it is ready to receive data.
#define ACE_THROW_SPEC(x)
void remoteSignal() ACE_THROW_SPEC((CORBA
CORBA IDL function.
void dispatchChannel(base::ChannelElementBase::shared_ptr chan)
bool disconnect(const base::ChannelElementBase::shared_ptr &channel, bool forward)
Performs a disconnection of a single input or output endpoint.
virtual std::string getLocalURI() const
This function return the URI of this element.
RemoteChannelElement(CorbaTypeTransporter const &transport, DataFlowInterface *sender, PortableServer::POA_ptr poa, const ConnPolicy &policy)
Create a channel element for remote data exchange.
virtual bool inputReady()
CORBA IDL function.
virtual FlowStatus read(reference_t sample, bool copy_old_data=true)
Reads a sample from the connection.
CDataFlowInterface_i * mdataflow
static CorbaDispatcher * Instance(DataFlowInterface *iface, int scheduler=defaultScheduler, int priority=defaultPriority)
Create a new dispatcher for a given data flow interface.
void writeOneway(const ::CORBA::Any &sample) ACE_THROW_SPEC((CORBA
CORBA IDL function.
boost::call_traits< T >::reference reference_t
virtual value_t data_sample()
boost::intrusive_ptr< ChannelElementBase > shared_ptr
void deref()
Decreases the reference count, and deletes the object if it is zero.
RTT::corba::CConnPolicy toCORBA(RTT::ConnPolicy const &policy)
Converts a RTT ConnPolicy object to a Corba CConPolicy object.
virtual std::string getElementName() const
Returns the class name of this element.
FlowStatus read(typename base::ChannelElement< T >::reference_t sample, bool copy_old_data)
CRemoteChannelElement_var remote_side
virtual void transferSamples()
virtual bool updateFromAny(const CORBA::Any *blob, base::DataSourceBase::shared_ptr target) const =0
Update an assignable datasource target with the contents of blob.
This class is used in places where a permanent representation of a reference to a connection is neede...
virtual WriteStatus write(param_t sample)
Writes a new sample on this connection.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
AssignableDataSource< T >::const_reference_t rvalue() const
Get a const reference to the value of this DataSource.
In the data flow implementation, a channel is created by chaining ChannelElementBase objects...
void ref() const
Increase the reference count by one.
A simple, yet very useful DataSource, which keeps a value, and returns it in its get() method...
bool signal()
Signals that there is new data available on this channel By default, the channel element forwards the...
shared_ptr getOutput()
Returns the next channel element in the channel's propagation direction.
virtual bool updateAny(base::DataSourceBase::shared_ptr source, CORBA::Any &any) const =0
Evaluate source and update an any which contains the value of source.
PortableServer::POA_var mpoa
void remoteDisconnect(bool forward) ACE_THROW_SPEC((CORBA
CORBA IDL function.
virtual std::string getTypeName() const
Return the Orocos type name, without const, pointer or reference qualifiers.
void ref()
Increases the reference count.
WriteStatus
Returns the status of a data flow write operation.
static CORBA::ORB_var orb
The orb of this process.
WriteStatus write(typename base::ChannelElement< T >::param_t sample)
Extends the TypeTransporter in order to allow the creation of channel elements or output halves for a...