Skip to content
Snippets Groups Projects
Commit e3469b0e authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Added attribute isSet()

parent 2c77b8e1
No related branches found
No related tags found
No related merge requests found
......@@ -518,6 +518,7 @@ SET(INCLUDES
MJCF/elements/has_member.hpp
MJCF/elements/core/AnyElement.h
MJCF/elements/core/Attribute.h
MJCF/elements/core/const_aware_ptr.hpp
MJCF/elements/core/Element.h
MJCF/elements/core/exceptions.h
MJCF/elements/core/mjcf_utils.h
......
......@@ -101,6 +101,9 @@ namespace mjcf
/// Indicate whether the attribute has a default (implies optional).
virtual bool hasDefault() const = 0;
/// Indicate whether the attribute is set.
bool isSet() const { return this->owner().isAttributeSet(this->name); }
protected:
......@@ -181,6 +184,7 @@ namespace mjcf
private:
AttrT defaultValue; ///< The default value.
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment