39 #ifndef CORBA_REMOTE_CHANNEL_ELEMENT_H 40 #define CORBA_REMOTE_CHANNEL_ELEMENT_H 75 PortableServer::ObjectId_var oid;
86 , valid(true), pull(is_pull)
95 oid =
mpoa->activate_object(
this);
118 CORBA::SystemException
145 #ifdef CORBA_IS_OMNIORB 146 catch(CORBA::SystemException& e)
148 log(
Error) <<
"caught CORBA exception while signalling our remote endpoint: " << e._name() <<
" " << e.NP_minorString() << endlog();
152 catch(CORBA::Exception& e)
154 log(
Error) <<
"caught CORBA exception while signalling our remote endpoint: " << e._name() << endlog();
162 while ( this->
read(sample,
false) ==
NewData && valid) {
164 if ( this->
write(sample) ==
false )
177 CORBA::SystemException
185 catch(CORBA::Exception&) {}
188 catch(CORBA::Exception&) {}
192 CORBA::SystemException
205 mpoa->deactivate_object(oid);
207 catch(CORBA::Exception&) {}
214 CORBA::SystemException
221 catch(CORBA::Exception&) {}
229 mpoa->deactivate_object(oid);
231 catch(CORBA::Exception&) {}
246 CORBA::Any_var remote_value;
253 ref_data_source.
ref();
261 #ifdef CORBA_IS_OMNIORB 262 catch(CORBA::SystemException& e)
264 log(
Error) <<
"caught CORBA exception while reading a remote channel: " << e._name() <<
" " << e.NP_minorString() << endlog();
269 catch(CORBA::Exception& e)
271 log(
Error) <<
"caught CORBA exception while reading a remote channel: " << e._name() << endlog();
281 CORBA::SystemException
287 value_data_source.
ref();
295 log(
Error) <<
"CORBA Transport failed to create Any for " << value_data_source.
getTypeName() <<
" while it should have!" <<endlog();
298 sample =
new CORBA::Any();
308 assert(
remote_side.in() != 0 &&
"Got write() without remote side. Need buffer OR remote side but neither was present.");
314 CORBA::Any write_any;
316 const_ref_data_source.
ref();
325 #ifdef CORBA_IS_OMNIORB 326 catch(CORBA::SystemException& e)
328 log(
Error) <<
"caught CORBA exception while marshalling: " << e._name() <<
" " << e.NP_minorString() << endlog();
332 catch(CORBA::Exception& e)
334 log(
Error) <<
"caught CORBA exception while marshalling: " << e._name() << endlog();
343 CORBA::SystemException
347 value_data_source.
ref();
403 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 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.
A DataSource which is used to manipulate a reference to an external value, by means of a pointer...
bool write(const ::CORBA::Any &sample) ACE_THROW_SPEC((CORBA
CORBA IDL function.
FlowStatus
Returns the status of a data flow read.
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.
virtual FlowStatus read(reference_t sample, bool copy_old_data)
Reads a sample from the connection.
void _remove_ref()
Decrease the reference count, called from the CORBA side.
virtual bool write(param_t sample)
Writes a new sample on this connection.
void disconnect(bool writer_to_reader) 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.
void set(typename AssignableDataSource< T >::param_t t)
A DataSource which is used to manipulate a const reference to an external value, by means of a pointe...
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...
ChannelElementBase::shared_ptr getInput()
Returns the current input channel element.
virtual bool data_sample(typename base::ChannelElement< T >::param_t sample)
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.
#define ACE_THROW_SPEC(x)
void remoteSignal() ACE_THROW_SPEC((CORBA
CORBA IDL function.
void dispatchChannel(base::ChannelElementBase::shared_ptr chan)
virtual std::string getLocalURI() const
This function return the URI of this element.
virtual bool inputReady()
CORBA IDL function.
CDataFlowInterface_i * mdataflow
static CorbaDispatcher * Instance(DataFlowInterface *iface, int scheduler=defaultScheduler, int priority=defaultPriority)
Create a new dispatcher for a given data flow interface.
boost::call_traits< T >::reference reference_t
virtual value_t data_sample()
void remoteDisconnect(bool writer_to_reader) ACE_THROW_SPEC((CORBA
void deref()
Decreases the reference count, and deletes the object if it is zero.
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 inputReady()
This is called by an input port when it is ready to receive data.
RemoteChannelElement(CorbaTypeTransporter const &transport, DataFlowInterface *sender, PortableServer::POA_ptr poa, bool is_pull)
Create a channel element for remote data exchange.
virtual bool updateFromAny(const CORBA::Any *blob, base::DataSourceBase::shared_ptr target) const =0
Update an assignable datasource target with the contents of blob.
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.
bool write(typename base::ChannelElement< T >::param_t sample)
void disconnect() ACE_THROW_SPEC((CORBA
CORBA IDL function.
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...
ChannelElementBase::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
virtual std::string getTypeName() const
Return the Orocos type name, without const, pointer or reference qualifiers.
void ref()
Increases the reference count.
static CORBA::ORB_var orb
The orb of this process.
Extends the TypeTransporter in order to allow the creation of channel elements or output halves for a...