3 * Author: Lukas Krejci <krejci.l@centrum.cz>, (C) 2008
4 * Copyright: See COPYING file that comes with this distribution
7 #ifndef BEACON_DETAIL_FUTURE_EVENT_BASE_H
8 #define BEACON_DETAIL_FUTURE_EVENT_BASE_H
10 #include <boost/thread/mutex.hpp>
11 #include <boost/thread/condition.hpp>
12 #include <beacon/exceptions.hpp>
13 #include <beacon/reference_countable.hpp>
20 class in_queue_invoke_base
;
23 * A base class for future_event class that implements the event_loop
24 * aware functionality inside the library.
26 class future_event_base
: public reference_countable
{
27 friend class in_queue_invoke_base
;
29 typedef boost::mutex::scoped_lock lock
;
32 future_event_base() : value(0), _finished(false),
39 /** currently always fails returning false */
41 bool finished() const;
43 void set(void * value
);
44 void * get() throw (execution_exception
);
45 void * get(int timeout
) throw(execution_exception
, timeout_exception
);
49 boost::condition value_set
;