15 bool has_family_module;
16 std::string family_module;
25 bool has_family_setcaches;
26 std::vector< SetCache > family_setcaches;
29 has_family_module(false)
31 _vXMLParameters.push_back(
"family_module");
32 _vXMLParameters.push_back(
"family_setcaches");
37 std::string family_path;
38 SetCache family_setcache_cur;
41 bool serialize(std::ostream& sout,
int options=0)
const
43 if (!or_lemur::LEMURParameters::serialize(sout,options))
45 if (has_family_module)
46 sout <<
"<family_module>" << family_module <<
"</family_module>";
47 if (has_family_setcaches)
49 sout <<
"<family_setcaches>";
50 for (
unsigned int ui=0; ui<family_setcaches.size(); ui++)
53 sout <<
"<name>" << family_setcaches[ui].name <<
"</name>";
54 sout <<
"<filename>" << family_setcaches[ui].filename <<
"</filename>";
55 sout <<
"</setcache>";
57 sout <<
"</family_setcaches>";
62 OpenRAVE::BaseXMLReader::ProcessElement startElement(
63 const std::string & name,
const OpenRAVE::AttributesList & atts)
65 OpenRAVE::BaseXMLReader::ProcessElement ret = PE_Ignore;
66 if (family_path ==
"")
68 if (name ==
"family_module"
69 || name ==
"family_setcaches")
77 return or_lemur::LEMURParameters::startElement(name,atts);
80 else if (family_path ==
"family_setcaches")
82 if (name ==
"setcache")
84 family_path =
"family_setcaches/" + name;
85 family_setcache_cur.name =
"";
86 family_setcache_cur.filename =
"";
90 else if (family_path ==
"family_setcaches/setcache")
93 || name ==
"filename")
95 family_path =
"family_setcaches/setcache/" + name;
99 if (ret == PE_Support)
101 if (ret == PE_Ignore)
102 RAVELOG_WARN(
"Ignoring unknown tag <%s>!\n", name.c_str());
106 bool endElement(
const std::string & name)
108 if (family_path ==
"")
109 return or_lemur::LEMURParameters::endElement(name);
110 if (family_path ==
"family_module")
112 family_module = _ss.str();
113 has_family_module =
true;
117 if (family_path ==
"family_setcaches/setcache/name")
120 RAVELOG_WARN(
"Closing tag <%s> doesn't match opening tag <name>!\n", name.c_str());
121 family_setcache_cur.name = _ss.str();
122 family_path =
"family_setcaches/setcache";
125 if (family_path ==
"family_setcaches/setcache/filename")
127 if (name !=
"filename")
128 RAVELOG_WARN(
"Closing tag <%s> doesn't match opening tag <filename>!\n", name.c_str());
129 family_setcache_cur.filename = _ss.str();
130 family_path =
"family_setcaches/setcache";
133 if (family_path ==
"family_setcaches/setcache")
135 family_setcaches.push_back(family_setcache_cur);
136 family_path =
"family_setcaches";
139 if (family_path ==
"family_setcaches")
141 has_family_setcaches =
true;
145 RAVELOG_ERROR(
"Parse error!");
150 typedef boost::shared_ptr<FamilyParameters> FamilyParametersPtr;
151 typedef boost::shared_ptr<FamilyParameters const> FamilyParametersConstPtr;
Definition: params_family.h:11
Definition: params_lemur.h:11
Definition: params_family.h:20