#include <QueueCollection.h>
Public Types | |
typedef ExpirableQueue< T, RejectNewest< T > >::SizeType | SizeType |
typedef ExpirableQueue< T, RejectNewest< T > >::ValueType | ValueType |
Public Member Functions | |
void | addEvent (T const &) |
bool | allQueuesStale (const utils::TimePoint_t &) const |
void | clearQueue (const QueueID &) |
void | clearQueues () |
bool | clearStaleQueues (const utils::TimePoint_t &) |
QueueID | createQueue (const EventConsRegPtr, const utils::TimePoint_t &now=utils::getCurrentTime()) |
QueueID | createQueue (const RegPtr, const utils::TimePoint_t &now=utils::getCurrentTime()) |
bool | empty (const QueueID &) const |
bool | full (const QueueID &) const |
utils::Duration_t | getExpirationInterval (const QueueID &id) const |
ValueType | popEvent (const QueueID &) |
ValueType | popEvent (const ConsumerID &) |
QueueCollection (ConsumerMonitorCollection &) | |
void | removeQueues () |
void | setExpirationInterval (const QueueID &, const utils::Duration_t &) |
SizeType | size () const |
SizeType | size (const QueueID &) const |
bool | stale (const QueueID &, const utils::TimePoint_t &) const |
Private Types | |
typedef std::vector < ExpirableDiscardNewQueuePtr > | DiscardNewQueues_t |
typedef std::vector < ExpirableDiscardOldQueuePtr > | DiscardOldQueues_t |
typedef ExpirableQueue< T, RejectNewest< T > > | ExpirableDiscardNewQueue_t |
typedef boost::shared_ptr < ExpirableDiscardNewQueue_t > | ExpirableDiscardNewQueuePtr |
typedef ExpirableQueue< T, KeepNewest< T > > | ExpirableDiscardOldQueue_t |
typedef boost::shared_ptr < ExpirableDiscardOldQueue_t > | ExpirableDiscardOldQueuePtr |
typedef std::map< ConsumerID, QueueID > | IDLookup_t |
typedef boost::mutex::scoped_lock | ReadLock_t |
typedef boost::mutex | ReadWriteMutex_t |
typedef std::map < EventConsRegPtr, QueueID, utils::ptrComp < EventConsumerRegistrationInfo > > | ReginfoLookup_t |
typedef boost::mutex::scoped_lock | WriteLock_t |
Private Member Functions | |
SizeType | enqueueEvent_ (QueueID const &, T const &, utils::TimePoint_t const &) |
QueueID | getQueue (const RegPtr, const utils::TimePoint_t &) |
QueueCollection & | operator= (QueueCollection const &) |
QueueCollection (QueueCollection const &) | |
Class template QueueCollection provides a collection of ConcurrentQueue<T>.
The class T must implement a method getEventConsumerTags() const, returning a std::vector<QueueID> which gives the list of QueueIDs of queues the class should be added.
Definition at line 44 of file QueueCollection.h.
|
private |
Definition at line 170 of file QueueCollection.h.
|
private |
Definition at line 172 of file QueueCollection.h.
|
private |
Definition at line 151 of file QueueCollection.h.
|
private |
Definition at line 155 of file QueueCollection.h.
|
private |
Definition at line 152 of file QueueCollection.h.
|
private |
Definition at line 157 of file QueueCollection.h.
|
private |
Definition at line 175 of file QueueCollection.h.
|
private |
Definition at line 160 of file QueueCollection.h.
|
private |
Definition at line 162 of file QueueCollection.h.
|
private |
Definition at line 179 of file QueueCollection.h.
typedef ExpirableQueue<T, RejectNewest<T> >::SizeType stor::QueueCollection< T >::SizeType |
Definition at line 47 of file QueueCollection.h.
typedef ExpirableQueue<T, RejectNewest<T> >::ValueType stor::QueueCollection< T >::ValueType |
Definition at line 48 of file QueueCollection.h.
|
private |
Definition at line 161 of file QueueCollection.h.
stor::QueueCollection< T >::QueueCollection | ( | ConsumerMonitorCollection & | ccp | ) |
A default-constructed QueueCollection contains no queues
Definition at line 221 of file QueueCollection.h.
|
private |
void stor::QueueCollection< T >::addEvent | ( | T const & | event | ) |
Add an event to all queues matching the specifications.
Definition at line 445 of file QueueCollection.h.
References stor::utils::getCurrentTime().
bool stor::QueueCollection< T >::allQueuesStale | ( | const utils::TimePoint_t & | now | ) | const |
Returns true if all queues are stale at the given time.
Definition at line 777 of file QueueCollection.h.
References i, and CommonMethods::lock().
void stor::QueueCollection< T >::clearQueue | ( | const QueueID & | id | ) |
Clear the queue with the given QueueID.
Definition at line 529 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, getHLTprescales::index, CommonMethods::lock(), and evf::utils::policy.
void stor::QueueCollection< T >::clearQueues | ( | ) |
Clear all the contained queues.
Definition at line 617 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, i, and CommonMethods::lock().
bool stor::QueueCollection< T >::clearStaleQueues | ( | const utils::TimePoint_t & | now | ) |
Clear all queues which are stale at the specified point in time.
Definition at line 577 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, i, CommonMethods::lock(), and query::result.
QueueID stor::QueueCollection< T >::createQueue | ( | const EventConsRegPtr | reginfo, |
const utils::TimePoint_t & | now = utils::getCurrentTime() |
||
) |
Create a new contained queue, with the given policy and given maximum size. It returns a unique identifier to later identify requests originating from this consumer.
Definition at line 319 of file QueueCollection.h.
References stor::ConsumerID::isValid().
QueueID stor::QueueCollection< T >::createQueue | ( | const RegPtr | reginfo, |
const utils::TimePoint_t & | now = utils::getCurrentTime() |
||
) |
Definition at line 356 of file QueueCollection.h.
References stor::ConsumerID::isValid().
bool stor::QueueCollection< T >::empty | ( | const QueueID & | id | ) | const |
Test to see if the queue with the given QueueID is empty.
Definition at line 651 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, getHLTprescales::index, CommonMethods::lock(), evf::utils::policy, and query::result.
Referenced by Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().
|
private |
Definition at line 843 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, getHLTprescales::index, and evf::utils::policy.
bool stor::QueueCollection< T >::full | ( | const QueueID & | id | ) | const |
Test to see if the queue with the given QueueID is full.
Definition at line 693 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, getHLTprescales::index, CommonMethods::lock(), evf::utils::policy, and query::result.
utils::Duration_t stor::QueueCollection< T >::getExpirationInterval | ( | const QueueID & | id | ) | const |
Definition at line 276 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, getHLTprescales::index, CommonMethods::lock(), evf::utils::policy, query::result, and seconds().
|
private |
Definition at line 377 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, CommonMethods::lock(), and cmsPerfSuiteHarvest::now.
|
private |
QueueCollection< T >::ValueType stor::QueueCollection< T >::popEvent | ( | const QueueID & | id | ) |
Remove and return an event from the queue for the consumer with the given id. If there is no event in that queue, an empty event is returned.
Definition at line 466 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, CommonMethods::lock(), evf::utils::policy, and query::result.
QueueCollection< T >::ValueType stor::QueueCollection< T >::popEvent | ( | const ConsumerID & | cid | ) |
Remove and return an event from the queue for the consumer with the given ConsumerID. If there is no event in that queue, an empty event is returned.
Definition at line 512 of file QueueCollection.h.
References i, errorMatrix2Lands_multiChannel::id, stor::ConsumerID::isValid(), CommonMethods::lock(), and query::result.
void stor::QueueCollection< T >::removeQueues | ( | ) |
Remove all contained queues. Note that this has the effect of clearing all the queues as well.
Definition at line 419 of file QueueCollection.h.
void stor::QueueCollection< T >::setExpirationInterval | ( | const QueueID & | id, |
const utils::Duration_t & | interval | ||
) |
Set or get the time in seconds that the queue with the given id can be unused (by a consumer) before becoming stale.
Definition at line 233 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, getHLTprescales::index, CommonMethods::lock(), and evf::utils::policy.
QueueCollection< T >::SizeType stor::QueueCollection< T >::size | ( | void | ) | const |
Return the number of queues in the collection.
Definition at line 434 of file QueueCollection.h.
QueueCollection< T >::SizeType stor::QueueCollection< T >::size | ( | const QueueID & | id | ) | const |
Get number of elements in queue
Definition at line 800 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, getHLTprescales::index, CommonMethods::lock(), evf::utils::policy, and query::result.
bool stor::QueueCollection< T >::stale | ( | const QueueID & | id, |
const utils::TimePoint_t & | now | ||
) | const |
Test to see if the queue with the given QueueID is stale at the given time.
Definition at line 735 of file QueueCollection.h.
References stor::enquing_policy::DiscardNew, stor::enquing_policy::DiscardOld, getHLTprescales::index, CommonMethods::lock(), evf::utils::policy, and query::result.
|
private |
Definition at line 181 of file QueueCollection.h.
|
private |
Definition at line 171 of file QueueCollection.h.
|
private |
Definition at line 173 of file QueueCollection.h.
|
mutableprivate |
Definition at line 166 of file QueueCollection.h.
|
mutableprivate |
Definition at line 167 of file QueueCollection.h.
|
mutableprivate |
Definition at line 168 of file QueueCollection.h.
|
private |
Definition at line 176 of file QueueCollection.h.
|
private |
Definition at line 180 of file QueueCollection.h.