CCA
|
Synchronized Queue Buffer for Data-Flow Ports. More...
#include <SynchronizedQueue.h>
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
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.
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
cca::SynchronizedQueue< DATATYPE >::SynchronizedQueue | ( | bool | alwaysKeepLatest = true | ) | [inline] |
Definition at line 53 of file SynchronizedQueue.h.
cca::SynchronizedQueue< DATATYPE >::SynchronizedQueue | ( | unsigned int | qsize, |
bool | alwaysKeepLatest = true |
||
) | [inline] |
Definition at line 58 of file SynchronizedQueue.h.
virtual cca::SynchronizedQueue< DATATYPE >::~SynchronizedQueue | ( | ) | [inline, virtual] |
Definition at line 63 of file SynchronizedQueue.h.
cca::SynchronizedQueue< DATATYPE >::SynchronizedQueue | ( | SynchronizedQueue< DATATYPE > & | buffer | ) | [protected] |
Copy constructor Copy constructor private for now to disallow copying.
Member Function Documentation
virtual void cca::SynchronizedQueue< DATATYPE >::add | ( | DataPtr | item | ) | [inline, virtual] |
Add a new item to the buffer.
Implements cca::Buffer< DATATYPE >.
Definition at line 117 of file SynchronizedQueue.h.
References cca::Buffer< DATATYPE >::keepLatest, cca::SynchronizedQueue< DATATYPE >::latest, cca::SynchronizedQueue< DATATYPE >::latestItemMutex, cca::Buffer< DATATYPE >::newitem, cca::SynchronizedQueue< DATATYPE >::queue, and cca::Buffer< DATATYPE >::warm.
virtual DataPtr cca::SynchronizedQueue< DATATYPE >::get | ( | ) | throw () [inline, virtual] |
Getting an item from the buffer.
Implements cca::Buffer< DATATYPE >.
Definition at line 92 of file SynchronizedQueue.h.
References cca::Buffer< DATATYPE >::keepLatest, cca::SynchronizedQueue< DATATYPE >::latest, cca::SynchronizedQueue< DATATYPE >::latestItemMutex, cca::Buffer< DATATYPE >::newitem, cca::SynchronizedQueue< DATATYPE >::queue, and cca::Buffer< DATATYPE >::warm.
void cca::SynchronizedQueue< DATATYPE >::operator= | ( | const SynchronizedQueue< DATATYPE > & | buffer | ) | [protected] |
Copy operator Copy operator private for now to disallow copying.
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.
virtual void cca::SynchronizedQueue< DATATYPE >::purge | ( | ) | [inline, virtual] |
Purging buffer, emptying all items letting the configuration untouched.
Implements cca::Buffer< DATATYPE >.
Definition at line 140 of file SynchronizedQueue.h.
References cca::SynchronizedQueue< DATATYPE >::latest, cca::SynchronizedQueue< DATATYPE >::latestItemMutex, cca::Buffer< DATATYPE >::newitem, cca::Buffer< DATATYPE >::numItems, cca::SynchronizedQueue< DATATYPE >::queue, and cca::Buffer< DATATYPE >::warm.
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().
Member Data Documentation
DataPtr cca::SynchronizedQueue< DATATYPE >::latest [private] |
Definition at line 171 of file SynchronizedQueue.h.
Referenced by cca::SynchronizedQueue< DATATYPE >::add(), cca::SynchronizedQueue< DATATYPE >::get(), and cca::SynchronizedQueue< DATATYPE >::purge().
boost::recursive_mutex cca::SynchronizedQueue< DATATYPE >::latestItemMutex [mutable, private] |
Definition at line 172 of file SynchronizedQueue.h.
Referenced by cca::SynchronizedQueue< DATATYPE >::add(), cca::SynchronizedQueue< DATATYPE >::get(), and cca::SynchronizedQueue< DATATYPE >::purge().
rsc::threading::SynchronizedQueue<DataPtr> cca::SynchronizedQueue< DATATYPE >::queue [private] |
Definition at line 170 of file SynchronizedQueue.h.
Referenced by cca::SynchronizedQueue< DATATYPE >::add(), cca::SynchronizedQueue< DATATYPE >::get(), cca::SynchronizedQueue< DATATYPE >::purge(), and cca::SynchronizedQueue< DATATYPE >::size().
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:
- cca/buffer/SynchronizedQueue.h