RTT::base::ChannelElementBase Class Reference

#include <ChannelElementBase.hpp>

Inheritance diagram for RTT::base::ChannelElementBase:
Inheritance graph
[legend]

List of all members.

Public Types

typedef boost::intrusive_ptr
< ChannelElementBase
shared_ptr
typedef boost::intrusive_ptr
< ChannelElementBase
shared_ptr

Public Member Functions

 ChannelElementBase ()
 ChannelElementBase ()
virtual void clear ()
virtual void clear ()
virtual void disconnect (bool forward)
virtual void disconnect (bool forward)
ChannelElementBase::shared_ptr getInput ()
ChannelElementBase::shared_ptr getInput ()
ChannelElementBase::shared_ptr getInputEndPoint ()
ChannelElementBase::shared_ptr getInputEndPoint ()
ChannelElementBase::shared_ptr getOutput ()
ChannelElementBase::shared_ptr getOutput ()
ChannelElementBase::shared_ptr getOutputEndPoint ()
ChannelElementBase::shared_ptr getOutputEndPoint ()
virtual PortInterfacegetPort () const
virtual PortInterfacegetPort () const
virtual bool inputReady ()
virtual bool inputReady ()
void removeInput ()
void removeInput ()
void setOutput (shared_ptr output)
void setOutput (shared_ptr output)
virtual bool signal ()
virtual bool signal ()
virtual ~ChannelElementBase ()
virtual ~ChannelElementBase ()

Protected Member Functions

void deref ()
void deref ()
void ref ()
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_add_ref (ChannelElementBase *e)
void RTT_API intrusive_ptr_release (ChannelElementBase *e)
void RTT_API intrusive_ptr_release (ChannelElementBase *e)

Detailed Description

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 install/include/rtt/base/ChannelElementBase.hpp.


Member Typedef Documentation


Constructor & Destructor Documentation

RTT::base::ChannelElementBase::ChannelElementBase (  ) 

A default constructed ChannelElementBase has no input nor output configured. The only way to set an input or output is to use setOutput().

virtual RTT::base::ChannelElementBase::~ChannelElementBase (  )  [virtual]
RTT::base::ChannelElementBase::ChannelElementBase (  ) 

A default constructed ChannelElementBase has no input nor output configured. The only way to set an input or output is to use setOutput().

virtual RTT::base::ChannelElementBase::~ChannelElementBase (  )  [virtual]

Member Function Documentation

virtual void RTT::base::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 >, RTT::internal::ChannelDataElement< T >, RTT::internal::ChannelBufferElement< T >, and RTT::internal::ChannelDataElement< T >.

virtual void RTT::base::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 >, RTT::internal::ChannelDataElement< T >, RTT::internal::ChannelBufferElement< T >, and RTT::internal::ChannelDataElement< T >.

void RTT::base::ChannelElementBase::deref (  )  [protected]

Decreases the reference count, and deletes the object if it is zero

void RTT::base::ChannelElementBase::deref (  )  [protected]

Decreases the reference count, and deletes the object if it is zero

virtual void RTT::base::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::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, RTT::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, and RTT::corba::RemoteChannelElement< T >.

virtual void RTT::base::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::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, RTT::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, and RTT::corba::RemoteChannelElement< T >.

ChannelElementBase::shared_ptr RTT::base::ChannelElementBase::getInput (  ) 

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().

Returns:

Reimplemented in RTT::base::ChannelElement< T >, and RTT::base::ChannelElement< T >.

ChannelElementBase::shared_ptr RTT::base::ChannelElementBase::getInput (  ) 

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().

Returns:

Reimplemented in RTT::base::ChannelElement< T >, and RTT::base::ChannelElement< T >.

ChannelElementBase::shared_ptr RTT::base::ChannelElementBase::getInputEndPoint (  ) 

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.

Returns:
getInput() ? getInput()->getInputEndPoint() : this
ChannelElementBase::shared_ptr RTT::base::ChannelElementBase::getInputEndPoint (  ) 

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.

