ACE 8.0.5
Loading...
Searching...
No Matches
ACE_Token_Invariant_Manager Class Reference

Token Invariants. More...

#include <Token_Invariants.h>

Inheritance diagram for ACE_Token_Invariant_Manager:
Collaboration diagram for ACE_Token_Invariant_Manager:

Public Member Functions

int acquired (const ACE_Token_Proxy *proxy)
void releasing (const ACE_Token_Proxy *proxy)
 Updates internal database.
int mutex_acquired (const ACE_TCHAR *token_name)
void mutex_releasing (const ACE_TCHAR *token_name)
 Updates internal database.
int reader_acquired (const ACE_TCHAR *token_name)
int writer_acquired (const ACE_TCHAR *token_name)
void rwlock_releasing (const ACE_TCHAR *token_name)
 Updates internal database.
void dump () const
 Dump the state of the class.
 ACE_Token_Invariant_Manager ()
 Prevent non-singleton construction.
virtual ~ACE_Token_Invariant_Manager ()
 Destruction.
Public Member Functions inherited from ACE_Cleanup
 ACE_Cleanup ()
 No-op constructor.
virtual ~ACE_Cleanup ()=default
 Destructor.
virtual void cleanup (void *param=nullptr)
 Cleanup method that, by default, simply deletes itself.

Static Public Member Functions

static ACE_Token_Invariant_Managerinstance ()
 Singleton access point.

Protected Types

typedef ACE_Token_Name TOKEN_NAME
 This may be changed to a template type.
typedef ACE_Map_Manager< TOKEN_NAME, ACE_Mutex_Invariants *, ACE_Null_MutexMUTEX_COLLECTION
 COLLECTION maintains a mapping from token names to mutexes.
typedef ACE_Map_Manager< TOKEN_NAME, ACE_RWLock_Invariants *, ACE_Null_MutexRWLOCK_COLLECTION
 COLLECTION maintains a mapping from token names to mutexes.

Protected Member Functions

int get_mutex (const ACE_TCHAR *token_name, ACE_Mutex_Invariants *&inv)
 Return or create.
int get_rwlock (const ACE_TCHAR *token_name, ACE_RWLock_Invariants *&inv)
 Return or create.

Protected Attributes

ACE_TOKEN_CONST::MUTEX lock_
 ACE_Mutex_Token used to lock internal data structures.
MUTEX_COLLECTION mutex_collection_
 MUTEX_COLLECTION maintains a mapping from token names to mutexes.
RWLOCK_COLLECTION rwlock_collection_
 MUTEX_COLLECTION maintains a mapping from token names to mutexes.

Static Protected Attributes

static ACE_Token_Invariant_Managerinstance_ = 0
 Singleton pointer.

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

◆ MUTEX_COLLECTION

COLLECTION maintains a mapping from token names to mutexes.

◆ RWLOCK_COLLECTION

COLLECTION maintains a mapping from token names to mutexes.

◆ TOKEN_NAME

This may be changed to a template type.

Constructor & Destructor Documentation

◆ ACE_Token_Invariant_Manager()

ACE_Token_Invariant_Manager::ACE_Token_Invariant_Manager ( )

Prevent non-singleton construction.

◆ ~ACE_Token_Invariant_Manager()

ACE_Token_Invariant_Manager::~ACE_Token_Invariant_Manager ( )
virtual

Destruction.

Member Function Documentation

◆ acquired()

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.

◆ dump()

void ACE_Token_Invariant_Manager::dump ( ) const

Dump the state of the class.

◆ get_mutex()

int ACE_Token_Invariant_Manager::get_mutex ( const ACE_TCHAR * token_name,
ACE_Mutex_Invariants *& inv )
protected

Return or create.

◆ get_rwlock()

int ACE_Token_Invariant_Manager::get_rwlock ( const ACE_TCHAR * token_name,
ACE_RWLock_Invariants *& inv )
protected

Return or create.

◆ instance()

ACE_Token_Invariant_Manager * ACE_Token_Invariant_Manager::instance ( )
static

Singleton access point.

◆ mutex_acquired()

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.

◆ mutex_releasing()

void ACE_Token_Invariant_Manager::mutex_releasing ( const ACE_TCHAR * token_name)

Updates internal database.

◆ reader_acquired()

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.

◆ releasing()

void ACE_Token_Invariant_Manager::releasing ( const ACE_Token_Proxy * proxy)

Updates internal database.

◆ rwlock_releasing()

void ACE_Token_Invariant_Manager::rwlock_releasing ( const ACE_TCHAR * token_name)

Updates internal database.

◆ writer_acquired()

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

◆ instance_

ACE_Token_Invariant_Manager * ACE_Token_Invariant_Manager::instance_ = 0
staticprotected

Singleton pointer.

◆ lock_

ACE_TOKEN_CONST::MUTEX ACE_Token_Invariant_Manager::lock_
protected

ACE_Mutex_Token used to lock internal data structures.

◆ mutex_collection_

MUTEX_COLLECTION ACE_Token_Invariant_Manager::mutex_collection_
protected

MUTEX_COLLECTION maintains a mapping from token names to mutexes.

◆ rwlock_collection_

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: