#include <ChannelElementBase.hpp>
Public Types | |
typedef boost::intrusive_ptr < ChannelElementBase > | shared_ptr |
Public Member Functions | |
ChannelElementBase () | |
virtual void | clear () |
virtual void | disconnect (bool forward) |
ChannelElementBase::shared_ptr | getInput () |
ChannelElementBase::shared_ptr | getInputEndPoint () |
ChannelElementBase::shared_ptr | getOutput () |
ChannelElementBase::shared_ptr | getOutputEndPoint () |
virtual PortInterface * | getPort () const |
virtual bool | inputReady () |
void | removeInput () |
void | setOutput (shared_ptr output) |
virtual bool | signal () |
virtual | ~ChannelElementBase () |
Protected Member Functions | |
void | deref () |
void | ref () |
Private Attributes | |
RTT::os::Mutex | inout_lock |
shared_ptr | input |
shared_ptr | output |
oro_atomic_t | refcount |
Friends | |
void RTT_API | intrusive_ptr_add_ref (ChannelElementBase *e) |
void RTT_API | intrusive_ptr_release (ChannelElementBase *e) |
In the data flow implementation, a channel is created by chaining ChannelElementBase objects.
ChannelElementBase objects are refcounted. In the chain, an element maintains the refcount for its successor, and holds a simple pointer to its predecessor.
Definition at line 59 of file ChannelElementBase.hpp.
typedef boost::intrusive_ptr<ChannelElementBase> RTT::base::ChannelElementBase::shared_ptr |
Reimplemented in RTT::base::ChannelElement< T >.
Definition at line 62 of file ChannelElementBase.hpp.
A default constructed ChannelElementBase has no input nor output configured. The only way to set an input or output is to use setOutput().
Definition at line 46 of file ChannelInterface.cpp.
ChannelElementBase::~ChannelElementBase | ( | ) | [virtual] |
Definition at line 53 of file ChannelInterface.cpp.
void ChannelElementBase::clear | ( | ) | [virtual] |
Clears any data stored by the channel. It means that ChannelElement::read() will return false afterwards (provided that no new data has been written on the meantime of course)
By default, the channel element forwards the calls to its input
Reimplemented in RTT::internal::ChannelBufferElement< T >, and RTT::internal::ChannelDataElement< T >.
Definition at line 116 of file ChannelInterface.cpp.
void ChannelElementBase::deref | ( | ) | [protected] |
Decreases the reference count, and deletes the object if it is zero
Definition at line 140 of file ChannelInterface.cpp.
void ChannelElementBase::disconnect | ( | bool | forward | ) | [virtual] |
Performs a disconnection of this channel's endpoints. If forward is true, then the disconnection is initiated by the input endpoint. Otherwise, it has been initiated by the output endpoint.
Reimplemented in RTT::corba::RemoteChannelElement< T >, RTT::internal::ConnOutputEndpoint< T >, and RTT::internal::ConnInputEndpoint< T >.
Definition at line 75 of file ChannelInterface.cpp.
Returns the current input channel element. This will only return a valid channel element if another element has received this object as an argument to setOutput().
Reimplemented in RTT::base::ChannelElement< T >.
Definition at line 58 of file ChannelInterface.cpp.
Returns the first input channel element of this connection. Will return the channel element the furthest away from the input port, or this if none.
Definition at line 96 of file ChannelInterface.cpp.
Returns the next channel element in the channel's propagation direction
Reimplemented in RTT::base::ChannelElement< T >.
Definition at line 63 of file ChannelInterface.cpp.
Returns the last output channel element of this connection. Will return the channel element the furthest away from the output port, or this if none.
Definition at line 101 of file ChannelInterface.cpp.
PortInterface * ChannelElementBase::getPort | ( | ) | const [virtual] |
Gets the port this channel element is connected to.
Reimplemented in RTT::internal::ConnOutputEndpoint< T >, and RTT::internal::ConnInputEndpoint< T >.
Definition at line 131 of file ChannelInterface.cpp.
bool ChannelElementBase::inputReady | ( | ) | [virtual] |
This is called by an input port when it is ready to receive data. Each channel element has the responsibility to pass this notification on to the next, in the direction of the output.
Reimplemented in RTT::corba::RemoteChannelElement< T >, RTT::mqueue::MQChannelElement< T >, RTT::internal::ConnOutputEndpoint< T >, and RTT::internal::ConnInputEndpoint< T >.
Definition at line 107 of file ChannelInterface.cpp.
void ChannelElementBase::ref | ( | ) | [protected] |
Increases the reference count
Definition at line 135 of file ChannelInterface.cpp.
Removes the input channel (if any). This call may delete channels from memory.
void ChannelElementBase::setOutput | ( | shared_ptr | output | ) |
Sets the output of this channel element to output and sets the input of output to this. This implies that this channel element becomes the input of output. There is no setInput function since this function does both setting input and output of this and output.
output | the next element in chain. |
Definition at line 68 of file ChannelInterface.cpp.
bool ChannelElementBase::signal | ( | ) | [virtual] |
Signals that there is new data available on this channel By default, the channel element forwards the call to its output
Reimplemented in RTT::corba::RemoteChannelElement< T >, RTT::mqueue::MQChannelElement< T >, and RTT::internal::ConnOutputEndpoint< T >.
Definition at line 123 of file ChannelInterface.cpp.
void RTT_API intrusive_ptr_add_ref | ( | ChannelElementBase * | e | ) | [friend] |
void RTT_API intrusive_ptr_release | ( | ChannelElementBase * | e | ) | [friend] |
Definition at line 72 of file ChannelElementBase.hpp.
Definition at line 69 of file ChannelElementBase.hpp.
Definition at line 70 of file ChannelElementBase.hpp.
Definition at line 65 of file ChannelElementBase.hpp.