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

DAQTrackMap Class Reference

Provides methods for tracking objects and memory usage. More...

Inheritance diagram for DAQTrackMap::

List of all members.

Public Methods

 DAQTrackMap ()
 Constructor. More...

 ~DAQTrackMap ()
 Destructor. More...

ostream & Print (ostream &)
 Print this object. More...

bool IsInitialized ()
int Lock ()
 Lock mutex. More...

int TryLock ()
 Try to lock mutex. More...

int UnLock ()
 Try to unlock mutex. More...

bool TestMemory ()
 Test memory map for errors. More...

void PrintMemoryErrors (ostream &)
 Print memory errors. More...

void LogMemoryErrors ()
 Log memory errors. More...


Protected Types

typedef DAQTrackMap::const_iterator DAQTrackMapCI

Protected Methods

void EyeCatcher (ostream &, void *, int)
void PrintEntry (ostream &, DAQTrackMapCI &)
 Print a map entry. More...

void LogEntry (DAQTrackMapCI &)
 Log a map entry. More...


Detailed Description

The DAQTrackMap class provides methods for tracking objects and memory usage in a SpectroDAQ client or server.

This also implements a simple recursive mutex for locking the map such that a deadlock doesn't occur when a locking thread issues a new() resulting in an additional attempt to lock the map.

Author:
Eric Kasten
Version:
0.4.0


Constructor & Destructor Documentation

DAQTrackMap::DAQTrackMap
 

Basic constructor method for this class.

Parameters:
None  
Returns:
this

DAQTrackMap::~DAQTrackMap
 

Destructor method for this class.

Parameters:
None  
Returns:
None


Member Function Documentation

int DAQTrackMap::Lock
 

Attempts to lock the mutex. This method will block if the mutex has been locked by another thread and that thread does not currently own the mutex.

Parameters:
None  
Returns:
When the mutex can be locked by a requesting thread
Return values:
0   if the lock was successful.
<0   if the lock was unsuccessful.

void DAQTrackMap::LogEntry DAQTrackMapCI & p [protected]
 

Log a map entry.

Parameters:
p   Map interator entry.
Returns:
None

void DAQTrackMap::LogMemoryErrors
 

Log the map entries that have memory errors.

Returns:
None.

ostream & DAQTrackMap::Print ostream & aStream
 

Print this object to a stream.

Parameters:
aStream   The ostream to which to print.
Returns:
The ostream.

void DAQTrackMap::PrintEntry ostream & aStream,
DAQTrackMapCI & p
[protected]
 

Print a map entry to an ostream.

Parameters:
aStream   An ostream to which to print the map entry.
p   Map interator entry.
Returns:
None

void DAQTrackMap::PrintMemoryErrors ostream & aStream
 

Print the map entries that have memory errors to an ostream.

Parameters:
aStream   The ostream to which to print.
Returns:
None.

bool DAQTrackMap::TestMemory
 

Test the memory map for errors. If errors are found, return true.

Returns:
If there were memory errors.
Return values:
true   If there were errors.
false   If there were no errors.

int DAQTrackMap::TryLock
 

Attempts to lock the mutex. This method doesn't block if the mutex has been locked by another thread.

Parameters:
None  
Returns:
When the mutex can be locked by a requesting thread
Return values:
0   if the lock was successful.
<0   if the lock was unsuccessful.

int DAQTrackMap::UnLock
 

Attempts to unlock the mutex. Only the owning thread can unlock the mutex.

Parameters:
None  
Returns:
When the mutex can be unlocked by a requesting thread
Return values:
0   if the unlock was successful.
<0   if the unlock was unsuccessful (owned by another thread).


The documentation for this class was generated from the following files:
Generated at Tue Jan 29 14:07:11 2002 for SpectroDAQ by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001