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 678 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 3762 of file OS_NS_Thread.inl.

References ACE_hthread_t.

03764   : thread_id_ (thread_id),
03765     thread_handle_ (thread_handle)
03766 {
03767 }

ACE_INLINE ACE_Thread_ID::ACE_Thread_ID void   ) 
 

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

Definition at line 3777 of file OS_NS_Thread.inl.

References ACE_OS::thr_self(), and thread_handle_.

03778   : thread_id_ (ACE_OS::thr_self ())
03779 {
03780   ACE_OS::thr_self (thread_handle_);
03781 }

ACE_INLINE ACE_Thread_ID::ACE_Thread_ID const ACE_Thread_ID rhs  ) 
 

Copy constructor.

Definition at line 3770 of file OS_NS_Thread.inl.

03771   : thread_id_ (id.thread_id_),
03772     thread_handle_ (id.thread_handle_)
03773 {
03774 }


Member Function Documentation

ACE_INLINE void ACE_Thread_ID::handle ACE_hthread_t   ) 
 

Set the thread handle.

Definition at line 3803 of file OS_NS_Thread.inl.

References ACE_hthread_t, and thread_handle_.

03804 {
03805   this->thread_handle_ = thread_handle;
03806 }

ACE_INLINE ACE_hthread_t ACE_Thread_ID::handle void   )  const
 

Get the thread handle.

Definition at line 3797 of file OS_NS_Thread.inl.

References thread_handle_.

03798 {
03799   return this->thread_handle_;
03800 }

ACE_INLINE void ACE_Thread_ID::id ACE_thread_t   ) 
 

Set the thread id.

Definition at line 3791 of file OS_NS_Thread.inl.

References thread_id_.

03792 {
03793   this->thread_id_ = thread_id;
03794 }

ACE_INLINE ACE_thread_t ACE_Thread_ID::id void   )  const
 

Get the thread id.

Definition at line 3785 of file OS_NS_Thread.inl.

References thread_id_.

03786 {
03787   return this->thread_id_;
03788 }

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

Inequality operator.

Definition at line 3817 of file OS_NS_Thread.inl.

03818 {
03819   return !(*this == rhs);
03820 }

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

Equality operator.

Definition at line 3809 of file OS_NS_Thread.inl.

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

03810 {
03811   return
03812     ACE_OS::thr_cmp (this->thread_handle_, rhs.thread_handle_)
03813     && ACE_OS::thr_equal (this->thread_id_, rhs.thread_id_);
03814 }

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 718 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 715 of file OS_NS_Thread.h.

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


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 12:58:37 2008 for ACE by doxygen 1.3.6