| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Private Attributes | List of all members
boost::threadpool::detail::future_impl< Result > Class Template Reference

`#include <src/threadpool/boost/threadpool/detail/future.hpp>`

## Public Types
typedef Result const & | result_type
| Indicates the functor's result type. More...
typedef Result | future_result_type
| Indicates the future's result type. More...
typedef future_impl< future_result_type > | future_type

## Public Member Functions
| future_impl ()
bool | ready () const volatile
void | wait () const volatile
bool | timed_wait (boost::xtime const &timestamp) const
result_type | operator() () const volatile
void | set_value (future_result_type const &r) volatile
bool | cancel () volatile
bool | is_cancelled () const volatile
void | set_execution_status (bool executing) volatile

## Private Attributes
volatile bool | m_ready
volatile future_result_type | m_result
mutex | m_monitor
condition | m_condition_ready
volatile bool | m_is_cancelled
volatile bool | m_executing

## Detailed Description

### template<class Result>
class boost::threadpool::detail::future_impl< Result >

Definition at line 36 of file future.hpp.

## Member Typedef Documentation

template<class Result >

typedef Result boost::threadpool::detail::future_impl< Result >::future_result_type

Indicates the future's result type.

Definition at line 41 of file future.hpp.

template<class Result >

typedef future_impl<future_result_type> boost::threadpool::detail::future_impl< Result >::future_type

Definition at line 42 of file future.hpp.

template<class Result >

typedef Result const& boost::threadpool::detail::future_impl< Result >::result_type

Indicates the functor's result type.

Definition at line 39 of file future.hpp.

## Constructor & Destructor Documentation

template<class Result >

boost::threadpool::detail::future_impl< Result >::future_impl | ( |  | ) |
| inline

Definition at line 59 of file future.hpp.

60 : m_ready(false)
61 , m_is_cancelled(false)
62 {
63 }
boost::threadpool::detail::future_impl::m_ready
volatile bool m_ready
Definition: future.hpp:45
boost::threadpool::detail::future_impl::m_is_cancelled
volatile bool m_is_cancelled
Definition: future.hpp:51

## Member Function Documentation

template<class Result >

bool boost::threadpool::detail::future_impl< Result >::cancel | ( |  | ) | volatile
| inline

Definition at line 133 of file future.hpp.

134 {
135 if(!m_ready || m_executing)
136 {
137 m_is_cancelled = true;
138 return true;
139 }
140 else
141 {
142 return false;
143 }
144 }
boost::threadpool::detail::future_impl::m_ready
volatile bool m_ready
Definition: future.hpp:45
boost::threadpool::detail::future_impl::m_executing
volatile bool m_executing
Definition: future.hpp:52
boost::threadpool::detail::future_impl::m_is_cancelled
volatile bool m_is_cancelled
Definition: future.hpp:51
template<class Result >

bool boost::threadpool::detail::future_impl< Result >::is_cancelled | ( |  | ) | const volatile
| inline

Definition at line 147 of file future.hpp.

148 {
149 return m_is_cancelled;
150 }
boost::threadpool::detail::future_impl::m_is_cancelled
volatile bool m_is_cancelled
Definition: future.hpp:51
template<class Result >

result_type boost::threadpool::detail::future_impl< Result >::operator() | ( | void |  | ) | const volatile
| inline

Definition at line 96 of file future.hpp.

97 {
98 wait();
99 /*
100 if( throw_exception_ != 0 )
101 {
102 throw_exception_( this );
103 }
104 */
105
106 return *(const_cast<const future_result_type*>(&m_result));
107 }
boost::threadpool::detail::future_impl::future_result_type
Result future_result_type
Indicates the future&#39;s result type.
Definition: future.hpp:41
boost::threadpool::detail::future_impl::m_result
volatile future_result_type m_result
Definition: future.hpp:46
boost::threadpool::detail::future_impl::wait
void wait() const volatile
Definition: future.hpp:70
template<class Result >

