aboutsummaryrefslogtreecommitdiff
path: root/dep/ACE_wrappers/ace/Dump.h
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-17 15:51:44 -0700
committermaximius <none@none>2009-10-17 15:51:44 -0700
commite585187b248f48b3c6e9247b49fa07c6565d65e5 (patch)
tree637c5b7ddacf41040bef4ea4f75a97da64c6a9bc /dep/ACE_wrappers/ace/Dump.h
parent26b5e033ffde3d161382fc9addbfa99738379641 (diff)
*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
Diffstat (limited to 'dep/ACE_wrappers/ace/Dump.h')
-rw-r--r--dep/ACE_wrappers/ace/Dump.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/dep/ACE_wrappers/ace/Dump.h b/dep/ACE_wrappers/ace/Dump.h
index 0bd02f83b83..354b162cfb6 100644
--- a/dep/ACE_wrappers/ace/Dump.h
+++ b/dep/ACE_wrappers/ace/Dump.h
@@ -1,4 +1,5 @@
/* -*- C++ -*- */
+
//=============================================================================
/**
* @file Dump.h
@@ -46,14 +47,19 @@
*/
//=============================================================================
+
#ifndef ACE_DUMP_H
#define ACE_DUMP_H
#include /**/ "ace/pre.h"
+
#include /**/ "ace/ACE_export.h"
+
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
/**
* @class ACE_Dumpable
*
@@ -65,16 +71,21 @@ class ACE_Export ACE_Dumpable
public:
friend class ACE_ODB;
friend class ACE_Dumpable_Ptr;
+
/// Constructor.
ACE_Dumpable (const void *);
+
/// This pure virtual method must be filled in by a subclass.
virtual void dump (void) const = 0;
+
protected:
virtual ~ACE_Dumpable (void);
+
private:
/// Pointer to the object that is being stored.
const void *this_;
};
+
/**
* @class ACE_Dumpable_Ptr
*
@@ -87,11 +98,13 @@ public:
ACE_Dumpable_Ptr (const ACE_Dumpable *dumper = 0);
const ACE_Dumpable *operator->() const;
void operator= (const ACE_Dumpable *dumper) const;
+
private:
/// "Real" pointer to the underlying abstract base class
/// pointer that does the real work.
const ACE_Dumpable *dumper_;
};
+
/**
* @class ACE_ODB
*
@@ -103,22 +116,29 @@ class ACE_Export ACE_ODB
public:
/// @todo This is clearly inadequate and should be dynamic...
enum {MAX_TABLE_SIZE = 100000};
+
/// Iterates through the entire set of registered objects and
/// dumps their state.
void dump_objects (void);
+
/// Add the tuple <dumper, this_> to the list of registered ACE objects.
void register_object (const ACE_Dumpable *dumper);
+
/// Use <this_> to locate and remove the associated <dumper> from the
/// list of registered ACE objects.
void remove_object (const void *this_);
+
/// Interface to the Singleton instance of the object database.
static ACE_ODB *instance (void);
+
private:
ACE_ODB (void); // Ensure we have a Singleton...
+
struct Tuple
{
/// Pointer to the object that is registered.
const void *this_;
+
/// Smart pointer to the ACE_Dumpable object associated with this_.
/// This uses an ACE_Dumpable_Ptr, instead of a bare pointer, to
/// cope with hierarchies of dumpable classes. In such cases we
@@ -128,19 +148,26 @@ private:
/// on destruction of the subobject its handle won't exist anymore
/// and we'll have to check for that).
const ACE_Dumpable_Ptr dumper_;
+
Tuple (void) : dumper_(0) {}
};
+
/// Singleton instance of this class.
static ACE_ODB *instance_;
+
/// The current implementation is very simple-minded and will be
/// changed to be dynamic.
Tuple object_table_[ACE_ODB::MAX_TABLE_SIZE];
+
/// Current size of <object_table_>.
int current_size_;
};
+
ACE_END_VERSIONED_NAMESPACE_DECL
+
// Include the templates classes at this point.
#include "ace/Dump_T.h"
+
#include /**/ "ace/post.h"
#endif /* ACE_DUMP_H */