18#ifndef _DECAF_UTIL_CONCURRENT_BLOCKINGQUEUE_H_
19#define _DECAF_UTIL_CONCURRENT_BLOCKINGQUEUE_H_
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;
227 virtual bool poll(E& result,
long long timeout,
const TimeUnit& unit) = 0;
AbstractQueue()
Definition AbstractQueue.h:51
The root interface in the collection hierarchy.
Definition Collection.h:69
A kind of collection provides advanced operations than other basic collections, such as insertion,...
Definition Queue.h:55
A decaf::util::Queue that additionally supports operations that wait for the queue to become non-empt...
Definition BlockingQueue.h:164
virtual int drainTo(Collection< E > &c, int maxElements)=0
Removes at most the given number of available elements from this queue and adds them to the given col...
virtual void put(const E &value)=0
Inserts the specified element into this queue, waiting if necessary for space to become available.
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 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 ...
virtual E take()=0
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available...
virtual int drainTo(Collection< E > &c)=0
Removes all available elements from this queue and adds them to the given collection.
virtual int remainingCapacity() const =0
Returns the number of additional elements that this queue can ideally (in the absence of memory or re...
A TimeUnit represents time durations at a given unit of granularity and provides utility methods to c...
Definition TimeUnit.h:62
Definition AbstractExecutorService.h:28
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25