bool boost::threadpool::detail::future_impl< Result >::ready | ( |  | ) | const volatile
| inline

Definition at line 65 of file future.hpp.

66 {
67 return m_ready;
68 }
boost::threadpool::detail::future_impl::m_ready
volatile bool m_ready
Definition: future.hpp:45
template<class Result >

void boost::threadpool::detail::future_impl< Result >::set_execution_status | ( | bool | executing | ) | volatile
| inline

Definition at line 153 of file future.hpp.

154 {
155 m_executing = executing;
156 }
boost::threadpool::detail::future_impl::m_executing
volatile bool m_executing
Definition: future.hpp:52
template<class Result >

void boost::threadpool::detail::future_impl< Result >::set_value | ( | future_result_type const & | r | ) | volatile
| inline

Definition at line 110 of file future.hpp.

111 {
112 locking_ptr<future_type, mutex> lockedThis(*this, m_monitor);
113 if(!m_ready && !m_is_cancelled)
114 {
115 lockedThis->m_result = r;
116 lockedThis->m_ready = true;
117 lockedThis->m_condition_ready.notify_all();
118 }
119 }
boost::threadpool::detail::future_impl::m_monitor
mutex m_monitor
Definition: future.hpp:48
boost::threadpool::detail::future_impl::m_ready
volatile bool m_ready
Definition: future.hpp:45
boost::threadpool::detail::future_impl::m_is_cancelled
volatile bool m_is_cancelled
Definition: future.hpp:51
template<class Result >

bool boost::threadpool::detail::future_impl< Result >::timed_wait | ( | boost::xtime const & | timestamp | ) | const
| inline

Definition at line 82 of file future.hpp.

83 {
84 const future_type* self = const_cast<const future_type*>(this);
85 mutex::scoped_lock lock(self->m_monitor);
86
87 while(!m_ready)
88 {
89 if(!self->m_condition_ready.timed_wait(lock, timestamp)) return false;
90 }
91
92 return true;
93 }
boost::threadpool::detail::future_impl::m_ready
volatile bool m_ready
Definition: future.hpp:45
std::lock
T lock(T...args)
boost::threadpool::detail::future_impl::future_type
future_impl< future_result_type > future_type
Definition: future.hpp:42
template<class Result >

void boost::threadpool::detail::future_impl< Result >::wait | ( |  | ) | const volatile
| inline

Definition at line 70 of file future.hpp.

71 {
72 const future_type* self = const_cast<const future_type*>(this);
73 mutex::scoped_lock lock(self->m_monitor);
74
75 while(!m_ready)
76 {
77 self->m_condition_ready.wait(lock);
78 }
79 }
boost::threadpool::detail::future_impl::m_ready
volatile bool m_ready
Definition: future.hpp:45
std::lock
T lock(T...args)
boost::threadpool::detail::future_impl::future_type
future_impl< future_result_type > future_type
Definition: future.hpp:42

## Member Data Documentation

template<class Result >

condition boost::threadpool::detail::future_impl< Result >::m_condition_ready
| mutable private

Definition at line 49 of file future.hpp.

template<class Result >

volatile bool boost::threadpool::detail::future_impl< Result >::m_executing
| private

Definition at line 52 of file future.hpp.

template<class Result >

volatile bool boost::threadpool::detail::future_impl< Result >::m_is_cancelled
| private

Definition at line 51 of file future.hpp.

template<class Result >

mutex boost::threadpool::detail::future_impl< Result >::m_monitor
| mutable private

Definition at line 48 of file future.hpp.

template<class Result >

volatile bool boost::threadpool::detail::future_impl< Result >::m_ready
| private

Definition at line 45 of file future.hpp.

template<class Result >

volatile future_result_type boost::threadpool::detail::future_impl< Result >::m_result
| private

Definition at line 46 of file future.hpp.

The documentation for this class was generated from the following file:

- GaudiMTTools/src/threadpool/boost/threadpool/detail/future.hpp