![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
#include <line/util/xml.h>
Public Member Functions | |
| std::string | attr (const std::string &key) const |
| Attribute value, or the empty string when absent (org.w3c.dom semantics). | |
| bool | has_attr (const std::string &key) const |
| std::vector< const Element * > | by_tag (const std::string &tag) const |
| Descendant-or-self search excluding self, in document order. | |
| std::vector< const Element * > | child_tags (const std::string &tag) const |
| Direct children with the given tag, in document order. | |
| Element & | set_attr (const std::string &key, const std::string &value) |
| setAttribute: replace the value in place when the key already exists, otherwise append. | |
| Element & | add_child (const std::string &tag) |
| createElement + appendChild in one step; the child is owned here. | |
| Element & | add_text (const std::string &value) |
| createTextNode + appendChild on an element with no child elements. | |
| Element & | add_text_child (const std::string &tag, const std::string &value) |
| The common shape <tag>value</tag>. | |
Public Attributes | |
| std::string | name |
| std::vector< std::pair< std::string, std::string > > | attrs |
| std::vector< std::unique_ptr< Element > > | children |
| const Element * | parent = nullptr |
| std::string | text |
| Character data of a text-only element, as createTextNode supplies it. | |
|
inline |
createElement + appendChild in one step; the child is owned here.
Definition at line 107 of file xml.h.
References children.
Referenced by add_text_child(), line::io::jmt_append_distribution(), line::io::jmt_object_array(), line::io::jmt_param(), line::io::jmt_scalar(), and line::lqn::write_lqnx().
|
inline |
createTextNode + appendChild on an element with no child elements.
Definition at line 116 of file xml.h.
References text.
Referenced by add_text_child().
|
inline |
The common shape <tag>value</tag>.
Definition at line 122 of file xml.h.
References add_child(), and add_text().
Referenced by line::io::jmt_param_value(), line::io::jmt_ref_class(), and line::io::jmt_scalar().
|
inline |
Attribute value, or the empty string when absent (org.w3c.dom semantics).
Definition at line 63 of file xml.h.
References attrs.
Referenced by line::jmt::jmt_parse_measures(), line::io::pnml_load(), and line::lqn::read_lqnx_model().
|
inline |
Descendant-or-self search excluding self, in document order.
Definition at line 76 of file xml.h.
Referenced by line::io::pnml_load(), and line::lqn::read_lqnx_model().
|
inline |
Direct children with the given tag, in document order.
Definition at line 83 of file xml.h.
References children.
Referenced by line::io::pnml_load(), and line::lqn::read_lqnx_model().
|
inline |
Definition at line 69 of file xml.h.
References attrs.
Referenced by line::jmt::jmt_parse_measures().
|
inline |
setAttribute: replace the value in place when the key already exists, otherwise append.
Replacing in place is what keeps attribute order stable across a writer that sets className twice – the JSIM writer sets the LINE section name first and overwrites it with the JMT one.
Definition at line 96 of file xml.h.
References attrs.
Referenced by line::io::jmt_append_distribution(), line::io::jmt_object_array(), line::io::jmt_param(), line::io::jmt_scalar(), and line::lqn::write_lqnx().
| std::vector<std::pair<std::string, std::string> > line::xml::Element::attrs |
Definition at line 56 of file xml.h.
Referenced by attr(), has_attr(), line::xml::parse(), and set_attr().
| std::vector<std::unique_ptr<Element> > line::xml::Element::children |
Definition at line 57 of file xml.h.
Referenced by add_child(), and child_tags().
| std::string line::xml::Element::name |
Definition at line 55 of file xml.h.
Referenced by line::xml::parse(), and line::lqn::write_lqnx().
| const Element* line::xml::Element::parent = nullptr |
Definition at line 58 of file xml.h.
Referenced by line::xml::parse().
| std::string line::xml::Element::text |
Character data of a text-only element, as createTextNode supplies it.
Definition at line 60 of file xml.h.
Referenced by add_text().