Returns:
getInput() ? getInput()->getInputEndPoint() : this
ChannelElementBase::shared_ptr RTT::base::ChannelElementBase::getOutput (  ) 

Returns the next channel element in the channel's propagation direction

Reimplemented in RTT::base::ChannelElement< T >, and RTT::base::ChannelElement< T >.

ChannelElementBase::shared_ptr RTT::base::ChannelElementBase::getOutput (  ) 

Returns the next channel element in the channel's propagation direction

Reimplemented in RTT::base::ChannelElement< T >, and RTT::base::ChannelElement< T >.

ChannelElementBase::shared_ptr RTT::base::ChannelElementBase::getOutputEndPoint (  ) 

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.

Returns:
getOutput() ? getOutput()->getInputEndPoint() : this
ChannelElementBase::shared_ptr RTT::base::ChannelElementBase::getOutputEndPoint (  ) 

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.

Returns:
getOutput() ? getOutput()->getInputEndPoint() : this
virtual PortInterface* RTT::base::ChannelElementBase::getPort (  )  const [virtual]

Gets the port this channel element is connected to.

Returns:
null if no port is connected to this element, the port (or a proxy representing the port) otherwise.

Reimplemented in RTT::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::internal::ConnInputEndpoint< T >, and RTT::internal::ConnOutputEndpoint< T >.

virtual PortInterface* RTT::base::ChannelElementBase::getPort (  )  const [virtual]

Gets the port this channel element is connected to.

Returns:
null if no port is connected to this element, the port (or a proxy representing the port) otherwise.

Reimplemented in RTT::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::internal::ConnInputEndpoint< T >, and RTT::internal::ConnOutputEndpoint< T >.

virtual bool RTT::base::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.

Returns:
false if a fatal connection failure was encountered and the channel needs to be destroyed.

Reimplemented in RTT::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, RTT::mqueue::MQChannelElement< T >, RTT::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, and RTT::mqueue::MQChannelElement< T >.

virtual bool RTT::base::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.

Returns:
false if a fatal connection failure was encountered and the channel needs to be destroyed.

Reimplemented in RTT::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, RTT::mqueue::MQChannelElement< T >, RTT::internal::ConnInputEndpoint< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, and RTT::mqueue::MQChannelElement< T >.

void RTT::base::ChannelElementBase::ref (  )  [protected]

Increases the reference count

void RTT::base::ChannelElementBase::ref (  )  [protected]

Increases the reference count

void RTT::base::ChannelElementBase::removeInput (  ) 

Removes the input channel (if any). This call may delete channels from memory.

void RTT::base::ChannelElementBase::removeInput (  ) 

Removes the input channel (if any). This call may delete channels from memory.

void RTT::base::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.

Parameters:
output the next element in chain.
void RTT::base::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.

Parameters:
output the next element in chain.
virtual bool RTT::base::ChannelElementBase::signal (  )  [virtual]

Signals that there is new data available on this channel By default, the channel element forwards the call to its output

Returns:
false if an error occured that requires the channel to be invalidated. In no ways it indicates that the sample has been received by the other side of the channel.

Reimplemented in RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, RTT::mqueue::MQChannelElement< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, and RTT::mqueue::MQChannelElement< T >.

virtual bool RTT::base::ChannelElementBase::signal (  )  [virtual]

Signals that there is new data available on this channel By default, the channel element forwards the call to its output

Returns:
false if an error occured that requires the channel to be invalidated. In no ways it indicates that the sample has been received by the other side of the channel.

Reimplemented in RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, RTT::mqueue::MQChannelElement< T >, RTT::internal::ConnOutputEndpoint< T >, RTT::corba::RemoteChannelElement< T >, and RTT::mqueue::MQChannelElement< T >.


Friends And Related Function Documentation

void RTT_API intrusive_ptr_add_ref ( ChannelElementBase e  )  [friend]
void RTT_API intrusive_ptr_add_ref ( ChannelElementBase e  )  [friend]
void RTT_API intrusive_ptr_release ( ChannelElementBase e  )  [friend]
void RTT_API intrusive_ptr_release ( ChannelElementBase e  )  [friend]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:49:50 2013