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

# ACE_Token_Invariant_Manager Class Reference

Token Invariants. More...

`#include <Token_Invariants.h>`

Inheritance diagram for ACE_Token_Invariant_Manager:

[legend]
Collaboration diagram for ACE_Token_Invariant_Manager:

[legend]
List of all members.

## Public Methods
int | acquired (const ACE_Token_Proxy *proxy)
| Returns 1 on success, 0 when an invariant has been violated and -1 on error. More...
void | releasing (const ACE_Token_Proxy *proxy)
| Updates internal database. More...
int | mutex_acquired (const ACE_TCHAR *token_name)
| Returns 1 on success, 0 when an invariant has been violated and -1 on error. More...
void | mutex_releasing (const ACE_TCHAR *token_name)
| Updates internal database. More...
int | reader_acquired (const ACE_TCHAR *token_name)
| Returns 1 on success, 0 when an invariant has been violated and -1 on error. More...
int | writer_acquired (const ACE_TCHAR *token_name)
| Returns 1 on success, 0 when an invariant has been violated and -1 on error. More...
void | rwlock_releasing (const ACE_TCHAR *token_name)
| Updates internal database. More...
void | dump (void) const
| Dump the state of the class. More...
| ACE_Token_Invariant_Manager (void)
| Prevent non-singleton construction. More...
virtual | ~ACE_Token_Invariant_Manager (void)
| Destruction. More...
## Static Public Methods
ACE_Token_Invariant_Manager * | instance (void)
| Singleton access point. More...
## Protected Types
typedef ACE_Token_Name | TOKEN_NAME
| This may be changed to a template type. More...
typedef ACE_Map_Manager< TOKEN_NAME, ACE_Mutex_Invariants *, ACE_Null_Mutex > | MUTEX_COLLECTION
| COLLECTION maintains a mapping from token names to mutexes. More...
typedef ACE_Map_Iterator< TOKEN_NAME, ACE_Mutex_Invariants *, ACE_Null_Mutex > | MUTEX_COLLECTION_ITERATOR
| Allows iterations through collection. More...
typedef ACE_Map_Entry< TOKEN_NAME, ACE_Mutex_Invariants *> | MUTEX_COLLECTION_ENTRY
| Allows iterations through collection. More...
typedef ACE_Map_Manager< TOKEN_NAME, ACE_RWLock_Invariants *, ACE_Null_Mutex > | RWLOCK_COLLECTION
| COLLECTION maintains a mapping from token names to mutexes. More...
typedef ACE_Map_Iterator< TOKEN_NAME, ACE_RWLock_Invariants *, ACE_Null_Mutex > | RWLOCK_COLLECTION_ITERATOR
| Allows iterations through collection. More...
typedef ACE_Map_Entry< TOKEN_NAME, ACE_RWLock_Invariants *> | RWLOCK_COLLECTION_ENTRY
| Allows iterations through collection. More...
## Protected Methods
int | get_mutex (const ACE_TCHAR *token_name, ACE_Mutex_Invariants *&inv)
| Return or create. More...
int | get_rwlock (const ACE_TCHAR *token_name, ACE_RWLock_Invariants *&inv)
| Return or create. More...
## Protected Attributes
ACE_TOKEN_CONST::MUTEX | lock_
| ACE_Mutex_Token used to lock internal data structures. More...
MUTEX_COLLECTION | mutex_collection_
| MUTEX_COLLECTION maintains a mapping from token names to mutexes. More...
RWLOCK_COLLECTION | rwlock_collection_
| MUTEX_COLLECTION maintains a mapping from token names to mutexes. More...
## Static Protected Attributes
ACE_Token_Invariant_Manager * | instance_ = 0
| Singleton pointer. More...

## Detailed Description

Token Invariants.

The Token Invariant Manager allows applications to test that invariants are always satisfied. Currently, Token_Invariants can test mutexes and readers/writer locks. Does not test recursive acquisition. Note that this class does not ever clean its database. Until destroyed, it's size will forever increase.

## Member Typedef Documentation

typedef ACE_Map_Manager<TOKEN_NAME, ACE_Mutex_Invariants *, ACE_Null_Mutex> ACE_Token_Invariant_Manager::MUTEX_COLLECTION`[protected]`

| COLLECTION maintains a mapping from token names to mutexes.

