18 #ifndef _DECAF_UTIL_CONCURRENT_BLOCKINGQUEUE_H_ 19 #define _DECAF_UTIL_CONCURRENT_BLOCKINGQUEUE_H_ 29 namespace concurrent {
163 template<
typename E >
183 virtual void put(
const E& value ) = 0;
203 virtual bool offer(
const E& e,
long long timeout,
const TimeUnit& unit ) = 0;
212 virtual E
take() = 0;
227 virtual bool poll( E& result,
long long timeout,
const TimeUnit& unit ) = 0;
virtual void put(const E &value)=0
Inserts the specified element into this queue, waiting if necessary for space to become available...
The root interface in the collection hierarchy.
Definition: Collection.h:68
A decaf::util::Queue that additionally supports operations that wait for the queue to become non-empt...
Definition: BlockingQueue.h:164
A kind of collection provides advanced operations than other basic collections, such as insertion...
Definition: Queue.h:55
A TimeUnit represents time durations at a given unit of granularity and provides utility methods to c...
Definition: TimeUnit.h:62
virtual int remainingCapacity() const =0
Returns the number of additional elements that this queue can ideally (in the absence of memory or re...
virtual bool offer(const E &e, long long timeout, const TimeUnit &unit)=0
Inserts the specified element into this queue, waiting up to the specified wait time if necessary for...
virtual ~BlockingQueue()
Definition: BlockingQueue.h:167
virtual int drainTo(Collection< E > &c)=0
Removes all available elements from this queue and adds them to the given collection.
virtual E take()=0
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available...
virtual bool poll(E &result, long long timeout, const TimeUnit &unit)=0
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for ...
This class provides skeletal implementations of some Queue operations.
Definition: AbstractQueue.h:47
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25