5 #ifndef EventFilter_StorageManager_ExpirableQueue_h
6 #define EventFilter_StorageManager_ExpirableQueue_h
26 template <
class T,
class Policy>
128 template <
class T,
class Policy>
136 stalenessInterval_(stalenessInterval),
137 stalenessTime_(now+stalenessInterval_)
141 template <
class T,
class Policy>
146 return events_.deqNowait(event);
149 template <
class T,
class Policy>
155 events_.addExternallyDroppedEvents(1);
158 return events_.enqNowait(event);
161 template <
class T,
class Policy>
166 stalenessInterval_ =
t;
169 template <
class T,
class Policy>
174 return stalenessInterval_;
177 template <
class T,
class Policy>
182 return events_.clear();
185 template <
class T,
class Policy>
190 return events_.empty();
193 template <
class T,
class Policy>
198 return events_.size();
201 template <
class T,
class Policy>
206 return events_.full();
209 template <
class T,
class Policy>
214 return (stalenessTime_ < now);
217 template <
class T,
class Policy>
226 if (stalenessTime_ < now)
228 clearedEvents =
clear();
241 #endif // EventFilter_StorageManager_ExpirableQueue_h
TimePoint_t getCurrentTime()
bool stale(const utils::TimePoint_t &) const
SizeType enqNowait(T const &, const utils::TimePoint_t &now=utils::getCurrentTime())
utils::Duration_t stalenessInterval() const
boost::posix_time::time_duration Duration_t
const T & max(const T &a, const T &b)
ConcurrentQueue< T, Policy >::SizeType SizeType
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
utils::TimePoint_t stalenessTime_
Policy::ValueType ValueType
boost::posix_time::ptime TimePoint_t
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
ConcurrentQueue< T, Policy > queue_t
utils::Duration_t stalenessInterval_
void setStalenessInterval(const utils::Duration_t &)
ExpirableQueue(SizeType maxsize=std::numeric_limits< SizeType >::max(), utils::Duration_t stalenessInterval=boost::posix_time::seconds(120), utils::TimePoint_t now=utils::getCurrentTime())
bool clearIfStale(const utils::TimePoint_t &, SizeType &clearedEvents)
bool deqNowait(ValueType &)
ExpirableQueue & operator=(ExpirableQueue &)