#include <TP_Reactor.h>
Public Member Functions | |
ACE_TP_Token_Guard (ACE_Select_Reactor_Token &token) | |
Constructor that will grab the token for us. | |
~ACE_TP_Token_Guard (void) | |
void | release_token (void) |
Release the token .. | |
bool | is_owner (void) |
int | acquire_read_token (ACE_Time_Value *max_wait_time=0) |
int | acquire_token (ACE_Time_Value *max_wait_time=0) |
Private Member Functions | |
ACE_TP_Token_Guard (void) | |
ACE_TP_Token_Guard (const ACE_TP_Token_Guard &) | |
ACE_TP_Token_Guard & | operator= (const ACE_TP_Token_Guard &) |
Private Attributes | |
ACE_Select_Reactor_Token & | token_ |
The Select Reactor token. | |
bool | owner_ |
In short, this class will be owned by one thread by creating on the stack. This class gives the status of the ownership of the token and manages the ownership
ACE_INLINE ACE_TP_Token_Guard::ACE_TP_Token_Guard | ( | ACE_Select_Reactor_Token & | token | ) |
Constructor that will grab the token for us.
ACE_INLINE ACE_TP_Token_Guard::~ACE_TP_Token_Guard | ( | void | ) |
Destructor. This will release the token if it hasnt been released till this point
ACE_TP_Token_Guard::ACE_TP_Token_Guard | ( | void | ) | [private] |
ACE_TP_Token_Guard::ACE_TP_Token_Guard | ( | const ACE_TP_Token_Guard & | ) | [private] |
ACE_INLINE void ACE_TP_Token_Guard::release_token | ( | void | ) |
Release the token ..
ACE_INLINE bool ACE_TP_Token_Guard::is_owner | ( | void | ) |
Returns whether the thread that created this object ownes the token or not.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL int ACE_TP_Token_Guard::acquire_read_token | ( | ACE_Time_Value * | max_wait_time = 0 |
) |
A helper method that grabs the token for us, after which the thread that owns that can do some actual work.
int ACE_TP_Token_Guard::acquire_token | ( | ACE_Time_Value * | max_wait_time = 0 |
) |
A helper method that grabs the token for us, after which the thread that owns that can do some actual work. This differs from acquire_read_token() as it uses acquire () to get the token instead of acquire_read ()
ACE_TP_Token_Guard& ACE_TP_Token_Guard::operator= | ( | const ACE_TP_Token_Guard & | ) | [private] |
The Select Reactor token.
bool ACE_TP_Token_Guard::owner_ [private] |
Flag that indicate whether the thread that created this object owns the token or not. A value of false indicates that this class hasnt got the token (and hence the thread) and a value of true vice-versa.