30 #include <D4EnumDefs.h>
31 #include <D4Attributes.h>
34 #include <XMLWriter.h>
39 #include "DmrppD4Group.h"
47 DmrppD4Group::_duplicate(
const DmrppD4Group &)
51 DmrppD4Group::DmrppD4Group(
const string &n) : D4Group(n), DmrppCommon()
55 DmrppD4Group::DmrppD4Group(
const string &n,
const string &d) : D4Group(n, d), DmrppCommon()
60 DmrppD4Group::ptr_duplicate()
62 return new DmrppD4Group(*
this);
65 DmrppD4Group::DmrppD4Group(
const DmrppD4Group &rhs) : D4Group(rhs), DmrppCommon(rhs)
71 DmrppD4Group::operator=(
const DmrppD4Group &rhs)
76 dynamic_cast<D4Group &
>(*this) = rhs;
79 DmrppCommon::m_duplicate_common(rhs);
86 DmrppD4Group::print_dap4(XMLWriter &xml,
bool constrained)
88 if (!name().empty() && name() !=
"/") {
92 if (constrained && !send_p())
95 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*) type_name().c_str()) < 0)
96 throw InternalErr(__FILE__, __LINE__,
"Could not write " + type_name() +
" element");
98 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name", (
const xmlChar*) name().c_str()) < 0)
99 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
103 if (!dims()->empty())
104 dims()->print_dap4(xml, constrained);
107 if (!enum_defs()->empty())
108 enum_defs()->print_dap4(xml, constrained);
111 Constructor::Vars_iter v = var_begin();
112 while (v != var_end())
113 (*v++)->print_dap4(xml, constrained);
116 attributes()->print_dap4(xml);
119 groupsIter g = d_groups.begin();
120 while (g != d_groups.end())
121 (*g++)->print_dap4(xml, constrained);
123 if (!name().empty() && name() !=
"/") {
124 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
125 throw InternalErr(__FILE__, __LINE__,
"Could not end " + type_name() +
" element");
131 void DmrppD4Group::dump(ostream & strm)
const
133 strm << BESIndent::LMarg <<
"DmrppD4Group::dump - (" << (
void *)
this <<
")" << endl;
135 DmrppCommon::dump(strm);
137 strm << BESIndent::LMarg <<
"value: " <<
"----" << endl;
138 BESIndent::UnIndent();