This is the object database (ODB) that keeps track of all live ACE objects. More...
#include <Dump.h>
Classes | |
struct | Tuple |
Public Types | |
enum | { MAX_TABLE_SIZE = 100000 } |
Public Member Functions | |
void | dump_objects (void) |
void | register_object (const ACE_Dumpable *dumper) |
Add the tuple <dumper, this_> to the list of registered ACE objects. | |
void | remove_object (const void *this_) |
Static Public Member Functions | |
static ACE_ODB * | instance (void) |
Interface to the Singleton instance of the object database. | |
Private Member Functions | |
ACE_ODB (void) | |
Private Attributes | |
Tuple | object_table_ [ACE_ODB::MAX_TABLE_SIZE] |
int | current_size_ |
Current size of <object_table_>. | |
Static Private Attributes | |
static ACE_ODB * | instance_ = 0 |
Singleton instance of this class. |
This is the object database (ODB) that keeps track of all live ACE objects.
Definition at line 114 of file Dump.h.
anonymous enum |
Definition at line 118 of file Dump.h.
{MAX_TABLE_SIZE = 100000};
ACE_ODB::ACE_ODB | ( | void | ) | [private] |
Definition at line 50 of file Dump.cpp.
: current_size_ (0) { ACE_TRACE ("ACE_ODB::ACE_ODB"); }
void ACE_ODB::dump_objects | ( | void | ) |
Iterates through the entire set of registered objects and dumps their state.
Definition at line 79 of file Dump.cpp.
{ ACE_TRACE ("ACE_ODB::dump_objects"); for (int i = 0; i < this->current_size_; i++) { if (this->object_table_[i].this_ != 0) // Dump the state of the object. this->object_table_[i].dumper_->dump (); } }
ACE_ODB * ACE_ODB::instance | ( | void | ) | [static] |
Interface to the Singleton instance of the object database.
Definition at line 58 of file Dump.cpp.
{ ACE_TRACE ("ACE_ODB::instance"); if (ACE_ODB::instance_ == 0) { ACE_MT (ACE_Thread_Mutex *lock = ACE_Managed_Object<ACE_Thread_Mutex>::get_preallocated_object (ACE_Object_Manager::ACE_DUMP_LOCK); ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, *lock, 0)); if (ACE_ODB::instance_ == 0) ACE_NEW_RETURN (ACE_ODB::instance_, ACE_ODB, 0); } return ACE_ODB::instance_; }
void ACE_ODB::register_object | ( | const ACE_Dumpable * | dumper | ) |
Add the tuple <dumper, this_> to the list of registered ACE objects.
Definition at line 94 of file Dump.cpp.
{ ACE_TRACE ("ACE_ODB::register_object"); int i; int slot = 0; for (i = 0; i < this->current_size_; i++) { if (this->object_table_[i].this_ == 0) slot = i; else if (this->object_table_[i].this_ == dumper->this_) { slot = i; break; } } if (i == this->current_size_) { slot = this->current_size_++; ACE_ASSERT (this->current_size_ < ACE_ODB::MAX_TABLE_SIZE); } this->object_table_[slot].this_ = dumper->this_; this->object_table_[slot].dumper_ = dumper; }
void ACE_ODB::remove_object | ( | const void * | this_ | ) |
Use <this_> to locate and remove the associated <dumper> from the list of registered ACE objects.
Definition at line 121 of file Dump.cpp.
{ ACE_TRACE ("ACE_ODB::remove_object"); int i; for (i = 0; i < this->current_size_; i++) { if (this->object_table_[i].this_ == this_ptr) break; } if (i < this->current_size_) { this->object_table_[i].this_ = 0; this->object_table_[i].dumper_ = 0; } }
int ACE_ODB::current_size_ [private] |
ACE_ODB * ACE_ODB::instance_ = 0 [static, private] |
Tuple ACE_ODB::object_table_[ACE_ODB::MAX_TABLE_SIZE] [private] |