typedef ACE_Map_Entry<TOKEN_NAME, ACE_Mutex_Invariants *> ACE_Token_Invariant_Manager::MUTEX_COLLECTION_ENTRY`[protected]`

| Allows iterations through collection.

typedef ACE_Map_Iterator<TOKEN_NAME, ACE_Mutex_Invariants *, ACE_Null_Mutex> ACE_Token_Invariant_Manager::MUTEX_COLLECTION_ITERATOR`[protected]`

| Allows iterations through collection.

typedef ACE_Map_Manager<TOKEN_NAME, ACE_RWLock_Invariants *, ACE_Null_Mutex> ACE_Token_Invariant_Manager::RWLOCK_COLLECTION`[protected]`

| COLLECTION maintains a mapping from token names to mutexes.

typedef ACE_Map_Entry<TOKEN_NAME, ACE_RWLock_Invariants *> ACE_Token_Invariant_Manager::RWLOCK_COLLECTION_ENTRY`[protected]`

| Allows iterations through collection.

typedef ACE_Map_Iterator<TOKEN_NAME, ACE_RWLock_Invariants *, ACE_Null_Mutex> ACE_Token_Invariant_Manager::RWLOCK_COLLECTION_ITERATOR`[protected]`

| Allows iterations through collection.

typedef ACE_Token_Name ACE_Token_Invariant_Manager::TOKEN_NAME`[protected]`

| This may be changed to a template type.

## Constructor & Destructor Documentation

ACE_Token_Invariant_Manager::ACE_Token_Invariant_Manager | ( | void |  | ) |

| Prevent non-singleton construction.

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

| Destruction.

## Member Function Documentation

int ACE_Token_Invariant_Manager::acquired | ( | const ACE_Token_Proxy * | proxy | ) |

| Returns 1 on success, 0 when an invariant has been violated and -1 on error.

void ACE_Token_Invariant_Manager::dump | ( | void |  | ) | const

| Dump the state of the class.

int ACE_Token_Invariant_Manager::get_mutex | ( | const ACE_TCHAR * | token_name,
|  | ACE_Mutex_Invariants *& | inv
| ) | `[protected]`

| Return or create.

int ACE_Token_Invariant_Manager::get_rwlock | ( | const ACE_TCHAR * | token_name,
|  | ACE_RWLock_Invariants *& | inv
| ) | `[protected]`

| Return or create.

ACE_Token_Invariant_Manager * ACE_Token_Invariant_Manager::instance | ( | void |  | ) | `[static]`

| Singleton access point.

int ACE_Token_Invariant_Manager::mutex_acquired | ( | const ACE_TCHAR * | token_name | ) |

| Returns 1 on success, 0 when an invariant has been violated and -1 on error.

void ACE_Token_Invariant_Manager::mutex_releasing | ( | const ACE_TCHAR * | token_name | ) |

| Updates internal database.

int ACE_Token_Invariant_Manager::reader_acquired | ( | const ACE_TCHAR * | token_name | ) |

| Returns 1 on success, 0 when an invariant has been violated and -1 on error.

void ACE_Token_Invariant_Manager::releasing | ( | const ACE_Token_Proxy * | proxy | ) |

| Updates internal database.

void ACE_Token_Invariant_Manager::rwlock_releasing | ( | const ACE_TCHAR * | token_name | ) |

| Updates internal database.

int ACE_Token_Invariant_Manager::writer_acquired | ( | const ACE_TCHAR * | token_name | ) |

| Returns 1 on success, 0 when an invariant has been violated and -1 on error.

## Member Data Documentation

ACE_Token_Invariant_Manager * ACE_Token_Invariant_Manager::instance_ = 0`[static, protected]`

| Singleton pointer.

ACE_TOKEN_CONST::MUTEX ACE_Token_Invariant_Manager::lock_`[protected]`

| ACE_Mutex_Token used to lock internal data structures.

MUTEX_COLLECTION ACE_Token_Invariant_Manager::mutex_collection_`[protected]`

| MUTEX_COLLECTION maintains a mapping from token names to mutexes.

RWLOCK_COLLECTION ACE_Token_Invariant_Manager::rwlock_collection_`[protected]`

| MUTEX_COLLECTION maintains a mapping from token names to mutexes.

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

- Token_Invariants.h
- Token_Invariants.cpp