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

#include <Tag.hh>

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

Public Types

typedef std::map< std::string,
std::string > 
options_t
 
typedef utility::vector0< TagCOPtags_t
 

Public Member Functions

 ~Tag () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
 Tag ()
 
TagCOP get_self_ptr () const
 self pointers More...
 
TagOP get_self_ptr ()
 
TagCAP get_self_weak_ptr () const
 
TagAP get_self_weak_ptr ()
 
void clear ()
 
size_t size () const
 
void setName (std::string const &name)
 
std::string const & getName () const
 
TagCAP const & getParent () const
 
void addTag (TagOP tag)
 
utility::vector0< TagCOP > const & getTags () const
 
utility::vector0< TagCOP > const & getTags (std::string const &name) const
 
TagCOP const & getTag (std::string const &name) const
 
bool hasTag (std::string const &name) const
 Does the Tag have a specific sub-tag (branch) within (such as a MoveMap, etc.)? More...
 
bool hasOption (std::string const &key) const
 Does the Tag have a specific option? More...
 
template<class T >
void setOption (std::string const &key, T const &value)
 
void setAccessed (std::string const &key) const
 Set the 'accessed' annotation of this option, without bothering to get the value. Used to prevent no-longer relevant options from crashing the XML parsing. More...
 
template<class T >
T getOption (std::string const &key, T const &t_default) const
 Retrieve an option from the Tag with the given key name, using the provided default value (t_default) if the option is not present in the tag. More...
 
template<class T >
T getOption (std::string const &key) const
 Retrieve an option from the Tag with the given key name. More...
 
options_t const & getOptions () const
 
void setOptions (options_t const &options)
 
void read (std::istream &in)
 
void read (std::string const &tag_string)
 
void write (std::ostream &out, int num_tabs=0) const
 
std::string to_string (int num_tabs=0) const
 returns the string that would be written by write() More...
 
TagCOP const & operator[] (std::string const &key) const
 
Tagoperator= (Tag const &other)
 
void reset_accessed_options () const
 Recursively reset that accessed_options_ variable so that a re-parsing of the tag can identify options that have been given but that have not been read. More...
 
void die_for_unaccessed_options () const
 
void die_for_unaccessed_options_recursively () const
 
TagOP clone () const
 
void set_quote_options (bool const quote_options_val)
 if true, options will be quoted when the tag is outputted if false, options will be left as-is (default) More...
 
template<>
bool getOption (std::string const &key, bool const &t_default) const
 
template<>
bool getOption (std::string const &key) const
 
template<>
AutoBool getOption (std::string const &key, AutoBool const &t_default) const
 
template<>
AutoBool getOption (std::string const &key) const
 
template<>
bool getOption (std::string const &key, bool const &t_default) const
 
template<>
bool getOption (std::string const &key) const
 
template<>
AutoBool getOption (std::string const &key, AutoBool const &t_default) const
 
template<>
AutoBool getOption (std::string const &key) const
 
- 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 TagOP create (std::istream &in)
 
static TagOP create (std::string const &instring)
 

Private Attributes

std::string name_
 
options_t mOptions_
 
options_t accessed_options_
 
tags_t vTags_
 
std::map< std::string, tags_tmvTags_
 
TagCAP parentTag_
 
bool quote_options_
 if true, options will be quoted when the tag is outputted (default) if false, options will be left without quotes More...
 

Static Private Attributes

static utility::vector0
< TagCOP > const 
vEmpty_
 

Member Typedef Documentation

typedef std::map<std::string, std::string > utility::tag::Tag::options_t

Constructor & Destructor Documentation

utility::tag::Tag::~Tag ( )
overridedefault

Automatically generated virtual destructor for class deriving directly from VirtualBase.

Auto-generated virtual destructor

utility::tag::Tag::Tag ( )

Referenced by operator=().

Member Function Documentation

void utility::tag::Tag::addTag ( TagOP  tag)

References get_self_weak_ptr(), mvTags_, and vTags_.

Referenced by operator=().

void utility::tag::Tag::clear ( )

References mOptions_, mvTags_, name_, parentTag_, and vTags_.

Referenced by operator=().

TagOP utility::tag::Tag::clone ( ) const
TagOP utility::tag::Tag::create ( std::istream &  in)
static
TagOP utility::tag::Tag::create ( std::string const &  instring)
static
void utility::tag::Tag::die_for_unaccessed_options ( ) const
void utility::tag::Tag::die_for_unaccessed_options_recursively ( ) const
TagCOP utility::tag::Tag::get_self_ptr ( ) const
inline

self pointers

TagOP utility::tag::Tag::get_self_ptr ( )
inline
TagCAP utility::tag::Tag::get_self_weak_ptr ( ) const
inline

Referenced by addTag().

TagAP utility::tag::Tag::get_self_weak_ptr ( )
inline
std::string const& utility::tag::Tag::getName ( ) const
inline

References name_.

Referenced by add_protocols(), and reverse_convert().

template<class T >
T utility::tag::Tag::getOption ( std::string const &  key,
T const &  t_default 
) const
inline

Retrieve an option from the Tag with the given key name, using the provided default value (t_default) if the option is not present in the tag.

Exceptions
Throwsa utility::excn::EXCN_Msg_Exception if the boost::lexical_cast fails to convert the input type as requested.

References accessed_options_, CREATE_EXCEPTION, basic::options::OptionKeys::cloud::key, and mOptions_.

template<class T >
T utility::tag::Tag::getOption ( std::string const &  key) const
inline

Retrieve an option from the Tag with the given key name.

