Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# ACE_Base_Thread_Adapter Class Reference

Base class for all the Thread_Adapters. More...

`#include <Base_Thread_Adapter.h>`

Inheritance diagram for ACE_Base_Thread_Adapter:

[legend]
Collaboration diagram for ACE_Base_Thread_Adapter:

[legend]
List of all members.

## Public Methods

| ACE_Base_Thread_Adapter (ACE_THR_FUNC user_func, void *arg, ACE_THR_C_FUNC entry_point=(ACE_THR_C_FUNC) ace_thread_adapter, ACE_OS_Thread_Descriptor *td=0)
| Constructor.
virtual ACE_THR_FUNC_RETURN | invoke (void)=0
| Virtual method invoked by the thread entry point.
ACE_THR_C_FUNC | entry_point (void)

## Static Public Methods

void | close_log_msg (void)
| Invoke the close_log_msg_hook, if it is present.
void | sync_log_msg (const ACE_TCHAR *prog_name)
| Invoke the sync_log_msg_hook, if it is present.
ACE_OS_Thread_Descriptor * | thr_desc_log_msg (void)
| Invoke the thr_desc_log_msg_hook, if it is present.

## Protected Methods

virtual | ~ACE_Base_Thread_Adapter (void)
void | inherit_log_msg (void)

## Protected Attributes

ACE_THR_FUNC | user_func_
| Thread startup function passed in by the user (C++ linkage).
void * | arg_
| Argument to thread startup function.
ACE_THR_C_FUNC | entry_point_
ACE_OS_Thread_Descriptor * | thr_desc_
ACE_OS_Log_Msg_Attributes | log_msg_attributes_
| The ACE_Log_Msg attributes.

## Static Private Methods

void | set_log_msg_hooks (ACE_INIT_LOG_MSG_HOOK init_hook, ACE_INHERIT_LOG_MSG_HOOK inherit_hook, ACE_CLOSE_LOG_MSG_HOOK close_hook, ACE_SYNC_LOG_MSG_HOOK sync_hook, ACE_THR_DESC_LOG_MSG_HOOK thr_desc)
| Set the Log_Msg hooks.

## Static Private Attributes

ACE_INIT_LOG_MSG_HOOK | init_log_msg_hook_ = 0
| The hooks to inherit and cleanup the Log_Msg attributes.
ACE_INHERIT_LOG_MSG_HOOK | inherit_log_msg_hook_ = 0
ACE_CLOSE_LOG_MSG_HOOK | close_log_msg_hook_ = 0
ACE_SYNC_LOG_MSG_HOOK | sync_log_msg_hook_ = 0
ACE_THR_DESC_LOG_MSG_HOOK | thr_desc_log_msg_hook_ = 0

## Friends

class | ACE_Log_Msg
| Allow the ACE_Log_Msg class to set its hooks.
class | ACE_Thread_Adapter_Has_Private_Destructor
| That is usefull for gprof, define itimerval.

## Detailed Description

Base class for all the Thread_Adapters.

Converts a C++ function into a function that can be called from a thread creation routine (e.g., pthread_create() or _beginthreadex()) that expects an extern "C" entry point. This class also makes it possible to transparently provide hooks to register a thread with an ACE_Thread_Manager. This class is used in ACE_OS::thr_create(). In general, the thread that creates an object of this class is different from the thread that calls `invoke()` on this object. Therefore, the `invoke()` method is responsible for deleting itself.

## Constructor & Destructor Documentation

ACE_Base_Thread_Adapter::ACE_Base_Thread_Adapter | ( | ACE_THR_FUNC | user_func,
|  | void * | arg,
|  | ACE_THR_C_FUNC | entry_point = (ACE_THR_C_FUNC) ace_thread_adapter,
|  | ACE_OS_Thread_Descriptor * | td = 0
| ) |

| Constructor.

ACE_Base_Thread_Adapter::~ACE_Base_Thread_Adapter | ( | void |  | ) | `[protected, virtual]`

| Destructor, making it private ensures that objects of this class are allocated on the heap.

## Member Function Documentation

void ACE_Base_Thread_Adapter::close_log_msg | ( | void |  | ) | `[static]`

