#include <Local_Tokens.h>
Inheritance diagram for ACE_TPQ_Entry:
Public Types | |
typedef void(* | PTVF )(void *) |
Public Member Functions | |
ACE_TPQ_Entry (void) | |
Null constructor. | |
ACE_TPQ_Entry (const ACE_Token_Proxy *proxy, const ACE_TCHAR *client_id) | |
Constructor. | |
ACE_TPQ_Entry (const ACE_TPQ_Entry &rhs) | |
Copy constructor. | |
~ACE_TPQ_Entry (void) | |
Destructor. | |
void | operator= (const ACE_TPQ_Entry &rhs) |
Copy operator use by the queue. | |
ACE_Token_Proxy * | proxy (void) const |
Get top of the queue. | |
void | proxy (ACE_Token_Proxy *) |
Set top of the queue. | |
int | nesting_level (void) const |
Get nesting level of the entry. | |
void | nesting_level (int delta) |
Delta nesting level of the entry. | |
const ACE_TCHAR * | client_id (void) const |
Get client_id of the entry. | |
void | client_id (const ACE_TCHAR *) |
Set client_id of the entry. | |
int | equal_client_id (const ACE_TCHAR *id) |
Returns 1 if id == client id. Does not check for id == 0. | |
void | set (void(*sleep_hook)(void *)) |
One method for arg and sleep_hook. | |
void | sleep_hook (void(*sh)(void *)) |
Set sleep hook of the entry. | |
PTVF | sleep_hook (void) const |
Get sleep hook of the entry. | |
void | call_sleep_hook (void) |
Call the sleep hook function or method passing arg. | |
void | dump (void) const |
Dump the state of the class. | |
int | waiting (void) const |
Get whether this client is blocked waiting for a token. | |
void | waiting (int w) |
Set whether this client is blocked waiting for a token. | |
Public Attributes | |
ACE_TOKEN_CONST::COND_VAR | cond_var_ |
ACE_TOKEN_CONST::MUTEX | lock_ |
ACE_TPQ_Entry * | next_ |
Pointer to next in list. | |
Private Attributes | |
int | waiting_ |
This client is waiting for a token. | |
ACE_Token_Proxy * | proxy_ |
Proxy. | |
int | nesting_level_ |
Nesting level. | |
void * | arg_ |
Arg. | |
ACE_TCHAR | client_id_ [ACE_MAXCLIENTIDLEN] |
Client id. | |
void(* | sleep_hook_ )(void *) |
Sleep hook. | |
Friends | |
class | ACE_Token_Manager |
Not a public interface.
Definition at line 107 of file Local_Tokens.h.
|
Definition at line 111 of file Local_Tokens.h. |
|
Null constructor.
Definition at line 138 of file Local_Tokens.cpp. References ACE_TRACE.
00139 : cond_var_ (lock_), 00140 proxy_ (0), 00141 nesting_level_ (0), 00142 sleep_hook_ (0) 00143 { 00144 ACE_TRACE ("ACE_TPQ_Entry::ACE_TPQ_Entry null const."); 00145 } |
|
Constructor.
Definition at line 104 of file Local_Tokens.cpp. References ACE_LIB_TEXT, ACE_TCHAR, ACE_thread_t, ACE_TRACE, client_id(), ACE_OS::hostname(), MAXHOSTNAMELEN, ACE_Thread::self(), and ACE_OS::sprintf().
00106 : cond_var_ (lock_), 00107 next_ (0), 00108 // This const typecast is safe. 00109 proxy_ ((ACE_Token_Proxy *) new_proxy), 00110 nesting_level_ (0), 00111 sleep_hook_ (0) 00112 { 00113 ACE_TRACE ("ACE_TPQ_Entry::ACE_TPQ_Entry"); 00114 00115 if (client_id != 0) 00116 this->client_id (client_id); 00117 else 00118 { 00119 // Just make sure we have enough space. 00120 ACE_TCHAR host_name[MAXHOSTNAMELEN]; 00121 ACE_TCHAR name[(sizeof host_name / sizeof (ACE_TCHAR)) + 256]; 00122 ACE_OS::hostname (host_name, sizeof host_name); 00123 00124 ACE_thread_t thread_id = ACE_Thread::self (); 00125 00126 // The cast is an attempt to get this to compile (and run, 00127 // hopefully) regardless of the type of ACE_thread_t. 00128 ACE_OS::sprintf (name, 00129 ACE_LIB_TEXT ("/%s/%u/%lu"), 00130 host_name, 00131 static_cast<u_int> (ACE_OS::getpid ()), 00132 *reinterpret_cast<u_long *> (&thread_id)); 00133 00134 this->client_id (name); 00135 } 00136 } |
|
Copy constructor.
Definition at line 147 of file Local_Tokens.cpp. References ACE_TRACE.
|
|
Destructor.
Definition at line 154 of file Local_Tokens.cpp. References ACE_TRACE.
00155 { 00156 ACE_TRACE ("ACE_TPQ_Entry::~ACE_TPQ_Entry"); 00157 } |
|
Call the sleep hook function or method passing arg.
Referenced by ACE_RW_Token::acquire(), and ACE_Mutex_Token::acquire(). |
|
Set client_id of the entry.
Definition at line 172 of file Local_Tokens.cpp. References ACE_MAXCLIENTIDLEN, ACE_TCHAR, ACE_TRACE, and ACE_OS::strsncpy().
00173 { 00174 ACE_TRACE ("ACE_TPQ_Entry::client_id"); 00175 00176 if (id == 0) 00177 return; 00178 00179 ACE_OS::strsncpy (this->client_id_, 00180 (ACE_TCHAR *) id, 00181 ACE_MAXCLIENTIDLEN); 00182 } |
|
|
Dump the state of the class.
Reimplemented in ACE_TSS_TPQ_Entry. Definition at line 81 of file Local_Tokens.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, client_id_, LM_DEBUG, and nesting_level_. Referenced by ACE_Token_Proxy_Queue::dump(), and ACE_TSS_TPQ_Entry::dump().
00082 { 00083 #if defined (ACE_HAS_DUMP) 00084 ACE_TRACE ("ACE_TPQ_Entry::dump"); 00085 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); 00086 ACE_DEBUG ((LM_DEBUG, 00087 ACE_LIB_TEXT ("ACE_TPQ_Entry::dump:\n") 00088 ACE_LIB_TEXT (" nesting_level_ = %d\n") 00089 ACE_LIB_TEXT (" client_id_ = %s\n"), 00090 nesting_level_, 00091 client_id_)); 00092 00093 if (next_ != 0) 00094 { 00095 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("next:.\n"))); 00096 next_->dump (); 00097 } 00098 00099 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("ACE_TPQ_Entry::dump end.\n"))); 00100 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); 00101 #endif /* ACE_HAS_DUMP */ 00102 } |
|
Returns 1 if id == client id. Does not check for id == 0.
Referenced by ACE_RW_Token::is_owner(), ACE_Mutex_Token::is_owner(), ACE_RW_Token::is_waiting_for(), ACE_Mutex_Token::is_waiting_for(), and ACE_Mutex_Token::owners(). |
|
Delta nesting level of the entry.
|
|
Get nesting level of the entry.
Referenced by ACE_RW_Token::acquire(), ACE_Mutex_Token::acquire(), operator=(), ACE_RW_Token::release(), ACE_Mutex_Token::release(), ACE_RW_Token::tryacquire(), and ACE_Mutex_Token::tryacquire(). |
|
Copy operator use by the queue.
Definition at line 160 of file Local_Tokens.cpp. References ACE_TRACE, client_id(), nesting_level(), nesting_level_, proxy(), sleep_hook(), and sleep_hook_.
00161 { 00162 ACE_TRACE ("ACE_TPQ_Entry::operator="); 00163 if (&rhs == this) 00164 return; 00165 this->proxy_ = rhs.proxy (); 00166 this->nesting_level_ = rhs.nesting_level (); 00167 this->client_id (rhs.client_id ()); 00168 this->sleep_hook_ = rhs.sleep_hook (); 00169 } |
|
Set top of the queue.
|
|
|
One method for arg and sleep_hook.
|
|
Get sleep hook of the entry.
|
|
Set sleep hook of the entry.
Referenced by ACE_Token_Proxy::acquire(), operator=(), and ACE_Token_Proxy::tryacquire(). |
|
Set whether this client is blocked waiting for a token.
|
|
Get whether this client is blocked waiting for a token.
|
|
Definition at line 109 of file Local_Tokens.h. |
|
Arg.
Definition at line 189 of file Local_Tokens.h. |
|
Client id.
Reimplemented in ACE_TSS_TPQ_Entry. Definition at line 192 of file Local_Tokens.h. Referenced by dump(). |
|
Definition at line 166 of file Local_Tokens.h. Referenced by ACE_Token_Proxy::acquire(), ACE_Token_Proxy::renew(), and ACE_Token_Proxy::token_acquired(). |
|
Definition at line 167 of file Local_Tokens.h. |
|
Nesting level.
Definition at line 186 of file Local_Tokens.h. Referenced by dump(), and operator=(). |
|
Pointer to next in list.
Definition at line 170 of file Local_Tokens.h. Referenced by ACE_RW_Token::acquire(), ACE_TPQ_Iterator::advance(), ACE_Token_Proxy_Queue::dequeue(), ACE_Token_Proxy_Queue::enqueue(), and ACE_Token_Proxy_Queue::remove(). |
|
Proxy.
Reimplemented in ACE_TSS_TPQ_Entry. Definition at line 183 of file Local_Tokens.h. |
|
Sleep hook.
Referenced by operator=(). |
|
This client is waiting for a token.
Definition at line 180 of file Local_Tokens.h. |