Rosetta Utilities  2014.35
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>

Public Types

typedef std::map< std::string,
std::string > 
options_t
 
typedef utility::vector0< TagCOPtags_t
 
- Public Types inherited from utility::pointer::ReferenceCount
typedef platform::Size Size
 
typedef platform::Size size_type
 

Public Member Functions

virtual ~Tag ()
 Automatically generated virtual destructor for class deriving directly from ReferenceCount. More...
 
 Tag ()
 
void clear ()
 
size_t size () const
 
void setName (std::string const &name)
 
std::string const & getName () const
 
TagCOP 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
 
bool hasOption (std::string const &key) const
 
template<class T >
void setOption (std::string const &key, T const &value)
 
template<class 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 >
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 write (std::ostream &out, int num_tabs=0) const
 
TagCOP const & operator[] (std::string const &key) const
 
void die_for_unaccessed_options () const
 
void die_for_unaccessed_options_recursively () const
 
TagOP clone () const
 
template<>
bool getOption (std::string const &key, bool const &t_default) const
 
template<>
bool 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
 
- Public Member Functions inherited from utility::pointer::ReferenceCount
void ctor ()
 
virtual ~ReferenceCount ()
 Destructor. More...
 
Size ref_count () const
 Reference count. More...
 

Static Public Member Functions

static TagOP create (std::istream &in)
 
static TagOP create (std::string instring)
 

Private Attributes

std::string name_
 
options_t mOptions_
 
options_t accessed_options_
 
tags_t vTags_
 
std::map< std::string, tags_tmvTags_
 
TagCOP parentTag_
 

Static Private Attributes

static utility::vector0
< TagCOP > const 
vEmpty_
 

Additional Inherited Members

- Protected Member Functions inherited from utility::pointer::ReferenceCount
 ReferenceCount ()
 Default constructor. More...
 
 ReferenceCount (ReferenceCount const &)
 Copy constructor. More...
 
ReferenceCountoperator= (ReferenceCount const &)
 Copy assignment. More...
 

Member Typedef Documentation

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

Constructor & Destructor Documentation

utility::tag::Tag::~Tag ( )
virtual

Automatically generated virtual destructor for class deriving directly from ReferenceCount.

Auto-generated virtual destructor

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

Member Function Documentation

void utility::tag::Tag::addTag ( TagOP  tag)
void utility::tag::Tag::clear ( )
TagOP utility::tag::Tag::clone ( ) const

References clone().

TagOP utility::tag::Tag::create ( std::istream &  in)
static

References tag.

TagOP utility::tag::Tag::create ( std::string  instring)
static
void utility::tag::Tag::die_for_unaccessed_options ( ) const
void utility::tag::Tag::die_for_unaccessed_options_recursively ( ) const
std::string const& utility::tag::Tag::getName ( ) const
inline

References name_.

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_, basic::options::OptionKeys::key, mOptions_, and basic::T().

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_, basic::options::OptionKeys::key, mOptions_, and basic::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<>
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 utility::is_false_string(), utility::is_true_string(), and basic::options::OptionKeys::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 utility::is_false_string(), utility::is_true_string(), and basic::options::OptionKeys::key.

Tag::options_t const & utility::tag::Tag::getOptions ( ) const
TagCOP 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
utility::vector0< TagCOP > const & utility::tag::Tag::getTags ( std::string const &  name) const
bool utility::tag::Tag::hasOption ( std::string const &  key) const
bool utility::tag::Tag::hasTag ( std::string const &  name) const
TagCOP const & utility::tag::Tag::operator[] ( std::string const &  key) const
void utility::tag::Tag::read ( std::istream &  in)
void utility::tag::Tag::setName ( std::string const &  name)

References 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 options.

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

References tag.

Referenced by utility::tag::operator<<().

Member Data Documentation

options_t utility::tag::Tag::accessed_options_
mutableprivate

Referenced by getOption(), and setOption().

options_t utility::tag::Tag::mOptions_
private

Referenced by getOption(), and setOption().

std::map<std::string,tags_t> utility::tag::Tag::mvTags_
private
std::string utility::tag::Tag::name_
private

Referenced by getName().

TagCOP utility::tag::Tag::parentTag_
private

Referenced by getParent().

utility::vector0< TagCOP > const utility::tag::Tag::vEmpty_
staticprivate
tags_t utility::tag::Tag::vTags_
private

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