ACE_Thread_ID Class Reference

Defines a platform-independent thread ID class. Note that this class should be defined within the scope of a thread, rather than at global scope! More...

#include <OS_NS_Thread.h>

List of all members.

Public Member Functions

 ACE_Thread_ID (ACE_thread_t thr_id, ACE_hthread_t thr_handle)
 ACE_Thread_ID (void)
 Initialize the object using calls to ACE_OS::thr_self().

 ACE_Thread_ID (const ACE_Thread_ID &rhs)
 Copy constructor.

ACE_thread_t id (void) const
 Get the thread id.

void id (ACE_thread_t)
 Set the thread id.

ACE_hthread_t handle (void) const
 Get the thread handle.

void handle (ACE_hthread_t)
 Set the thread handle.

void to_string (char *thr_string) const
bool operator== (const ACE_Thread_ID &) const
 Equality operator.

bool operator!= (const ACE_Thread_ID &) const
 Inequality operator.


Private Attributes

ACE_thread_t thread_id_
 Identify the thread.

ACE_hthread_t thread_handle_
 Handle to the thread (typically used to "wait" on Win32).


Detailed Description

Defines a platform-independent thread ID class. Note that this class should be defined within the scope of a thread, rather than at global scope!

Definition at line 675 of file OS_NS_Thread.h.


Constructor & Destructor Documentation

ACE_INLINE ACE_Thread_ID::ACE_Thread_ID ACE_thread_t  thr_id,
ACE_hthread_t  thr_handle
 

Initialize the object using the thread id and thread handle passed as parameters.

Definition at line 3734 of file OS_NS_Thread.inl.

References ACE_hthread_t.

03736   : thread_id_ (thread_id),
03737     thread_handle_ (thread_handle)
03738 {
03739 }

ACE_INLINE ACE_Thread_ID::ACE_Thread_ID void   ) 
 

Initialize the object using calls to ACE_OS::thr_self().

Definition at line 3749 of file OS_NS_Thread.inl.

References ACE_OS::thr_self(), and thread_handle_.

03750   : thread_id_ (ACE_OS::thr_self ())
03751 {
03752   ACE_OS::thr_self (thread_handle_);
03753 }

ACE_INLINE ACE_Thread_ID::ACE_Thread_ID const ACE_Thread_ID rhs  ) 
 

Copy constructor.

Definition at line 3742 of file OS_NS_Thread.inl.

03743   : thread_id_ (id.thread_id_),
03744     thread_handle_ (id.thread_handle_)
03745 {
03746 }


Member Function Documentation

ACE_INLINE void ACE_Thread_ID::handle ACE_hthread_t   ) 
 

Set the thread handle.

Definition at line 3775 of file OS_NS_Thread.inl.

References ACE_hthread_t, and thread_handle_.

03776 {
03777   this->thread_handle_ = thread_handle;
03778 }

ACE_INLINE ACE_hthread_t ACE_Thread_ID::handle void   )  const
 

Get the thread handle.

Definition at line 3769 of file OS_NS_Thread.inl.

References thread_handle_.

03770 {
03771   return this->thread_handle_;
03772 }

ACE_INLINE void ACE_Thread_ID::id ACE_thread_t   ) 
 

Set the thread id.

Definition at line 3763 of file OS_NS_Thread.inl.

References thread_id_.

03764 {
03765   this->thread_id_ = thread_id;
03766 }

ACE_INLINE ACE_thread_t ACE_Thread_ID::id void   )  const
 

Get the thread id.

Definition at line 3757 of file OS_NS_Thread.inl.

References thread_id_.

03758 {
03759   return this->thread_id_;
03760 }

ACE_INLINE bool ACE_Thread_ID::operator!= const ACE_Thread_ID  )  const
 

Inequality operator.

Definition at line 3789 of file OS_NS_Thread.inl.

03790 {
03791   return !(*this == rhs);
03792 }

ACE_INLINE bool ACE_Thread_ID::operator== const ACE_Thread_ID  )  const
 

Equality operator.

Definition at line 3781 of file OS_NS_Thread.inl.

References ACE_OS::thr_cmp(), ACE_OS::thr_equal(), thread_handle_, and thread_id_.

03782 {
03783   return
03784     ACE_OS::thr_cmp (this->thread_handle_, rhs.thread_handle_)
03785     && ACE_OS::thr_equal (this->thread_id_, rhs.thread_id_);
03786 }

void ACE_Thread_ID::to_string char *  thr_string  )  const
 

Referenced by ACE_Utils::UUID_Generator::generateUUID().


Member Data Documentation

ACE_hthread_t ACE_Thread_ID::thread_handle_ [private]
 

Handle to the thread (typically used to "wait" on Win32).

Definition at line 715 of file OS_NS_Thread.h.

Referenced by ACE_Thread_ID(), handle(), and operator==().

ACE_thread_t ACE_Thread_ID::thread_id_ [private]
 

Identify the thread.

Definition at line 712 of file OS_NS_Thread.h.

Referenced by id(), and operator==().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:30:56 2006 for ACE by doxygen 1.3.6