X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=xmltooling%2FAbstractXMLObject.h;h=e72f3eb54428f95ef379827e84c09bca5147d30b;hp=9a00401b97745896694156836f71ca5554b3b806;hb=c5183613326e3d36a544b2941654d0667a29b836;hpb=e48e1c0c331276a2c312cc798809a11385badc13 diff --git a/xmltooling/AbstractXMLObject.h b/xmltooling/AbstractXMLObject.h index 9a00401..e72f3eb 100644 --- a/xmltooling/AbstractXMLObject.h +++ b/xmltooling/AbstractXMLObject.h @@ -23,7 +23,6 @@ #if !defined(__xmltooling_abstractxmlobj_h__) #define __xmltooling_abstractxmlobj_h__ -#include #include #if defined (_MSC_VER) @@ -39,10 +38,7 @@ namespace xmltooling { class XMLTOOL_API AbstractXMLObject : public virtual XMLObject { public: - virtual ~AbstractXMLObject() { - delete m_typeQname; - std::for_each(m_children.begin(), m_children.end(), cleanup()); - } + virtual ~AbstractXMLObject(); /** * @see XMLObject::getElementQName() @@ -68,7 +64,7 @@ namespace xmltooling { /** * @see XMLObject::addNamespace() */ - void addNamespace(const Namespace& ns) { + void addNamespace(const Namespace& ns) const { if (ns.alwaysDeclare() || m_namespaces.find(ns)==m_namespaces.end()) { m_namespaces.insert(ns); } @@ -143,10 +139,7 @@ namespace xmltooling { * @param elementLocalName the local name of the XML element this Object represents * @param namespacePrefix the namespace prefix to use */ - AbstractXMLObject(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL) - : m_elementQname(namespaceURI,elementLocalName, namespacePrefix), m_typeQname(NULL), m_parent(NULL) { - addNamespace(Namespace(namespaceURI, namespacePrefix)); - } + AbstractXMLObject(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL); /** * Underlying list of child objects. @@ -157,8 +150,13 @@ namespace xmltooling { /** * Set of namespaces associated with the object. */ - std::set m_namespaces; - + mutable std::set m_namespaces; + + /** + * Logging object. + */ + void* m_log; + private: XMLObject* m_parent; QName m_elementQname;