29 #ifndef __NCML_MODULE__NCMLELEMENT_H__
30 #define __NCML_MODULE__NCMLELEMENT_H__
98 typedef std::vector<const NCMLElement*> ProtoList;
108 ProtoList::iterator findPrototype(
const std::string& elementTypeName);
133 virtual const std::string&
getTypeName()
const = 0;
152 const vector<string>& validAttrs,
153 vector<string>* pInvalidAttrs = 0,
154 bool printInvalid =
true,
155 bool throwOnError =
true);
174 virtual std::string
toString()
const = 0;
183 static bool isValidAttribute(
const std::vector<string>& validAttrs,
const string& attr);
189 const std::vector<string>& validAttrs,
190 std::vector<string>* pInvalidAttributes=0);
199 inline std::ostream &
virtual void handleBegin()=0
Handle a begin on this element.
virtual bool validateAttributes(const XMLAttributeMap &attrs, const vector< string > &validAttrs, vector< string > *pInvalidAttrs=0, bool printInvalid=true, bool throwOnError=true)
Check that the given attributes are all in the valid set, otherwise fill in *pInvalidAttrs with the p...
virtual void setAttributes(const XMLAttributeMap &attrs)=0
Set the attributes of this from the map.
Factory class for the NcML elements.
static bool areAllAttributesValid(const XMLAttributeMap &attrMap, const std::vector< string > &validAttrs, std::vector< string > *pInvalidAttributes=0)
An abstract superclass for NCMLArray that handles the non-parameterized functionality and allows u...
A monitoring "pool" class for created RCObject's which allows us to forcibly delete any RCOBject's re...
virtual void handleEnd()=0
Handle the closing of this element.
static std::string printAttributeIfNotEmpty(const std::string &attrName, const std::string &attrValue)
Helper for subclasses implementing toString().
virtual std::string toString() const =0
Return a string describing the element.
A reference to an RCObject which automatically ref() and deref() on creation and destruction.
void setParser(NCMLParser *p)
A base class for a simple reference counted object.
NCMLElement(NCMLParser *p)
Base class for NcML element concrete classes.
int line() const
Return the current parse line number.
virtual const std::string & getTypeName() const =0
Return the type of the element, which should be: the same as ConcreteClassName::getTypeName() ...
virtual void handleContent(const std::string &content)
Handle the characters content for the element.
RCPtr< NCMLElement > makeElement(const std::string &eltTypeName, const XMLAttributeMap &attrs, NCMLParser &parser)
Create an element of the proper type with the given AttrMap for its defined attributes.
std::ostream & operator<<(std::ostream &strm, const ncml_module::NCMLElement &obj)
Output obj.toString() to the stream.
virtual NCMLElement * clone() const =0
Make and return a copy of this.
static bool isValidAttribute(const std::vector< string > &validAttrs, const string &attr)