summaryrefslogtreecommitdiff
path: root/modules/CIAO/tools/Config_Handlers/Dump_Obj.h
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 21:15:18 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 21:15:18 +0000
commitb71531b42b3325fd6079a7039aae8641262c8adf (patch)
treea5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/tools/Config_Handlers/Dump_Obj.h
parenta0f67cc97c0050d907145e312135b60c0125e56e (diff)
downloadATCD-b71531b42b3325fd6079a7039aae8641262c8adf.tar.gz
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/tools/Config_Handlers/Dump_Obj.h')
-rw-r--r--modules/CIAO/tools/Config_Handlers/Dump_Obj.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/modules/CIAO/tools/Config_Handlers/Dump_Obj.h b/modules/CIAO/tools/Config_Handlers/Dump_Obj.h
new file mode 100644
index 00000000000..d8e90351ad1
--- /dev/null
+++ b/modules/CIAO/tools/Config_Handlers/Dump_Obj.h
@@ -0,0 +1,76 @@
+//==================================================================
+/**
+* @file Dump_Obj.h
+*
+* $Id$
+*
+* @author Gan Deng <gan.deng@vanderbilt.edu>
+*/
+//=====================================================================
+
+#ifndef CIAO_DUMP_OBJ_H
+#define CIAO_DUMP_OBJ_H
+#include /**/ "ace/pre.h"
+
+#include "ciao/DeploymentC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Config_Handlers_Export.h"
+#include <string>
+#include <map>
+
+namespace Deployment
+{
+/*
+* @brief class Dump_Obj handles the indentation and keeps a map of
+* structures for reference look-up.
+*/
+class Config_Handlers_Export Dump_Obj
+{
+public:
+/// Exception thrown when there is a node with the same name in the
+/// map
+class Node_Exist { };
+
+/// Exception thrown when there is no node with the name given in
+/// the map
+class Node_Not_Exist { };
+
+/// Constructors prints out the caption and increases indent
+Dump_Obj (const char *caption);
+
+/// Additionally insets <val> into the map
+Dump_Obj (const char* caption,
+CORBA::Any &val);
+
+// Destructor
+~Dump_Obj (void);
+// return the indent string
+static const char* indent()
+{
+return indent_.c_str();
+}
+
+static CORBA::Any& desc(const char* caption)
+{
+return desc_map_[caption];
+}
+
+private:
+// indent string
+static std::string indent_;
+
+// map for reference lookup
+static std::map<std::string, CORBA::Any> desc_map_;
+
+// descriptor - used by destructor for deleting the
+// correct descriptor from the map
+std::string desc_;
+};
+}
+
+#include /**/ "ace/post.h"
+#endif /*CIAO_DUMP_OBJ_H*/