diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
commit | b71531b42b3325fd6079a7039aae8641262c8adf (patch) | |
tree | a5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/tools/Config_Handlers/DnC_Dump_T.cpp | |
parent | a0f67cc97c0050d907145e312135b60c0125e56e (diff) | |
download | ATCD-b71531b42b3325fd6079a7039aae8641262c8adf.tar.gz |
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/tools/Config_Handlers/DnC_Dump_T.cpp')
-rw-r--r-- | modules/CIAO/tools/Config_Handlers/DnC_Dump_T.cpp | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/modules/CIAO/tools/Config_Handlers/DnC_Dump_T.cpp b/modules/CIAO/tools/Config_Handlers/DnC_Dump_T.cpp new file mode 100644 index 00000000000..6dd83b18989 --- /dev/null +++ b/modules/CIAO/tools/Config_Handlers/DnC_Dump_T.cpp @@ -0,0 +1,90 @@ +// $Id$ +#ifndef DNC_DUMP_T_C +#define DNC_DUMP_T_C +#include "DnC_Dump.h" +#include "DnC_Dump_T.h" +#include "Dump_Obj.h" + +ACE_RCSID (Config_Handlers, + DnC_Dump_T, + "$Id$") + namespace Deployment + { + namespace DnC_Dump_T + { + // Dumps a reference + template <typename ROOT, typename REFERENCE, typename DATA_TYPE, + typename CLASS> + void + dump_ref (const char* caption, REFERENCE& ref, + const char* root, DATA_TYPE CLASS::*data) + { + ACE_DEBUG ((LM_DEBUG, "%s%s:\n", + Dump_Obj::indent(), caption)); + + const CORBA::Any &val = Dump_Obj::desc (root); + + ROOT *t = 0; + + val >>= t; + + const ROOT &root_obj = *t; + + int value = ref; + ACE_DEBUG ((LM_DEBUG, "%s%s.name: %s\n", + Dump_Obj::indent(), caption, + (root_obj.*data)[value].name.in())); + } + + // Dumps a reference sequence + template <typename ROOT, typename SEQUENCE, typename DATA_TYPE, + typename CLASS> + void + dump_ref_seq (const char* caption, SEQUENCE& seq, + const char* root, DATA_TYPE CLASS::*data) + { + ACE_DEBUG ((LM_DEBUG, + "%s%s:\n", + Dump_Obj::indent(), caption)); + + CORBA::Any val; + val <<= root; + + for (size_t i = 0; i < seq.length(); ++i) + { + const CORBA::Any &val = Dump_Obj::desc (root); + + ROOT *t = 0; + + val >>= t; + + const ROOT &root_obj = *t; + int value = seq[i]; + ACE_DEBUG ((LM_DEBUG, "%s%s[%d].name: %s\n", + Dump_Obj::indent(), caption, i, + (root_obj.*data)[value].name.in())); + } + } + + // Dumps a sequence + template <typename SEQUENCE> + void + dump_sequence (const char* caption, const SEQUENCE &seq) + { + CORBA::ULong size = seq.length (); + + if (size != 0) + { + Dump_Obj dump_obj(caption); + + for (CORBA::ULong i = 0; i < size; ++i) + { + ACE_DEBUG ((LM_DEBUG, "%s%s %d: \n", Dump_Obj::indent(), + caption, i)); + DnC_Dump::dump (seq[i]); + } + } + } + } + } +#endif /* DNC_DUMP_C */ |