Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends
micros_rtt::ChannelElementBase Class Reference

#include <channel_element_base.hpp>

Inheritance diagram for micros_rtt::ChannelElementBase:
Inheritance graph
[legend]

List of all members.

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 bool inputReady ()
void removeInput ()
void setOutput (shared_ptr output)
virtual bool signal ()
virtual ~ChannelElementBase ()

Protected Member Functions

void deref ()
void ref ()

Private Attributes

shared_ptr input
shared_ptr output
oro_atomic_t refcount

Friends

void intrusive_ptr_add_ref (ChannelElementBase *e)
void 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 37 of file channel_element_base.hpp.


Member Typedef Documentation


Constructor & Destructor Documentation

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 25 of file channel_elem_base.cpp.

Definition at line 31 of file channel_elem_base.cpp.


Member Function Documentation

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 micros_rtt::ChannelDataElement< T >.

Definition at line 96 of file channel_elem_base.cpp.

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

Definition at line 116 of file channel_elem_base.cpp.

void micros_rtt::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 micros_rtt::ConnOutputEndpoint< M >, and micros_rtt::ConnInputEndpoint< M >.

Definition at line 55 of file channel_elem_base.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().

Returns:

Reimplemented in micros_rtt::ChannelElement< M >, and micros_rtt::ChannelElement< T >.

Definition at line 36 of file channel_elem_base.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.

Returns:
getInput() ? getInput()->getInputEndPoint() : this

Definition at line 76 of file channel_elem_base.cpp.

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

Reimplemented in micros_rtt::ChannelElement< M >, and micros_rtt::ChannelElement< T >.

Definition at line 42 of file channel_elem_base.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.

Returns:
getOutput() ? getOutput()->getInputEndPoint() : this

Definition at line 81 of file channel_elem_base.cpp.

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 micros_rtt::MQChannelElement< M >, micros_rtt::ConnOutputEndpoint< M >, and micros_rtt::ConnInputEndpoint< M >.

Definition at line 87 of file channel_elem_base.cpp.

Increases the reference count

Definition at line 111 of file channel_elem_base.cpp.

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

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:
outputthe next element in chain.

Definition at line 48 of file channel_elem_base.cpp.

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 micros_rtt::ConnOutputEndpoint< M >.

Definition at line 103 of file channel_elem_base.cpp.


Friends And Related Function Documentation

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

Member Data Documentation

Definition at line 47 of file channel_element_base.hpp.

Definition at line 48 of file channel_element_base.hpp.

Definition at line 43 of file channel_element_base.hpp.


The documentation for this class was generated from the following files:


micros_rtt
Author(s): Zaile Jiang , Xiaodong Yi , Minglong Li
autogenerated on Sat Jun 8 2019 19:02:21