CCA

InputPort base class. More...

#include <InputPort.h>

Inheritance diagram for cca::InputPort< DATATYPE >:
Collaboration diagram for cca::InputPort< DATATYPE >:

List of all members.

Public Types

typedef ::boost::shared_ptr
< DATATYPE > 
DataPtr
 Defines a shared pointer for the data-type of this port.
typedef ::boost::shared_ptr
< InputPort< DATATYPE > > 
Ptr
 Defines a shared pointer for this typed port.
typedef Buffer< DATATYPE >::Ptr BufferPtr

Public Member Functions

virtual void configureSpecifics ()
 Configure.
 InputPort (bool optional=false)
 Protected constructor.
virtual DataPtr get () throw ()
 Returns the latest item of the buffer.
virtual void addEvent (rsb::EventPtr item)
 Add a new item to the buffer.
virtual void add (DataPtr item)
 Add a new item to the buffer.
virtual bool empty () const
 Returns, if buffer is empty.
virtual bool newItem () const
 Returns, if buffer is empty.
virtual unsigned int size () const
 Returns number of buffered items.
virtual void purge ()
 Purging buffer, emptying all items letting the configuration untouched.
virtual std::string print () const
 Printing information about this Port.
virtual std::string bla () const
virtual ~InputPort ()

Static Public Member Functions

static Ptr create ()
 Creates a shared pointer to a new typed port.

Protected Member Functions

 InputPort (InputPort &port)
 Copy constructor Copy constructor private for now to disallow copying.
void operator= (const InputPort &port)
 Copy operator Copy operator private for now to disallow copying.

Protected Attributes

BufferPtr buffer
 Buffer for incoming data of type DATATYPE.
rsc::logging::LoggerPtr logger

Detailed Description

template<typename DATATYPE>
class cca::InputPort< DATATYPE >

InputPort base class.

Definition at line 169 of file InputPort.h.


Member Typedef Documentation

template<typename DATATYPE>
typedef Buffer<DATATYPE>::Ptr cca::InputPort< DATATYPE >::BufferPtr

Definition at line 179 of file InputPort.h.

template<typename DATATYPE>
typedef ::boost::shared_ptr<DATATYPE> cca::InputPort< DATATYPE >::DataPtr

Defines a shared pointer for the data-type of this port.

Reimplemented from cca::Buffering< DATATYPE >.

Definition at line 174 of file InputPort.h.

template<typename DATATYPE>
typedef ::boost::shared_ptr<InputPort<DATATYPE> > cca::InputPort< DATATYPE >::Ptr

Defines a shared pointer for this typed port.

Definition at line 177 of file InputPort.h.


Constructor & Destructor Documentation

template<typename DATATYPE>
cca::InputPort< DATATYPE >::InputPort ( bool  optional = false) [inline]

Protected constructor.

Todo:
Better handling of exception, when rsb transport for the selected InputPort type is not available.

Definition at line 217 of file InputPort.h.

template<typename DATATYPE>
virtual cca::InputPort< DATATYPE >::~InputPort ( ) [inline, virtual]

Definition at line 302 of file InputPort.h.

template<typename DATATYPE>
cca::InputPort< DATATYPE >::InputPort ( InputPort< DATATYPE > &  port) [protected]

Copy constructor Copy constructor private for now to disallow copying.


Member Function Documentation

template<typename DATATYPE>
virtual void cca::InputPort< DATATYPE >::add ( DataPtr  item) [inline, virtual]

Add a new item to the buffer.

Implements cca::Buffering< DATATYPE >.

Definition at line 247 of file InputPort.h.

template<typename DATATYPE>
virtual void cca::InputPort< DATATYPE >::addEvent ( rsb::EventPtr  item) [inline, virtual]

Add a new item to the buffer.

Definition at line 238 of file InputPort.h.

template<typename DATATYPE>
virtual std::string cca::InputPort< DATATYPE >::bla ( ) const [inline, virtual]

Definition at line 296 of file InputPort.h.

template<typename DATATYPE>
virtual void cca::InputPort< DATATYPE >::configureSpecifics ( ) [inline, virtual]

Configure.

Reimplemented from cca::InputPortBase.

Definition at line 193 of file InputPort.h.

Referenced by cca::InputPort< DTOTYPE >::configureSpecifics().

Here is the caller graph for this function:

template<typename DATATYPE>
static Ptr cca::InputPort< DATATYPE >::create ( ) [inline, static]

Creates a shared pointer to a new typed port.

Returns:
Shared pointer to a new typed port.

Definition at line 186 of file InputPort.h.

template<typename DATATYPE>
virtual bool cca::InputPort< DATATYPE >::empty ( ) const [inline, virtual]

Returns, if buffer is empty.

If buffer is configured to always keep the latest item, this is only the case until first item arrived. This method should be implemented fast, because its heavily frequented by CCA.

Implements cca::Buffering< DATATYPE >.

Definition at line 254 of file InputPort.h.

Referenced by cca::Splitter< DTOTYPE >::onProcess().

Here is the caller graph for this function:

template<typename DATATYPE>
virtual DataPtr cca::InputPort< DATATYPE >::get ( ) throw () [inline, virtual]

Returns the latest item of the buffer.

Returns:
Latest item of the buffer.

Implements cca::Buffering< DATATYPE >.

Definition at line 228 of file InputPort.h.

Referenced by cca::Component::beatCallback(), and cca::Splitter< DTOTYPE >::onProcess().

Here is the caller graph for this function:

template<typename DATATYPE>
virtual bool cca::InputPort< DATATYPE >::newItem ( ) const [inline, virtual]

Returns, if buffer is empty.

If buffer is configured to always keep the latest item, this is only the case until first item arrived. This method should be implemented fast, because its heavily frequented by CCA.

Implements cca::Buffering< DATATYPE >.

Definition at line 261 of file InputPort.h.

template<typename DATATYPE>
void cca::InputPort< DATATYPE >::operator= ( const InputPort< DATATYPE > &  port) [protected]

Copy operator Copy operator private for now to disallow copying.

template<typename DATATYPE>
virtual std::string cca::InputPort< DATATYPE >::print ( ) const [inline, virtual]

Printing information about this Port.

Implements cca::Port.

Definition at line 281 of file InputPort.h.

Referenced by cca::ComponentInfo::displayBeatPort(), and cca::ComponentInfo::displayStatePorts().

Here is the caller graph for this function:

template<typename DATATYPE>
virtual void cca::InputPort< DATATYPE >::purge ( ) [inline, virtual]

Purging buffer, emptying all items letting the configuration untouched.

Implements cca::Buffering< DATATYPE >.

Definition at line 275 of file InputPort.h.

template<typename DATATYPE>
virtual unsigned int cca::InputPort< DATATYPE >::size ( ) const [inline, virtual]

Returns number of buffered items.

(NOT including the kept item if keepLatest active. This method should be implemented fast, because its heavily frequented by CCA.

Implements cca::Buffering< DATATYPE >.

Definition at line 268 of file InputPort.h.


Member Data Documentation

template<typename DATATYPE>
rsc::logging::LoggerPtr cca::InputPort< DATATYPE >::logger [protected]

Reimplemented from cca::InputPortBase.

Definition at line 321 of file InputPort.h.

Referenced by cca::InputPort< DTOTYPE >::add(), and cca::InputPort< DTOTYPE >::configureSpecifics().


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