Follow this link to skip to the main content

claraty::bg< result_type > Class Template Reference

#include <background_thread.h>

Inheritance diagram for claraty::bg< result_type >:

Inheritance graph
[legend]
Collaboration diagram for claraty::bg< result_type >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

template<class Op>
 bg (Op op, result_type &return_var, bool detach=false)
virtual ~bg ()
virtual void wait ()

Protected Attributes

bool detached

Private Member Functions

 bg (const bg &rhs)

Private Attributes

ACE_thread_t thread_id
result_type & return_value

Detailed Description

template<class result_type>
class claraty::bg< result_type >

Definition at line 101 of file background_thread.h.


Constructor & Destructor Documentation

template<class result_type>
claraty::bg< result_type >::bg ( const bg< result_type > &  rhs  )  [explicit, private]

template<class result_type>
template<class Op>
claraty::bg< result_type >::bg ( Op  op,
result_type &  return_var,
bool  detach = false 
) [inline]

Definition at line 111 of file background_thread.h.

00112     : BG_Task(), 
00113       // ACE_thread_t must be initialized to 0 for VxWorks 
00114       // (undocumented in ACE)
00115       thread_id (0),
00116       return_value(return_var), detached(detach)
00117   {
00118     new bg_helper<Op, result_type>(op, return_var, thread_id, detach);
00119   }

template<class result_type>
virtual claraty::bg< result_type >::~bg (  )  [inline, virtual]

Definition at line 121 of file background_thread.h.

00121                 {
00122     if (!detached)
00123       wait();
00124   }


Member Function Documentation

template<class result_type>
virtual void claraty::bg< result_type >::wait (  )  [inline, virtual]

Reimplemented from claraty::BG_Task.

Reimplemented in claraty::auto_bg< ret_type >.

Definition at line 126 of file background_thread.h.

Referenced by claraty::bg< void >::~bg(), and claraty::bg< ret_type >::~bg().

00126                       {
00127     assert(!detached);
00128     ACE_Thread_Manager *tm = ACE_Thread_Manager::instance();
00129     tm->join(thread_id);
00130     detached = true;
00131   }


Member Data Documentation

template<class result_type>
ACE_thread_t claraty::bg< result_type >::thread_id [private]

template<class result_type>
result_type& claraty::bg< result_type >::return_value [private]

Definition at line 103 of file background_thread.h.

template<class result_type>
bool claraty::bg< result_type >::detached [protected]


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