#include <Local_Tokens.h>
Inheritance diagram for ACE_TPQ_Entry:


Public Types | |
| typedef void(* | PTVF )(void *) |
Public Methods | |
| ACE_TPQ_Entry (void) | |
| Null constructor. More... | |
| ACE_TPQ_Entry (const ACE_Token_Proxy *proxy, const ACE_TCHAR *client_id) | |
| Constructor. More... | |
| ACE_TPQ_Entry (const ACE_TPQ_Entry &rhs) | |
| Copy constructor. More... | |
| ~ACE_TPQ_Entry (void) | |
| Destructor. More... | |
| void | operator= (const ACE_TPQ_Entry &rhs) |
| Copy operator use by the queue. More... | |
| ACE_Token_Proxy * | proxy (void) const |
| Get top of the queue. More... | |
| void | proxy (ACE_Token_Proxy *) |
| Set top of the queue. More... | |
| int | nesting_level (void) const |
| Get nesting level of the entry. More... | |
| void | nesting_level (int delta) |
| Delta nesting level of the entry. More... | |
| const ACE_TCHAR * | client_id (void) const |
| Get client_id of the entry. More... | |
| void | client_id (const ACE_TCHAR *) |
| Set client_id of the entry. More... | |
| int | equal_client_id (const ACE_TCHAR *id) |
| Returns 1 if id == client id. Does not check for id == 0. More... | |
| void | set (void(*sleep_hook)(void *)) |
| One method for arg and sleep_hook. More... | |
| void | sleep_hook (void(*sh)(void *)) |
| Set sleep hook of the entry. More... | |
| PTVF | sleep_hook (void) const |
| Get sleep hook of the entry. More... | |
| void | call_sleep_hook (void) |
| Call the sleep hook function or method passing arg. More... | |
| void | dump (void) const |
| Dump the state of the class. More... | |
| int | waiting (void) const |
| Get whether this client is blocked waiting for a token. More... | |
| void | waiting (int w) |
| Set whether this client is blocked waiting for a token. More... | |
Public Attributes | |
| ACE_TOKEN_CONST::COND_VAR | cond_var_ |
| ACE_TOKEN_CONST::MUTEX | lock_ |
| ACE_TPQ_Entry * | next_ |
| Pointer to next in list. More... | |
Private Attributes | |
| int | waiting_ |
| This client is waiting for a token. More... | |
| ACE_Token_Proxy * | proxy_ |
| Proxy. More... | |
| int | nesting_level_ |
| Nesting level. More... | |
| void * | arg_ |
| Arg. More... | |
| ACE_TCHAR | client_id_ [ACE_MAXCLIENTIDLEN] |
| Client id. More... | |
| void(* | sleep_hook_ )(void *) |
| Sleep hook. More... | |
Friends | |
| class | ACE_Token_Manager |
Not a public interface.
Definition at line 102 of file Local_Tokens.h.
|
|
Definition at line 106 of file Local_Tokens.h. |
|
|
Null constructor.
Definition at line 112 of file Local_Tokens.cpp. References ACE_TRACE.
00113 : cond_var_ (lock_), 00114 proxy_ (0), 00115 nesting_level_ (0), 00116 sleep_hook_ (0) 00117 { 00118 ACE_TRACE ("ACE_TPQ_Entry::ACE_TPQ_Entry null const."); 00119 } |
|
||||||||||||
|
Constructor.
Definition at line 78 of file Local_Tokens.cpp. References ACE_LIB_TEXT, ACE_TCHAR, ACE_thread_t, ACE_TRACE, client_id, ACE_OS::getpid, ACE_OS::hostname, MAXHOSTNAMELEN, ACE_Thread::self, and ACE_OS::sprintf.
00080 : cond_var_ (lock_), 00081 next_ (0), 00082 // This const typecast is safe. 00083 proxy_ ((ACE_Token_Proxy *) new_proxy), 00084 nesting_level_ (0), 00085 sleep_hook_ (0) 00086 { 00087 ACE_TRACE ("ACE_TPQ_Entry::ACE_TPQ_Entry"); 00088 00089 if (client_id != 0) 00090 this->client_id (client_id); 00091 else 00092 { 00093 // Just make sure we have enough space. 00094 ACE_TCHAR host_name[MAXHOSTNAMELEN]; 00095 ACE_TCHAR name[(sizeof host_name / sizeof (ACE_TCHAR)) + 256]; 00096 ACE_OS::hostname (host_name, sizeof host_name); 00097 00098 ACE_thread_t thread_id = ACE_Thread::self (); 00099 00100 // The cast is an attempt to get this to compile (and run, 00101 // hopefully) regardless of the type of ACE_thread_t. 00102 ACE_OS::sprintf (name, 00103 ACE_LIB_TEXT ("/%s/%u/%lu"), 00104 host_name, 00105 ACE_static_cast (u_int, ACE_OS::getpid ()), 00106 *ACE_reinterpret_cast (u_long *, &thread_id)); 00107 00108 this->client_id (name); 00109 } 00110 } |
|
|
Copy constructor.
Definition at line 121 of file Local_Tokens.cpp. References ACE_TRACE.
|
|
|
Destructor.
Definition at line 128 of file Local_Tokens.cpp. References ACE_TRACE.
00129 {
00130 ACE_TRACE ("ACE_TPQ_Entry::~ACE_TPQ_Entry");
00131 }
|
|
|
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 146 of file Local_Tokens.cpp. References ACE_MAXCLIENTIDLEN, ACE_TCHAR, ACE_TRACE, and ACE_OS_String::strsncpy.
00147 {
00148 ACE_TRACE ("ACE_TPQ_Entry::client_id");
00149
00150 if (id == 0)
00151 return;
00152
00153 ACE_OS::strsncpy (this->client_id_,
00154 (ACE_TCHAR *) id,
00155 ACE_MAXCLIENTIDLEN);
00156 }
|
|
|
|
Dump the state of the class.
Reimplemented in ACE_TSS_TPQ_Entry. Definition at line 57 of file Local_Tokens.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, client_id_, LM_DEBUG, nesting_level_, and next_. Referenced by ACE_Token_Proxy_Queue::dump, and ACE_TSS_TPQ_Entry::dump.
00058 {
00059 ACE_TRACE ("ACE_TPQ_Entry::dump");
00060 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00061 ACE_DEBUG ((LM_DEBUG,
00062 ACE_LIB_TEXT ("ACE_TPQ_Entry::dump:\n")
00063 ACE_LIB_TEXT (" nesting_level_ = %d\n")
00064 ACE_LIB_TEXT (" client_id_ = %s\n"),
00065 nesting_level_,
00066 client_id_));
00067
00068 if (next_ != 0)
00069 {
00070 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("next:.\n")));
00071 next_->dump ();
00072 }
00073
00074 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("ACE_TPQ_Entry::dump end.\n")));
00075 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00076 }
|
|
|
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 134 of file Local_Tokens.cpp. References ACE_TRACE, client_id, nesting_level, nesting_level_, proxy, proxy_, sleep_hook, and sleep_hook_.
00135 {
00136 ACE_TRACE ("ACE_TPQ_Entry::operator=");
00137 if (&rhs == this)
00138 return;
00139 this->proxy_ = rhs.proxy ();
00140 this->nesting_level_ = rhs.nesting_level ();
00141 this->client_id (rhs.client_id ());
00142 this->sleep_hook_ = rhs.sleep_hook ();
00143 }
|
|
|
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 104 of file Local_Tokens.h. |
|
|
Arg.
Definition at line 184 of file Local_Tokens.h. |
|
|
Client id.
Reimplemented in ACE_TSS_TPQ_Entry. Definition at line 187 of file Local_Tokens.h. Referenced by dump. |
|
|
Definition at line 161 of file Local_Tokens.h. Referenced by ACE_Token_Proxy::acquire, ACE_Token_Proxy::renew, and ACE_Token_Proxy::token_acquired. |
|
|
Definition at line 162 of file Local_Tokens.h. |
|
|
Nesting level.
Definition at line 181 of file Local_Tokens.h. |
|
|
Pointer to next in list.
Definition at line 165 of file Local_Tokens.h. Referenced by ACE_RW_Token::acquire, ACE_TPQ_Iterator::advance, ACE_Token_Proxy_Queue::dequeue, dump, ACE_Token_Proxy_Queue::enqueue, and ACE_Token_Proxy_Queue::remove. |
|
|
Proxy.
Reimplemented in ACE_TSS_TPQ_Entry. Definition at line 178 of file Local_Tokens.h. Referenced by operator=. |
|
|
Sleep hook.
Referenced by operator=. |
|
|
This client is waiting for a token.
Definition at line 175 of file Local_Tokens.h. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002