/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
/**
* @file xmltooling/AbstractXMLObject.h
- *
+ *
* An abstract implementation of XMLObject.
*/
class XMLTOOL_API AbstractXMLObject : public virtual XMLObject
{
public:
- virtual ~AbstractXMLObject() {
- delete m_typeQname;
- xercesc::XMLString::release(&m_schemaLocation);
- xercesc::XMLString::release(&m_noNamespaceSchemaLocation);
- }
+ virtual ~AbstractXMLObject();
void detach();
const std::set<Namespace>& getNamespaces() const {
return m_namespaces;
}
-
+
void addNamespace(const Namespace& ns) const {
std::set<Namespace>::iterator i = m_namespaces.find(ns);
if (i == m_namespaces.end())
else if (ns.alwaysDeclare())
const_cast<Namespace&>(*i).setAlwaysDeclare(true);
}
-
+
void removeNamespace(const Namespace& ns) {
m_namespaces.erase(ns);
}
-
+
const QName* getSchemaType() const {
return m_typeQname;
}
-
+
const XMLCh* getXMLID() const {
return NULL;
}
-
+
xmlconstants::xmltooling_bool_t getNil() const {
return m_nil;
}
-
+
void nil(xmlconstants::xmltooling_bool_t value) {
if (m_nil != value) {
releaseThisandParentDOM();
bool hasParent() const {
return m_parent != NULL;
}
-
+
XMLObject* getParent() const {
return m_parent;
}
-
+
void setParent(XMLObject* parent) {
m_parent = parent;
}
protected:
/**
* Constructor
- *
+ *
* @param nsURI the namespace of the element
* @param localName the local name of the XML element this Object represents
* @param prefix the namespace prefix to use
/** Copy constructor. */
AbstractXMLObject(const AbstractXMLObject& src);
-
+
/**
* A helper function for derived classes, for assignment of strings.
*
* This 'normalizes' newString, and then if it is different from oldString,
* it invalidates the DOM, frees the old string, and returns the new.
* If not different, it frees the new string and just returns the old value.
- *
- * @param oldValue - the current value
- * @param newValue - the new value
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the new value
+ *
* @return the value that should be assigned
*/
XMLCh* prepareForAssignment(XMLCh* oldValue, const XMLCh* newValue);
* A helper function for derived classes, for assignment of date/time data.
*
* It invalidates the DOM, frees the old object, and returns the new.
- *
- * @param oldValue - the current value
- * @param newValue - the new value
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the new value
+ *
* @return the value that should be assigned
*/
DateTime* prepareForAssignment(DateTime* oldValue, const DateTime* newValue);
* A helper function for derived classes, for assignment of date/time data.
*
* It invalidates the DOM, frees the old object, and returns the new.
- *
- * @param oldValue - the current value
- * @param newValue - the epoch to assign as the new value
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the epoch to assign as the new value
+ * @param duration true iff the value is a duration rather than an absolute timestamp
+ *
* @return the value that should be assigned
*/
- DateTime* prepareForAssignment(DateTime* oldValue, time_t newValue);
+ DateTime* prepareForAssignment(DateTime* oldValue, time_t newValue, bool duration=false);
/**
* A helper function for derived classes, for assignment of date/time data.
*
* It invalidates the DOM, frees the old object, and returns the new.
- *
- * @param oldValue - the current value
- * @param newValue - the new value in string form
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the new value in string form
+ * @param duration true iff the value is a duration rather than an absolute timestamp
+ *
* @return the value that should be assigned
*/
- DateTime* prepareForAssignment(DateTime* oldValue, const XMLCh* newValue);
+ DateTime* prepareForAssignment(DateTime* oldValue, const XMLCh* newValue, bool duration=false);
/**
* A helper function for derived classes, for assignment of QName data.
*
* It invalidates the DOM, frees the old object, and returns the new.
- *
- * @param oldValue - the current value
- * @param newValue - the new value
- *
+ *
+ * @param oldValue the current value
+ * @param newValue the new value
+ *
* @return the value that should be assigned
*/
QName* prepareForAssignment(QName* oldValue, const QName* newValue);
/**
* A helper function for derived classes, for assignment of (singleton) XML objects.
- *
- * It is indifferent to whether either the old or the new version of the value is null.
+ *
+ * It is indifferent to whether either the old or the new version of the value is null.
* This method will do a safe compare of the objects and will also invalidate the DOM if appropriate.
* Note that since the new value (even if NULL) is always returned, it may be more efficient
* to discard the return value and just assign independently if a dynamic cast would be involved.
- *
- * @param oldValue - current value
- * @param newValue - proposed new value
- * @return the new value
- *
+ *
+ * @param oldValue current value
+ * @param newValue proposed new value
+ * @return the new value
+ *
* @throws XMLObjectException if the new child already has a parent.
*/
XMLObject* prepareForAssignment(XMLObject* oldValue, XMLObject* newValue);
* Stores off xsi:noNamespaceSchemaLocation attribute.
*/
XMLCh* m_noNamespaceSchemaLocation;
-
+
/**
* Stores off xsi:nil attribute.
*/
/*\r
* Copyright 2001-2007 Internet2\r
- * \r
+ *\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
* You may obtain a copy of the License at\r
\r
/**\r
* @file xmltooling/base.h\r
- * \r
+ *\r
* Base header file definitions\r
* Must be included prior to including any other header\r
*/\r
* Begins the declaration of an XMLObject specialization for an abstract element/type.\r
* Basic boilerplate includes a protected constructor, empty virtual destructor,\r
* and Unicode constants for the default associated element's name and prefix.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the class to declare\r
* @param base the base class to derive from using public virtual inheritance\r
* Begins the declaration of an XMLObject specialization.\r
* Basic boilerplate includes a protected constructor, empty virtual destructor,\r
* and Unicode constants for the default associated element's name and prefix.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the class to declare\r
* @param base the base class to derive from using public virtual inheritance\r
* Begins the declaration of an XMLObject specialization with two base classes.\r
* Basic boilerplate includes a protected constructor, empty virtual destructor,\r
* and Unicode constants for the default associated element's name and prefix.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the class to declare\r
* @param base the first base class to derive from using public virtual inheritance\r
* Begins the declaration of an XMLObject specialization with three base classes.\r
* Basic boilerplate includes a protected constructor, empty virtual destructor,\r
* and Unicode constants for the default associated element's name and prefix.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the class to declare\r
* @param base the first base class to derive from using public virtual inheritance\r
* Begins the declaration of an XMLObject specialization with four base classes.\r
* Basic boilerplate includes a protected constructor, empty virtual destructor,\r
* and Unicode constants for the default associated element's name and prefix.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the class to declare\r
* @param base the first base class to derive from using public virtual inheritance\r
* Begins the declaration of an XMLObject specialization with five base classes.\r
* Basic boilerplate includes a protected constructor, empty virtual destructor,\r
* and Unicode constants for the default associated element's name and prefix.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the class to declare\r
* @param base the first base class to derive from using public virtual inheritance\r
\r
/**\r
* Implements a static variable holding an XMLObject's element QName.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
* @param namespaceURI the XML namespace of the default associated element\r
* @param namespacePrefix the XML namespace prefix of the default associated element\r
\r
/**\r
* Implements a static variable holding an XMLObject's schema type QName.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
* @param namespaceURI the XML namespace of the default associated element\r
* @param namespacePrefix the XML namespace prefix of the default associated element\r
/**\r
* Declares abstract set method for a typed XML attribute.\r
* The get method is omitted.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
* @param type the attribute's data type\r
\r
/**\r
* Declares abstract get/set methods for a typed XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
* @param type the attribute's data type\r
/**\r
* Declares abstract set method for a string XML attribute.\r
* The get method is omitted.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
*/\r
\r
/**\r
* Declares abstract get/set methods for a string XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
*/\r
/**\r
* Declares abstract set method for a DateTime XML attribute.\r
* The get method is omitted.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
*/\r
\r
/**\r
* Declares abstract get/set methods for a DateTime XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
*/\r
/**\r
* Declares abstract set method for an integer XML attribute.\r
* The get method is omitted.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
*/\r
\r
/**\r
* Declares abstract get/set methods for an integer XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
*/\r
\r
/**\r
* Declares abstract get/set methods for a boolean XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param upcased the upcased name of the attribute\r
* @param def the default/presumed value, if no explicit value has been set\r
\r
/**\r
* Implements get/set methods and a private member for a typed XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param type the attribute's data type\r
*/\r
\r
/**\r
* Implements get/set methods and a private member for a string XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
*/\r
#define IMPL_STRING_ATTRIB(proper) \\r
/**\r
* Implements get/set methods and a private member for a string XML attribute,\r
* plus a getXMLID override.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
*/\r
#define IMPL_ID_ATTRIB(proper) \\r
\r
/**\r
* Implements get/set methods and a private member for a DateTime XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param fallback epoch to return when attribute is NULL\r
*/\r
#define IMPL_DATETIME_ATTRIB(proper,fallback) \\r
+ IMPL_DATETIME_ATTRIB_EX(proper,fallback,false)\r
+\r
+/**\r
+ * Implements get/set methods and a private member for a duration-valued DateTime XML attribute.\r
+ *\r
+ * @param proper the proper name of the attribute\r
+ * @param fallback epoch to return when attribute is NULL\r
+ */\r
+#define IMPL_DURATION_ATTRIB(proper,fallback) \\r
+ IMPL_DATETIME_ATTRIB_EX(proper,fallback,true)\r
+\r
+/**\r
+ * Implements get/set methods and a private member for a DateTime XML attribute.\r
+ *\r
+ * @param proper the proper name of the attribute\r
+ * @param fallback epoch to return when attribute is NULL\r
+ * @param duration true iff the attribute should be handled as a duration\r
+ */\r
+#define IMPL_DATETIME_ATTRIB_EX(proper,fallback,duration) \\r
protected: \\r
DateTime* m_##proper; \\r
time_t m_##proper##Epoch; \\r
m_##proper##Epoch=m_##proper->getEpoch(); \\r
} \\r
void set##proper(time_t proper) { \\r
- m_##proper = prepareForAssignment(m_##proper,proper); \\r
+ m_##proper = prepareForAssignment(m_##proper,proper,duration); \\r
m_##proper##Epoch = proper; \\r
} \\r
void set##proper(const XMLCh* proper) { \\r
- m_##proper = prepareForAssignment(m_##proper,proper); \\r
+ m_##proper = prepareForAssignment(m_##proper,proper,duration); \\r
if (m_##proper) \\r
m_##proper##Epoch=m_##proper->getEpoch(); \\r
}\r
\r
/**\r
* Implements get/set methods and a private member for an integer XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
*/\r
#define IMPL_INTEGER_ATTRIB(proper) \\r
\r
/**\r
* Implements get/set methods and a private member for a boolean XML attribute.\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
*/\r
#define IMPL_BOOLEAN_ATTRIB(proper) \\r
/**\r
* Declares abstract set method for a typed XML child object in a foreign namespace.\r
* The get method is omitted.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param ns the C++ namespace for the type\r
*/\r
\r
/**\r
* Declares abstract get/set methods for a typed XML child object in a foreign namespace.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param ns the C++ namespace for the type\r
*/\r
/**\r
* Declares abstract set method for a typed XML child object.\r
* The get method is omitted.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
*/\r
#define DECL_INHERITED_TYPED_CHILD(proper) \\r
\r
/**\r
* Declares abstract get/set methods for a typed XML child object.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
*/\r
#define DECL_TYPED_CHILD(proper) \\r
\r
/**\r
* Declares abstract get/set methods for a generic XML child object.\r
- * \r
+ *\r
* @param proper the proper name of the child\r
*/\r
#define DECL_XMLOBJECT_CHILD(proper) \\r
\r
/**\r
* Implements get/set methods and a private list iterator member for a typed XML child object.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
*/\r
#define IMPL_TYPED_CHILD(proper) \\r
/**\r
* Implements get/set methods and a private list iterator member for\r
* a typed XML child object in a foreign namespace\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param ns the C++ namespace for the type\r
*/\r
\r
/**\r
* Implements get/set methods and a private list iterator member for a generic XML child object.\r
- * \r
+ *\r
* @param proper the proper name of the child\r
*/\r
#define IMPL_XMLOBJECT_CHILD(proper) \\r
\r
/**\r
* Declares abstract get/set methods for a typed XML child collection.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
*/\r
#define DECL_TYPED_CHILDREN(proper) \\r
\r
/**\r
* Declares abstract get/set methods for a typed XML child collection in a foreign namespace.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param ns the C++ namespace for the type\r
*/\r
\r
/**\r
* Declares abstract get/set methods for a generic XML child collection.\r
- * \r
+ *\r
* @param proper the proper name of the child\r
*/\r
#define DECL_XMLOBJECT_CHILDREN(proper) \\r
\r
/**\r
* Implements get method and a private vector member for a typed XML child collection.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param fence insertion fence for new objects of the child collection in backing list\r
*/\r
} \\r
const std::vector<proper*>& get##proper##s() const { \\r
return m_##proper##s; \\r
- } \r
+ }\r
\r
/**\r
* Implements get method and a private vector member for a typed XML child collection\r
* in a foreign namespace.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param ns the C++ namespace for the type\r
* @param fence insertion fence for new objects of the child collection in backing list\r
} \\r
const std::vector<ns::proper*>& get##proper##s() const { \\r
return m_##proper##s; \\r
- } \r
+ }\r
\r
/**\r
* Implements get method and a private vector member for a generic XML child collection.\r
- * \r
+ *\r
* @param proper the proper name of the child\r
* @param fence insertion fence for new objects of the child collection in backing list\r
*/\r
} \\r
const std::vector<xmltooling::XMLObject*>& get##proper##s() const { \\r
return m_##proper##s; \\r
- } \r
+ }\r
\r
/**\r
* Implements marshalling for a string attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements marshalling for a DateTime attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements marshalling for an integer attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements marshalling for a boolean attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements marshalling for a QName attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements marshalling for an ID attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements unmarshalling process branch for a string attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements unmarshalling process branch for an ID attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements unmarshalling process branch for a DateTime attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements unmarshalling process branch for a DateTime attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements unmarshalling process branch for an integer attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements unmarshalling process branch for a boolean attribute\r
- * \r
+ *\r
* @param proper the proper name of the attribute\r
* @param ucase the upcased name of the attribute\r
* @param namespaceURI the XML namespace of the attribute\r
\r
/**\r
* Implements unmarshalling process branch for typed child collection element\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param namespaceURI the XML namespace of the child element\r
* @param force bypass use of hint and just cast down to check child\r
/**\r
* Implements unmarshalling process branch for typed child collection element\r
* in a foreign namespace.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param ns the C++ namespace for the type\r
* @param namespaceURI the XML namespace of the child element\r
\r
/**\r
* Implements unmarshalling process branch for typed child singleton element\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param namespaceURI the XML namespace of the child element\r
* @param force bypass use of hint and just cast down to check child\r
/**\r
* Implements unmarshalling process branch for typed child singleton element\r
* in a foreign namespace.\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param ns the C++ namespace for the type\r
* @param namespaceURI the XML namespace of the child element\r
\r
/**\r
* Implements unmarshalling process branch for a generic child singleton element\r
- * \r
+ *\r
* @param proper the proper name of the child type\r
* @param namespaceURI the XML namespace of the child element\r
*/\r
\r
/**\r
* Declares aliased get/set methods for named XML element simple content.\r
- * \r
+ *\r
* @param proper the proper name to label the element's content\r
*/\r
#define DECL_SIMPLE_CONTENT(proper) \\r
\r
/**\r
* Declares aliased get/set methods for named integer XML element content.\r
- * \r
+ *\r
* @param proper the proper name to label the element's content\r
*/\r
#define DECL_INTEGER_CONTENT(proper) \\r
\r
/**\r
* Implements cloning methods for an XMLObject specialization implementation class.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
*/\r
#define IMPL_XMLOBJECT_CLONE(cname) \\r
/**\r
* Declares an XMLObject specialization with a simple content model and type,\r
* handling it as string data.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the XMLObject specialization\r
* @param proper the proper name to label the element's content\r
/**\r
* Declares and defines an implementation class for an XMLObject with\r
* a simple content model and type, handling it as string data.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the XMLObject specialization\r
*/\r
* Begins the declaration of an XMLObjectBuilder specialization.\r
* Basic boilerplate includes an empty virtual destructor, and\r
* a default builder that defaults the element name.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the XMLObject specialization\r
* @param namespaceURI the XML namespace of the default associated element\r
\r
/**\r
* Declares a generic XMLObjectBuilder specialization.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the XMLObject specialization\r
* @param namespaceURI the XML namespace of the default associated element\r
END_XMLOBJECTBUILDER\r
\r
/**\r
- * Implements the standard XMLObjectBuilder specialization function. \r
- * \r
+ * Implements the standard XMLObjectBuilder specialization function.\r
+ *\r
* @param cname the name of the XMLObject specialization\r
*/\r
#define IMPL_XMLOBJECTBUILDER(cname) \\r
* Begins the declaration of an XMLObjectBuilder specialization.\r
* Basic boilerplate includes an empty virtual destructor, and\r
* a default builder that defaults the element name.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the XMLObject specialization\r
* @param namespaceURI the XML namespace of the default associated element\r
\r
/**\r
* Declares a generic XMLObjectBuilder specialization.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the XMLObject specialization\r
* @param namespaceURI the XML namespace of the default associated element\r
END_XMLOBJECTBUILDER\r
\r
/**\r
- * Implements the standard XMLObjectBuilder specialization function. \r
- * \r
+ * Implements the standard XMLObjectBuilder specialization function.\r
+ *\r
* @param cname the name of the XMLObject specialization\r
*/\r
#define IMPL_XMLOBJECTBUILDER(cname) \\r
\r
/**\r
* Begins the declaration of a Schema Validator specialization.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the base name of the Validator specialization\r
*/\r
\r
/**\r
* Begins the declaration of a Schema Validator specialization subclass.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the base name of the Validator specialization\r
* @param base base class for the validator\r
\r
/**\r
* Validator code that checks the object type.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
*/\r
#define XMLOBJECTVALIDATOR_CHECKTYPE(cname) \\r
\r
/**\r
* Validator code that checks for a required attribute, content, or singleton.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
- * @param proper the proper name of the attribute, content, or singleton member \r
+ * @param proper the proper name of the attribute, content, or singleton member\r
*/\r
#define XMLOBJECTVALIDATOR_REQUIRE(cname,proper) \\r
if (!ptr->get##proper()) \\r
\r
/**\r
* Validator code that checks for a required integer attribute\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
- * @param proper the proper name of the attribute, content, or singleton member \r
+ * @param proper the proper name of the attribute, content, or singleton member\r
*/\r
#define XMLOBJECTVALIDATOR_REQUIRE_INTEGER(cname,proper) \\r
if (!ptr->get##proper().first) \\r
/**\r
* Validator code that checks for one of a pair of\r
* required attributes, content, or singletons.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
- * @param proper1 the proper name of the first attribute, content, or singleton member \r
- * @param proper2 the proper name of the second attribute, content, or singleton member \r
+ * @param proper1 the proper name of the first attribute, content, or singleton member\r
+ * @param proper2 the proper name of the second attribute, content, or singleton member\r
*/\r
#define XMLOBJECTVALIDATOR_ONEOF(cname,proper1,proper2) \\r
if (!ptr->get##proper1() && !ptr->get##proper2()) \\r
/**\r
* Validator code that checks for one of a pair of\r
* required attributes, content, or singletons, but disallows both.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
- * @param proper1 the proper name of the first attribute, content, or singleton member \r
- * @param proper2 the proper name of the second attribute, content, or singleton member \r
+ * @param proper1 the proper name of the first attribute, content, or singleton member\r
+ * @param proper2 the proper name of the second attribute, content, or singleton member\r
*/\r
#define XMLOBJECTVALIDATOR_ONLYONEOF(cname,proper1,proper2) \\r
if ((!ptr->get##proper1() && !ptr->get##proper2()) || (ptr->get##proper1() && ptr->get##proper2())) \\r
/**\r
* Validator code that checks for one of a set of three\r
* required attributes, content, or singletons.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
* @param proper1 the proper name of the first attribute, content, or singleton member\r
* @param proper2 the proper name of the second attribute, content, or singleton member\r
/**\r
* Validator code that checks for one of a set of three\r
* required attributes, content, or singletons but disallows more than one.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
* @param proper1 the proper name of the first attribute, content, or singleton member\r
* @param proper2 the proper name of the second attribute, content, or singleton member\r
/**\r
* Validator code that checks a co-constraint (if one present, the other must be)\r
* between a pair of attributes, content, or singletons.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
- * @param proper1 the proper name of the first attribute, content, or singleton member \r
- * @param proper2 the proper name of the second attribute, content, or singleton member \r
+ * @param proper1 the proper name of the first attribute, content, or singleton member\r
+ * @param proper2 the proper name of the second attribute, content, or singleton member\r
*/\r
#define XMLOBJECTVALIDATOR_NONEORBOTH(cname,proper1,proper2) \\r
if ((ptr->get##proper1() && !ptr->get##proper2()) || (!ptr->get##proper1() && ptr->get##proper2())) \\r
\r
/**\r
* Validator code that checks for a non-empty collection.\r
- * \r
+ *\r
* @param cname the name of the XMLObject specialization\r
- * @param proper the proper name of the collection item \r
+ * @param proper the proper name of the collection item\r
*/\r
#define XMLOBJECTVALIDATOR_NONEMPTY(cname,proper) \\r
if (ptr->get##proper##s().empty()) \\r
/**\r
* Declares/defines a Validator specialization that checks object type and\r
* a non-empty simple content model.\r
- * \r
+ *\r
* @param linkage linkage specifier for the class\r
* @param cname the name of the XMLObject specialization\r
*/\r
* Template function for cloning a sequence of XMLObjects.\r
* Invokes the clone() member on each element of the input sequence and adds the copy to\r
* the output sequence. Order is preserved.\r
- * \r
+ *\r
* @param in input sequence to clone\r
* @param out output sequence to copy cloned pointers into\r
*/\r
{\r
/**\r
* Function operator to delete an object.\r
- * \r
+ *\r
* @param ptr object to delete\r
*/\r
void operator()(T* ptr) {delete ptr;}\r
- \r
+\r
/**\r
* Function operator to delete an object stored as const.\r
- * \r
+ *\r
* @param ptr object to delete after casting away const\r
*/\r
void operator()(const T* ptr) {delete const_cast<T*>(ptr);}\r
{\r
/**\r
* Function operator to delete an object.\r
- * \r
+ *\r
* @param p a pair in which the second component is the object to delete\r
*/\r
void operator()(const std::pair<const A,B*>& p) {delete p.second;}\r
{\r
/**\r
* Function operator to delete an object stored as const\r
- * \r
+ *\r
* @param p a pair in which the second component is the const object to delete\r
*/\r
void operator()(const std::pair<const A,const B*>& p) {delete const_cast<B*>(p.second);}\r