Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
utility::tag::XMLSchemaAttribute Class Reference

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>

Inheritance diagram for utility::tag::XMLSchemaAttribute:
Inheritance graph
[legend]

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
 
XMLSchemaAttributeoperator= (XMLSchemaAttribute const &)=default
 
XMLSchemaAttributename (std::string const &setting)
 
XMLSchemaAttributetype (XMLSchemaType setting)
 
XMLSchemaAttributedefault_value (std::string const &setting)
 
XMLSchemaAttributedescription (std::string const &setting)
 
XMLSchemaAttributeis_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
 
- Public Member Functions inherited from utility::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

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_
 

Detailed Description

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.

Constructor & Destructor Documentation

utility::tag::XMLSchemaAttribute::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>
utility::tag::XMLSchemaAttribute::XMLSchemaAttribute ( Tname &&  name,
XMLSchemaType const &  type,
Tdesc &&  description 
)
inline
utility::tag::XMLSchemaAttribute::XMLSchemaAttribute ( XMLSchemaAttribute const &  )
default
utility::tag::XMLSchemaAttribute::XMLSchemaAttribute ( XMLSchemaAttribute &&  )
defaultnoexcept

Member Function Documentation

XMLSchemaAttribute utility::tag::XMLSchemaAttribute::attribute_w_default ( std::string const &  name,
XMLSchemaType  type,
std::string const &  desc,
std::string const &  default_value 
)
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)
std::string const & utility::tag::XMLSchemaAttribute::element_name ( ) const
overridevirtual
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_.

XMLSchemaAttribute& utility::tag::XMLSchemaAttribute::operator= ( XMLSchemaAttribute const &  )
default
void utility::tag::XMLSchemaAttribute::prepare_for_output ( XMLSchemaDefinition xsd) const
overridevirtual
XMLSchemaAttribute utility::tag::XMLSchemaAttribute::required_attribute ( std::string const &  name,
XMLSchemaType  type,
std::string const &  desc 
)
static
XMLSchemaAttribute & utility::tag::XMLSchemaAttribute::type ( XMLSchemaType  setting)

References type_.

XMLSchemaType const & utility::tag::XMLSchemaAttribute::type ( ) const

References type_.

void utility::tag::XMLSchemaAttribute::write_definition ( int  indentation,
std::ostream &  os 
) const
overridevirtual

Member Data Documentation

std::string utility::tag::XMLSchemaAttribute::default_value_
private

Referenced by default_value(), and write_definition().

std::string utility::tag::XMLSchemaAttribute::description_
private

Referenced by description(), and write_definition().

bool utility::tag::XMLSchemaAttribute::is_required_
private

Referenced by is_required(), and write_definition().

std::string utility::tag::XMLSchemaAttribute::name_
private
XMLSchemaType utility::tag::XMLSchemaAttribute::type_
private

The documentation for this class was generated from the following files: