Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
core::chemical::ElementSet Class Reference

A set of Elements. More...

#include <ElementSet.hh>

Inheritance diagram for core::chemical::ElementSet:
Inheritance graph
[legend]
Collaboration diagram for core::chemical::ElementSet:
Collaboration graph
[legend]

Public Member Functions

 ElementSet ()
 
virtual ~ElementSet ()
 
Size n_elements () const
 Number of elements in the set. More...
 
bool contains_element_type (std::string const &element_symbol) const
 Check if there is an element_type associated with an element_symbol string. More...
 
int element_index (std::string const &element_symbol) const
 Lookup the element index by the element_symbol string. More...
 
Element const & operator[] (Size const index) const
 Lookup an Element by 1-based indexing. More...
 
void read_file (std::string const &filename)
 Load the ElementSet from a file. More...
 
void print_all_types ()
 Print all of the symbols of all of the Elements in the set. Usefull for debuging. More...
 

Private Attributes

std::map< std::string, intelement_index_
 element_index_ lookup map More...
 
utility::vector1< Element * > elements_
 a collection of Elements, More...
 

Detailed Description

A set of Elements.

This class contains a vector of pointers each of which points to an Element and the vector index is looked up by an element_name string in a map.

Constructor & Destructor Documentation

core::chemical::ElementSet::ElementSet ( )
core::chemical::ElementSet::~ElementSet ( )
virtual

Member Function Documentation

bool core::chemical::ElementSet::contains_element_type ( std::string const &  element_symbol) const
inline

Check if there is an element_type associated with an element_symbol string.

References element_index_.

int core::chemical::ElementSet::element_index ( std::string const &  element_symbol) const
inline

Lookup the element index by the element_symbol string.

References element_index_.

Size core::chemical::ElementSet::n_elements ( ) const
inline

Number of elements in the set.

References elements_.

Element const& core::chemical::ElementSet::operator[] ( Size const  index) const
inline

Lookup an Element by 1-based indexing.

References elements_.

void core::chemical::ElementSet::print_all_types ( )

Print all of the symbols of all of the Elements in the set. Usefull for debuging.

This function iterates over each element in the element_index_ map and prints both keys. It is only used for debugging.

References element_index_.

void core::chemical::ElementSet::read_file ( std::string const &  filename)

Load the ElementSet from a file.

Initialize an ElementSet from an external file "filename", and set parameters and properties for each Element. Refer to minirosetta_database_stock/chemical/element_properties.txt for file format

References element_index_, elements_, and core::chemical::tr().

Member Data Documentation

std::map< std::string, int > core::chemical::ElementSet::element_index_
private

element_index_ lookup map

element_index_ allows lookup of the element by its symbol

Referenced by contains_element_type(), element_index(), print_all_types(), and read_file().

utility::vector1< Element* > core::chemical::ElementSet::elements_
private

a collection of Elements,

Element has data of atom properties, and it can be looked up by element_index.

Referenced by n_elements(), operator[](), and read_file().


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