| Invoke the close_log_msg_hook, if it is present.

ACE_INLINE ACE_THR_C_FUNC ACE_Base_Thread_Adapter::entry_point | ( | void |  | ) |

| Accessor for the C entry point function to the OS thread creation routine.

void ACE_Base_Thread_Adapter::inherit_log_msg | ( | void |  | ) | `[protected]`

| Inherit the logging features if the parent thread has an <ACE_Log_Msg>.

virtual ACE_THR_FUNC_RETURN ACE_Base_Thread_Adapter::invoke | ( | void |  | ) | `[pure virtual]`

| Virtual method invoked by the thread entry point. Implemented in ACE_OS_Thread_Adapter, and ACE_Thread_Adapter.

ACE_INLINE void ACE_Base_Thread_Adapter::set_log_msg_hooks | ( | ACE_INIT_LOG_MSG_HOOK | init_hook,
|  | ACE_INHERIT_LOG_MSG_HOOK | inherit_hook,
|  | ACE_CLOSE_LOG_MSG_HOOK | close_hook,
|  | ACE_SYNC_LOG_MSG_HOOK | sync_hook,
|  | ACE_THR_DESC_LOG_MSG_HOOK | thr_desc
| ) | `[static, private]`

| Set the Log_Msg hooks.

void ACE_Base_Thread_Adapter::sync_log_msg | ( | const ACE_TCHAR * | prog_name | ) | `[static]`

| Invoke the sync_log_msg_hook, if it is present.

ACE_OS_Thread_Descriptor * ACE_Base_Thread_Adapter::thr_desc_log_msg | ( | void |  | ) | `[static]`

| Invoke the thr_desc_log_msg_hook, if it is present.

## Friends And Related Function Documentation

friend class ACE_Log_Msg`[friend]`

| Allow the ACE_Log_Msg class to set its hooks.

friend class ACE_Thread_Adapter_Has_Private_Destructor`[friend]`

| That is usefull for gprof, define itimerval. Friend declaration to avoid compiler warning: only defines a private destructor and has no friends. Reimplemented in ACE_OS_Thread_Adapter, and ACE_Thread_Adapter.

## Member Data Documentation

void* ACE_Base_Thread_Adapter::arg_`[protected]`

| Argument to thread startup function.

ACE_CLOSE_LOG_MSG_HOOK ACE_Base_Thread_Adapter::close_log_msg_hook_ = 0`[static, private]`

ACE_THR_C_FUNC ACE_Base_Thread_Adapter::entry_point_`[protected]`

| Entry point to the underlying OS thread creation call (C linkage).

ACE_INHERIT_LOG_MSG_HOOK ACE_Base_Thread_Adapter::inherit_log_msg_hook_ = 0`[static, private]`

ACE_INIT_LOG_MSG_HOOK ACE_Base_Thread_Adapter::init_log_msg_hook_ = 0`[static, private]`

| The hooks to inherit and cleanup the Log_Msg attributes.

ACE_OS_Log_Msg_Attributes ACE_Base_Thread_Adapter::log_msg_attributes_`[protected]`

| The ACE_Log_Msg attributes.

ACE_SYNC_LOG_MSG_HOOK ACE_Base_Thread_Adapter::sync_log_msg_hook_ = 0`[static, private]`

ACE_OS_Thread_Descriptor* ACE_Base_Thread_Adapter::thr_desc_`[protected]`

| Optional thread descriptor. Passing this pointer in will force the spawned thread to cache this location in <Log_Msg> and wait until <Thread_Manager> fills in all information in thread descriptor.

ACE_THR_DESC_LOG_MSG_HOOK ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ = 0`[static, private]`

ACE_THR_FUNC ACE_Base_Thread_Adapter::user_func_`[protected]`

| Thread startup function passed in by the user (C++ linkage).

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

- /export2/deucetmp/bala/release_try/ACE_wrappers/ace/Base_Thread_Adapter.h
- /export2/deucetmp/bala/release_try/ACE_wrappers/ace/Base_Thread_Adapter.cpp
- /export2/deucetmp/bala/release_try/ACE_wrappers/ace/Base_Thread_Adapter.inl