Fixed-size queue of Runnable-s, often used in Thread-Services use hairdressen algorithm
Public Methods
-
QueueOfRunnables(int maxSize)
-
void put(Runnable* runnable)
- put runnable to queue; if queue is full, then wait until place will be freeded
-
bool try_put(Runnable* runnable)
- try put \verb|runnable| to queue.
-
bool put_with_timeout(Runnable* runnable, long timeout)
- put runnable to queue if queue is full, then wait until place will be freeded during timeout <code> timeout </code> (in seconds).
-
Runnable* get()
- get item from queue.
-
Runnable* try_get()
- try get runnable from queue.
-
Runnable* get_with_timeout(long timeout)
- get runnable from queue
-
bool empty() const
-
bool full() const
-
int size() const
-
int max_size() const
Public Members
-
struct Destructed
- this exception is thrown from get .
Documentation
Fixed-size queue of Runnable-s, often used in Thread-Services
use hairdressen algorithm
struct Destructed
-
this exception is thrown from get . family of functions,
when Queue is destructed.
QueueOfRunnables(int maxSize)
void put(Runnable* runnable)
-
put runnable to queue;
if queue is full, then wait until place will be freeded
bool try_put(Runnable* runnable)
-
try put \verb|runnable| to queue.
on success return true, otherwise (i. e. when queue is full) return false
bool put_with_timeout(Runnable* runnable, long timeout)
-
put runnable to queue
if queue is full, then wait until place will be freeded during
timeout <code> timeout </code> (in seconds).
- Returns:
- false, if timeout expired by queue is not smalled
Runnable* get()
-
get item from queue. If queue is empty, than wait until element
will be arrived.
Runnable* try_get()
-
try get runnable from queue. on success return true, otherwise
(i. e. if queue is empty) immediatly return false
Runnable* get_with_timeout(long timeout)
-
get runnable from queue
bool empty() const
bool full() const
int size() const
int max_size() const
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.