![]() |
Rosetta
2020.11
|
class XMLSchemaAttribute represents what we refer to in Rosetta as an option for a tag. An attribute would reside inside of a tag, such as "scorefxn" in this tag (this XML Element): <MinMover name="min" scorefxn="talaris2014"> More...
#include <XMLSchemaGeneration.hh>
Public Member Functions | |
XMLSchemaAttribute () | |
template<class Tname , class Tdesc , typename = typename std::enable_if< utility::type_traits::is_string_constructible<Tname>::value >::type, typename = typename std::enable_if< utility::type_traits::is_string_constructible<Tdesc>::value >::type> | |
XMLSchemaAttribute (Tname &&name, XMLSchemaType const &type, Tdesc &&description) | |
XMLSchemaAttribute (XMLSchemaAttribute const &)=default | |
XMLSchemaAttribute (XMLSchemaAttribute &&) noexcept=default | |
XMLSchemaAttribute & | operator= (XMLSchemaAttribute const &)=default |
XMLSchemaAttribute & | name (std::string const &setting) |
XMLSchemaAttribute & | type (XMLSchemaType setting) |
XMLSchemaAttribute & | default_value (std::string const &setting) |
XMLSchemaAttribute & | description (std::string const &setting) |
XMLSchemaAttribute & | is_required (bool setting) |
XMLSchemaType const & | type () const |
std::string const & | element_name () const override |
void | write_definition (int indentation, std::ostream &os) const override |
void | prepare_for_output (XMLSchemaDefinition &xsd) const override |
![]() | |
ReferenceCount () | |
Default constructor. More... | |
virtual | ~ReferenceCount () |
Static Public Member Functions | |
static XMLSchemaAttribute | required_attribute (std::string const &name, XMLSchemaType type, std::string const &desc) |
static XMLSchemaAttribute | attribute_w_default (std::string const &name, XMLSchemaType type, std::string const &desc, std::string const &default_value) |
Private Attributes | |
std::string | name_ |
XMLSchemaType | type_ |
std::string | default_value_ |
bool | is_required_ |
std::string | description_ |
Additional Inherited Members | |
![]() | |
typedef platform::Size | Size |
typedef platform::Size | size_type |
class XMLSchemaAttribute represents what we refer to in Rosetta as an option for a tag. An attribute would reside inside of a tag, such as "scorefxn" in this tag (this XML Element): <MinMover name="min" scorefxn="talaris2014">
The "name" of an attribute is what will live on the left-hand side of the equals sign, e.g. "scorefxn" in the MinMover example above. The type of the attribute refers to the structure of the data on the right-hand side of the equals sign. Attributes may also define a default value, which is a useful way to communicate default behaviors to users. Finally, an attribute can be listed as being required or not. By default, attributes are not required, so not specifying whether the attribute is required means that it is not required. An example of a required attribute would be the "name" attribute for the MinMover.
Once all of the details of an XMLAttribute have been set, it will write its definition to an output stream in its write_definition method.
utility::tag::XMLSchemaAttribute::XMLSchemaAttribute | ( | ) |
|
inline |
References CREATE_EXCEPTION, and utility::tag::string_contains_gt_lt_or_ampersand().
|
default |
|
defaultnoexcept |
|
static |
References default_value().
XMLSchemaAttribute & utility::tag::XMLSchemaAttribute::default_value | ( | std::string const & | setting | ) |
References default_value_.
Referenced by attribute_w_default().
XMLSchemaAttribute & utility::tag::XMLSchemaAttribute::description | ( | std::string const & | setting | ) |
References CREATE_EXCEPTION, description_, name_, and utility::tag::string_contains_gt_lt_or_ampersand().
|
overridevirtual |
Implements utility::tag::XMLSchemaTopLevelElement.
References name_.
XMLSchemaAttribute & utility::tag::XMLSchemaAttribute::is_required | ( | bool | setting | ) |
References is_required_.
Referenced by required_attribute().
XMLSchemaAttribute & utility::tag::XMLSchemaAttribute::name | ( | std::string const & | setting | ) |
References name_.
|
default |
|
overridevirtual |
|
static |
References is_required().
Referenced by utility::tag::required_name_attribute().
XMLSchemaAttribute & utility::tag::XMLSchemaAttribute::type | ( | XMLSchemaType | setting | ) |
References type_.
XMLSchemaType const & utility::tag::XMLSchemaAttribute::type | ( | ) | const |
References type_.
|
overridevirtual |
Implements utility::tag::XMLSchemaTopLevelElement.
References default_value_, description_, utility::tag::indent_w_spaces(), is_required_, name_, type_, and utility::tag::XMLSchemaType::type_name().
|
private |
Referenced by default_value(), and write_definition().
|
private |
Referenced by description(), and write_definition().
|
private |
Referenced by is_required(), and write_definition().
|
private |
Referenced by description(), element_name(), name(), and write_definition().
|
private |
Referenced by prepare_for_output(), type(), and write_definition().