Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Tokens Class Reference

Abstract representation of ACE tokens. More...

`#include <Local_Tokens.h>`

Inheritance diagram for ACE_Tokens:

[legend]
Collaboration diagram for ACE_Tokens:

[legend]
List of all members.

## Public Types
typedef ACE_Unbounded_Stack< ACE_TPQ_Entry *> | OWNER_STACK
| Stack of owners. More...
enum | TOKEN_TYPES { MUTEX, RWLOCK }
| These are the Token types supported by the library at ship time. More...
## Public Methods
| ACE_Tokens (void)
| Null constructor. More...
virtual | ~ACE_Tokens (void)
| Destructor. More...
virtual int | acquire (ACE_TPQ_Entry *caller, int ignore_deadlock, int notify)=0
| No implementation. More...
virtual int | tryacquire (ACE_TPQ_Entry *caller)=0
| No implementation. More...
virtual int | renew (ACE_TPQ_Entry *caller, int requeue_position)=0
| No implementation. More...
virtual int | release (ACE_TPQ_Entry *caller)=0
| No implementation. More...
void | make_owner (ACE_TPQ_Entry *caller)
| Move the caller to the front of the waiter list. This is for use with remote mutexes and shadow mutexes. More...
void | remove (ACE_TPQ_Entry *caller)
| Remove the caller from the waiter list. More...
virtual int | owners (OWNER_STACK &o, const ACE_TCHAR *id)=0
| Returns a stack of the current owners. Returns -1 on error, 0 on success. If <id> is non-zero, returns 1 if id is an owner. More...
virtual int | is_waiting_for (const ACE_TCHAR *id)=0
| Returns 1 if <id> is waiting for this token. 0 otherwise. More...
virtual int | is_owner (const ACE_TCHAR *id)=0
| Returns 1 if <id> is an owner of this token. 0 otherwise. More...
virtual ACE_Token_Proxy_Queue * | waiters (void)
| Return the queue of waiters. More...
virtual int | no_of_waiters (void)
| Return the number of proxies that are currently waiting to get the token. More...
const ACE_TCHAR * | owner_id (void)
| The current owner. More...
const ACE_TCHAR * | name (void)
| Token name. More...
void | inc_reference (void)
int | dec_reference (void)
void | dump (void) const
| Dump the state of the class. More...
virtual int | type (void) const=0
| Provides a manual RTTI mechanism. More...
void | visit (int v)
| Mark or unmark the token as visited. More...
int | visited (void)
| Check if the token has been visited. More...
ACE_TPQ_Entry * | owner (void)
| All the data of the current owner. More...
## Protected Attributes
int | visited_
| For the deadlock detection algorithm. More...
int | reference_count_
| Reference count. More...
ACE_Token_Proxy_Queue | waiters_
| List of client's owning and waiting the token. More...
ACE_TCHAR | token_name_ [ACE_MAXTOKENNAMELEN]
| Name of token. More...

## Detailed Description

Abstract representation of ACE tokens.

Not a public interface. Currently, I don't see a reason for providing an abstract interface at this level of the library. As of yet, no one uses <ACE_Tokens> derivatives through this abstract interface except for <ACE_Token_Manager>. It only uses the statistical methods which are shared by all Tokens. For that reason, it still makes since to have a common base class. However, acquire, renew, and release do not need to have matching interfaces throughout all Tokens. To add a new type of token (e.g. semaphore), this class must be subtyped to define the new semantics. See <ACE_Token_Manager> for details.

## Member Typedef Documentation

typedef ACE_Unbounded_Stack<ACE_TPQ_Entry *> ACE_Tokens::OWNER_STACK

| Stack of owners.

## Member Enumeration Documentation

enum ACE_Tokens::TOKEN_TYPES

  | These are the Token types supported by the library at ship time. There is no restriction on the number of Token types added by "3rd parties." These are only necessary for the Token Server. Enumeration values:
  MUTEX |
  RWLOCK |

## Constructor & Destructor Documentation

ACE_Tokens::ACE_Tokens | ( | void |  | ) |

| Null constructor.

virtual ACE_Tokens::~ACE_Tokens | ( | void |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

virtual int ACE_Tokens::acquire | ( | ACE_TPQ_Entry * | caller,
|  | int | ignore_deadlock,
|  | int | notify
| ) | `[pure virtual]`

| No implementation. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

int ACE_Tokens::dec_reference | ( | void |  | ) |

void ACE_Tokens::dump | ( | void |  | ) | const

| Dump the state of the class. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

void ACE_Tokens::inc_reference | ( | void |  | ) |

virtual int ACE_Tokens::is_owner | ( | const ACE_TCHAR * | id | ) | `[pure virtual]`

| Returns 1 if <id> is an owner of this token. 0 otherwise. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

virtual int ACE_Tokens::is_waiting_for | ( | const ACE_TCHAR * | id | ) | `[pure virtual]`

| Returns 1 if <id> is waiting for this token. 0 otherwise. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

void ACE_Tokens::make_owner | ( | ACE_TPQ_Entry * | caller | ) |

| Move the caller to the front of the waiter list. This is for use with remote mutexes and shadow mutexes.

const ACE_TCHAR* ACE_Tokens::name | ( | void |  | ) |

| Token name.

virtual int ACE_Tokens::no_of_waiters | ( | void |  | ) | `[virtual]`

| Return the number of proxies that are currently waiting to get the token.

ACE_TPQ_Entry* ACE_Tokens::owner | ( | void |  | ) |

| All the data of the current owner.

const ACE_TCHAR* ACE_Tokens::owner_id | ( | void |  | ) |

| The current owner.

virtual int ACE_Tokens::owners | ( | OWNER_STACK & | stack,
|  | const ACE_TCHAR * | id
| ) | `[pure virtual]`

| Returns a stack of the current owners. Returns -1 on error, 0 on success. If <id> is non-zero, returns 1 if id is an owner. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

virtual int ACE_Tokens::release | ( | ACE_TPQ_Entry * | caller | ) | `[pure virtual]`

| No implementation. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

void ACE_Tokens::remove | ( | ACE_TPQ_Entry * | caller | ) |

| Remove the caller from the waiter list.

virtual int ACE_Tokens::renew | ( | ACE_TPQ_Entry * | caller,
|  | int | requeue_position
| ) | `[pure virtual]`

| No implementation. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

virtual int ACE_Tokens::tryacquire | ( | ACE_TPQ_Entry * | caller | ) | `[pure virtual]`

| No implementation. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

virtual int ACE_Tokens::type | ( | void |  | ) | const`[pure virtual]`

| Provides a manual RTTI mechanism. This method is used only by ACE_Token_Request so that the type of a token can be sent to a remote Token Server. Reimplemented in ACE_Mutex_Token, and ACE_RW_Token.

void ACE_Tokens::visit | ( | int | v | ) |

| Mark or unmark the token as visited.

int ACE_Tokens::visited | ( | void |  | ) |

| Check if the token has been visited.

virtual ACE_Token_Proxy_Queue* ACE_Tokens::waiters | ( | void |  | ) | `[virtual]`

| Return the queue of waiters.

## Member Data Documentation

int ACE_Tokens::reference_count_`[protected]`

| Reference count.

ACE_TCHAR ACE_Tokens::token_name_[ACE_MAXTOKENNAMELEN]`[protected]`

| Name of token.

int ACE_Tokens::visited_`[protected]`

| For the deadlock detection algorithm.

ACE_Token_Proxy_Queue ACE_Tokens::waiters_`[protected]`

| List of client's owning and waiting the token.

The documentation for this class was generated from the following files:

- Local_Tokens.h
- Local_Tokens.cpp