CCA
cca::SynchronizedQueue< DATATYPE > Class Template Reference

Synchronized Queue Buffer for Data-Flow Ports. More...

#include <SynchronizedQueue.h>

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

List of all members.

Public Types

typedef ::boost::shared_ptr
< SynchronizedQueue< DATATYPE > > 
Ptr
 Defines a shared pointer for the data-type of this buffer.
typedef ::boost::shared_ptr
< DATATYPE > 
DataPtr
 Defines a shared pointer for the data-type of this buffer.

Public Member Functions

 SynchronizedQueue (bool alwaysKeepLatest=true)
 SynchronizedQueue (unsigned int qsize, bool alwaysKeepLatest=true)
virtual ~SynchronizedQueue ()
std::string print () const
 Print.
virtual DataPtr get () throw ()
 Getting an item from the buffer.
virtual void add (DataPtr item)
 Add a new item to the buffer.
virtual unsigned int size () const
 Returns number of buffered items.
virtual void purge ()
 Purging buffer, emptying all items letting the configuration untouched.

Protected Member Functions

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

Private Attributes

unsigned int queuesize
rsc::threading::SynchronizedQueue
< DataPtr
queue
DataPtr latest
boost::recursive_mutex latestItemMutex

Detailed Description

template<class DATATYPE>
class cca::SynchronizedQueue< DATATYPE >

Synchronized Queue Buffer for Data-Flow Ports.

Definition at line 44 of file SynchronizedQueue.h.


Member Typedef Documentation

template<class DATATYPE >
typedef ::boost::shared_ptr<DATATYPE> cca::SynchronizedQueue< DATATYPE >::DataPtr

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

Reimplemented from cca::Buffer< DATATYPE >.

Definition at line 51 of file SynchronizedQueue.h.

template<class DATATYPE >
typedef ::boost::shared_ptr<SynchronizedQueue<DATATYPE> > cca::SynchronizedQueue< DATATYPE >::Ptr

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

Reimplemented from cca::Buffer< DATATYPE >.

Definition at line 48 of file SynchronizedQueue.h.


Constructor & Destructor Documentation

template<class DATATYPE >
cca::SynchronizedQueue< DATATYPE >::SynchronizedQueue ( bool  alwaysKeepLatest = true) [inline]

Definition at line 53 of file SynchronizedQueue.h.

template<class DATATYPE >
cca::SynchronizedQueue< DATATYPE >::SynchronizedQueue ( unsigned int  qsize,
bool  alwaysKeepLatest = true 
) [inline]

Definition at line 58 of file SynchronizedQueue.h.

template<class DATATYPE >
virtual cca::SynchronizedQueue< DATATYPE >::~SynchronizedQueue ( ) [inline, virtual]

Definition at line 63 of file SynchronizedQueue.h.

template<class DATATYPE >
cca::SynchronizedQueue< DATATYPE >::SynchronizedQueue ( SynchronizedQueue< DATATYPE > &  buffer) [protected]

Copy constructor Copy constructor private for now to disallow copying.


Member Function Documentation

template<class DATATYPE >
void cca::SynchronizedQueue< DATATYPE >::operator= ( const SynchronizedQueue< DATATYPE > &  buffer) [protected]

Copy operator Copy operator private for now to disallow copying.

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

Print.

Reimplemented from cca::Buffer< DATATYPE >.

Definition at line 69 of file SynchronizedQueue.h.

References cca::Buffer< DATATYPE >::keepLatest, cca::Buffer< DATATYPE >::newItem(), cca::SynchronizedQueue< DATATYPE >::size(), and cca::Buffer< DATATYPE >::warm.

Here is the call graph for this function:

template<class DATATYPE >
virtual void cca::SynchronizedQueue< DATATYPE >::purge ( ) [inline, virtual]
template<class DATATYPE >
virtual unsigned int cca::SynchronizedQueue< 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.

Reimplemented from cca::Buffer< DATATYPE >.

Definition at line 133 of file SynchronizedQueue.h.

References cca::SynchronizedQueue< DATATYPE >::queue.

Referenced by cca::SynchronizedQueue< DATATYPE >::print().

Here is the caller graph for this function:


Member Data Documentation

template<class DATATYPE >
boost::recursive_mutex cca::SynchronizedQueue< DATATYPE >::latestItemMutex [mutable, private]
template<class DATATYPE >
unsigned int cca::SynchronizedQueue< DATATYPE >::queuesize [private]

Definition at line 169 of file SynchronizedQueue.h.


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