Exceptions
Throwsa utility::excn::EXCN_Msg_Exception if the an option with the given key is not present, or if the boost::lexical_cast fails to convert the input type as requested.

References accessed_options_, CREATE_EXCEPTION, basic::options::OptionKeys::cloud::key, mOptions_, and test.T007_TracerIO::T.

template<>
bool utility::tag::Tag::getOption ( std::string const &  key,
bool const &  t_default 
) const
template<>
bool utility::tag::Tag::getOption ( std::string const &  key) const
template<>
AutoBool utility::tag::Tag::getOption ( std::string const &  key,
AutoBool const &  t_default 
) const
template<>
AutoBool utility::tag::Tag::getOption ( std::string const &  key) const
template<>
bool utility::tag::Tag::getOption ( std::string const &  key,
bool const &  t_default 
) const

This is explicit specialization for boolean values to allow for use of "true" "false" etc. in addition to 1 and 0

Exceptions
Throwsa utility::excn::EXCN_Msg_Exception if the option is proviced, but the string that's given is not a valid true/false string (either "true", "false", "1" or "0").

References CREATE_EXCEPTION, utility::is_false_string(), utility::is_true_string(), and basic::options::OptionKeys::cloud::key.

template<>
bool utility::tag::Tag::getOption ( std::string const &  key) const
Exceptions
Throwsa utility::excn::EXCN_Msg_Exception if none of the accepted boolean strings is provided.

References CREATE_EXCEPTION, utility::is_false_string(), utility::is_true_string(), and basic::options::OptionKeys::cloud::key.

template<>
AutoBool utility::tag::Tag::getOption ( std::string const &  key,
AutoBool const &  t_default 
) const
template<>
AutoBool utility::tag::Tag::getOption ( std::string const &  key) const
Exceptions
Throwsa utility::excn::EXCN_Msg_Exception if none of the accepted boolean strings is provided.

References utility::tag::Auto, CREATE_EXCEPTION, utility::tag::False, utility::is_false_string(), utility::is_true_string(), basic::options::OptionKeys::cloud::key, utility::tag::True, and utility::upper().

Tag::options_t const & utility::tag::Tag::getOptions ( ) const

References mOptions_.

TagCAP const& utility::tag::Tag::getParent ( ) const
inline

References parentTag_.

TagCOP const & utility::tag::Tag::getTag ( std::string const &  name) const
utility::vector0< TagCOP > const & utility::tag::Tag::getTags ( ) const

References vTags_.

Referenced by add_protocols(), getTag(), hasTag(), and reverse_convert().

utility::vector0< TagCOP > const & utility::tag::Tag::getTags ( std::string const &  name) const

References mvTags_, and vEmpty_.

bool utility::tag::Tag::hasOption ( std::string const &  key) const

Does the Tag have a specific option?

References mOptions_.

bool utility::tag::Tag::hasTag ( std::string const &  name) const

Does the Tag have a specific sub-tag (branch) within (such as a MoveMap, etc.)?

References getTags().

Tag & utility::tag::Tag::operator= ( Tag const &  other)

References addTag(), clear(), mOptions_, name_, Tag(), tag, and vTags_.

TagCOP const & utility::tag::Tag::operator[] ( std::string const &  key) const

References getTag().

void utility::tag::Tag::read ( std::istream &  in)

References ObjexxFCL::read().

void utility::tag::Tag::read ( std::string const &  tag_string)
void utility::tag::Tag::reset_accessed_options ( ) const

Recursively reset that accessed_options_ variable so that a re-parsing of the tag can identify options that have been given but that have not been read.

References accessed_options_, and vTags_.

void utility::tag::Tag::set_quote_options ( bool const  quote_options_val)

if true, options will be quoted when the tag is outputted if false, options will be left as-is (default)

Parameters
[in]quote_options_valWhether or not option values should be quoted. Default=false
[in]quote_options_valWhether or not option values should be quoted. Default=true
void utility::tag::Tag::setAccessed ( std::string const &  key) const
inline

Set the 'accessed' annotation of this option, without bothering to get the value. Used to prevent no-longer relevant options from crashing the XML parsing.

References accessed_options_, and basic::options::OptionKeys::cloud::key.

void utility::tag::Tag::setName ( std::string const &  name)

References name, and name_.

template<class T >
void utility::tag::Tag::setOption ( std::string const &  key,
T const &  value 
)
inline
void utility::tag::Tag::setOptions ( options_t const &  options)

References accessed_options_, mOptions_, and options.

size_t utility::tag::Tag::size ( ) const

References vTags_.

std::string utility::tag::Tag::to_string ( int  num_tabs = 0) const

returns the string that would be written by write()

References basic::options::OptionKeys::mh::match::ss, and write().

void utility::tag::Tag::write ( std::ostream &  out,
int  num_tabs = 0 
) const

Member Data Documentation

options_t utility::tag::Tag::accessed_options_
mutableprivate
options_t utility::tag::Tag::mOptions_
private
std::map<std::string,tags_t> utility::tag::Tag::mvTags_
private

Referenced by addTag(), clear(), and getTags().

std::string utility::tag::Tag::name_
private
TagCAP utility::tag::Tag::parentTag_
private

Referenced by clear(), and getParent().

bool utility::tag::Tag::quote_options_
private

if true, options will be quoted when the tag is outputted (default) if false, options will be left without quotes

Referenced by write().

utility::vector0< TagCOP > const utility::tag::Tag::vEmpty_
staticprivate

Referenced by getTags().

tags_t utility::tag::Tag::vTags_
private

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