Go to the documentation of this file. 1 #ifndef DD_XMLElement_H
2 #define DD_XMLElement_H
72 const std::vector<std::string>&
names,
73 const std::vector<std::string>&
values,
95 virtual bool gotText(
void)
const;
98 virtual void clear(
void);
123 virtual size_t size(
void)
const;
125 virtual std::vector<DDXMLAttribute>::const_iterator
begin(
void);
127 virtual std::vector<DDXMLAttribute>::const_iterator
end(
void);
161 virtual void stream(std::ostream& os)
const;
164 std::vector<DDXMLAttribute>::const_iterator&
operator++(
int inc);
167 virtual bool isEmpty(
void)
const;
179 std::vector<DDXMLAttribute>
184 std::vector<DDXMLAttribute>::const_iterator
myIter_;
const std::string & parent(void) const
access to parent element name
virtual void clear(void)
clear this element's contents.
friend std::ostream & operator<<(std::ostream &os, const DDXMLElement &element)
virtual std::vector< std::string > getVectorAttribute(const std::string &name)
Returns a set of values as a std::vector of strings, given the attribute name.
void throwError(const std::string &keyMessage) const
format std::string for throw an error.
std::map< std::string, std::vector< std::string > > AttrAccumType
DDName is used to identify DDD entities uniquely.
virtual ~DDXMLElement(void)=default
Destructor.
virtual void stream(std::ostream &os) const
Allow for the elements to have their own streaming method, but also provide a default.
The main class for processing parsed elements.
virtual std::vector< DDXMLAttribute >::const_iterator end(void)
void loadAttributes(const std::string &elemName, const std::vector< std::string > &names, const std::vector< std::string > &values, const std::string &nmspace, DDCompactView &cpv)
Load the element attributes.
std::vector< DDXMLAttribute >::const_iterator & operator++(int inc)
Allow the elements of this type to be iterated over using ++ operator.
std::vector< DDXMLAttribute > attributes_
virtual const DDXMLAttribute & getAttributeSet(size_t aIndex=0) const
Get a "row" of attributes, i.e. one attribute set.
void appendText(const std::string &inText)
append to the current (i.e. most recently added)
const std::string names[nVars_]
Compact representation of the geometrical detector hierarchy.
DDXMLElement(DDLElementRegistry *myreg)
Constructor.
virtual void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Processing the element.
virtual const std::string & getAttribute(const std::string &name) const
Access to attributes by name.
std::string parentElement_
void appendAttributes(std::vector< std::string > &tv, const std::string &name)
behind the scenes appending to pAttributes...
AttrAccumType attributeAccumulator_
std::map< std::string, std::string > DDXMLAttribute
virtual void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Called by loadAttributes AFTER attributes are loaded.
void loadText(const std::string &inText)
Used to load both text and XML comments into this object.
void setSelf(const std::string &sename)
Set self element name to central list of names.
virtual const std::string & get(const std::string &name, size_t aIndex=0) const
Returns a specific value from the aIndex set of attributes.
This is a base class for processing XML elements in the DDD.
void setParent(const std::string &pename)
Set parent element name to central list of names.
virtual std::vector< DDXMLAttribute >::const_iterator begin(void)
virtual bool isEmpty(void) const
Have any elements of this type been encountered but not processed?
const virtual DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
virtual bool gotText(void) const
gotText()? kind of like gotMilk? Yes = text has already been encountered.
const std::string getText(size_t tindex=0) const
retrieve the text blob.
std::vector< std::string > text_
virtual size_t size(void) const
Number of elements accumulated.
DDLElementRegistry * myRegistry_
std::vector< DDXMLAttribute >::const_iterator myIter_