39 #include "../internal/Channels.hpp" 40 #include "../os/Atomic.hpp" 41 #include "../os/MutexLock.hpp" 42 #include <boost/lexical_cast.hpp> 71 this->output = output;
82 output->disconnect(
true);
88 input->disconnect(
false);
100 return input ? input->getInputEndPoint() :
this;
105 return output ? output->getOutputEndPoint() :
this;
113 return input->inputReady();
128 return output->signal();
147 return std::string();
149 return output->getLocalURI();
153 return std::string(boost::lexical_cast<std::string>(
this));
157 return std::string(
"ChannelElementBase");
virtual PortInterface * getPort() const
Gets the port this channel element is connected to.
virtual void clear()
Clears any data stored by the channel.
void RTT_API intrusive_ptr_add_ref(ChannelElementBase *e)
virtual internal::ConnID * getConnID() const
Gets the Connection ID of this channel.
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.
ChannelElementBase::shared_ptr getInputEndPoint()
Returns the first input channel element of this connection.
ChannelElementBase()
A default constructed ChannelElementBase has no input nor output configured.
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.
Convenient short notation for every sub-namespace of RTT.
virtual void disconnect(bool forward)
Performs a disconnection of this channel's endpoints.
void oro_atomic_inc(oro_atomic_t *a)
Increment a atomically.
void ORO_ATOMIC_SETUP(oro_atomic_t *a, int n)
Initializes the uninitialized atomic structure a with a counter value of 'n'.
virtual std::string getLocalURI() const
This function return the URI of this element.
void ORO_ATOMIC_CLEANUP(oro_atomic_t *a)
Cleans up all resources allocated durint the setup of atomic structure a.
void setOutput(shared_ptr output)
Sets the output of this channel element to output and sets the input of output to this...
boost::intrusive_ptr< ChannelElementBase > shared_ptr
int oro_atomic_dec_and_test(oro_atomic_t *a)
Decrement a atomically and test for zero.
void deref()
Decreases the reference count, and deletes the object if it is zero.
void RTT_API intrusive_ptr_release(ChannelElementBase *e)
virtual bool inputReady()
This is called by an input port when it is ready to receive data.
virtual ~ChannelElementBase()
virtual std::string getElementName() const
Returns the class name of this element.
This class is used in places where a permanent representation of a reference to a connection is neede...
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
In the data flow implementation, a channel is created by chaining ChannelElementBase objects...
The base class of every data flow port.
ChannelElementBase::shared_ptr getOutputEndPoint()
Returns the last output channel element of this connection.
ChannelElementBase::shared_ptr getOutput()
Returns the next channel element in the channel's propagation direction.
void ref()
Increases the reference count.
MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking ...