SLHAea  0.1
containers for SUSY Les Houches Accord input/output
 All Classes Namespaces Files Functions Variables Typedefs
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Coll Class Reference

Container of Blocks that resembles a complete SLHA structure. More...

#include <slhaea.h>

Classes

struct  key_matches
 Unary predicate that checks if a provided name matches the name of a Block. More...
 
struct  key_matches_block_def
 Unary predicate that checks if a provided key matches the block definition of a Block. More...
 

Public Types

typedef std::string key_type
 
typedef Block value_type
 
typedef Blockreference
 
typedef const Blockconst_reference
 
typedef impl_type::iterator iterator
 
typedef impl_type::const_iterator const_iterator
 
typedef impl_type::reverse_iterator reverse_iterator
 
typedef
impl_type::const_reverse_iterator 
const_reverse_iterator
 
typedef impl_type::pointer pointer
 
typedef impl_type::const_pointer const_pointer
 
typedef impl_type::difference_type difference_type
 
typedef impl_type::size_type size_type
 

Public Member Functions

 Coll ()
 Constructs an empty Coll. More...
 
 Coll (std::istream &is)
 Constructs a Coll with content from an input stream. More...
 
Collread (std::istream &is)
 Assigns content from an input stream to the Coll. More...
 
Collstr (const std::string &coll)
 Assigns content from a string to the Coll. More...
 
std::string str () const
 Returns a string representation of the Coll. More...
 
reference operator[] (const key_type &blockName)
 Locates a Block in the Coll. More...
 
reference at (const key_type &blockName)
 Locates a Block in the Coll. More...
 
const_reference at (const key_type &blockName) const
 Locates a Block in the Coll. More...
 
reference at (const value_type::key_type &key)
 Locates a Block in the Coll. More...
 
const_reference at (const value_type::key_type &key) const
 Locates a Block in the Coll. More...
 
reference front ()
 Returns a read/write reference to the first element of the Coll. More...
 
const_reference front () const
 Returns a read-only (constant) reference to the first element of the Coll. More...
 
reference back ()
 Returns a read/write reference to the last element of the Coll. More...
 
const_reference back () const
 Returns a read-only (constant) reference to the last element of the Coll. More...
 
reference block (const Key &key)
 Accesses a Block in the Coll. More...
 
const_reference block (const Key &key) const
 Accesses a Block in the Coll. More...
 
Block::reference line (const Key &key)
 Accesses a single Line in the Coll. More...
 
Block::const_reference line (const Key &key) const
 Accesses a single Line in the Coll. More...
 
Line::reference field (const Key &key)
 Accesses a single field in the Coll. More...
 
Line::const_reference field (const Key &key) const
 Accesses a single field in the Coll. More...
 
iterator begin ()
 Returns a read/write iterator that points to the first element in the Coll. More...
 
const_iterator begin () const
 Returns a read-only (constant) iterator that points to the first element in the Coll. More...
 
const_iterator cbegin () const
 Returns a read-only (constant) iterator that points to the first element in the Coll. More...
 
iterator end ()
 Returns a read/write iterator that points one past the last element in the Coll. More...
 
const_iterator end () const
 Returns a read-only (constant) iterator that points one past the last element in the Coll. More...
 
const_iterator cend () const
 Returns a read-only (constant) iterator that points one past the last element in the Coll. More...
 
reverse_iterator rbegin ()
 Returns a read/write reverse iterator that points to the last element in the Coll. More...
 
const_reverse_iterator rbegin () const
 Returns a read-only (constant) reverse iterator that points to the last element in the Coll. More...
 
const_reverse_iterator crbegin () const
 Returns a read-only (constant) reverse iterator that points to the last element in the Coll. More...
 
reverse_iterator rend ()
 Returns a read/write reverse iterator that points to one before the first element in the Coll. More...
 
const_reverse_iterator rend () const
 Returns a read-only (constant) reverse iterator that points to one before the first element in the Coll. More...
 
const_reverse_iterator crend () const
 Returns a read-only (constant) reverse iterator that points to one before the first element in the Coll. More...
 
iterator find (const key_type &blockName)
 Tries to locate a Block in the Coll. More...
 
const_iterator find (const key_type &blockName) const
 Tries to locate a Block in the Coll. More...
 
iterator find (const value_type::key_type &key)
 Tries to locate a Block in the Coll. More...
 
const_iterator find (const value_type::key_type &key) const
 Tries to locate a Block in the Coll. More...
 
size_type count (const key_type &blockName) const
 Counts all Blocks with a given name. More...
 
size_type size () const
 Returns the number of elements in the Coll. More...
 
size_type max_size () const
 Returns the size() of the largest possible Coll. More...
 
bool empty () const
 Returns true if the Coll is empty. More...
 
void push_back (const value_type &block)
 Adds a Block to the end of the Coll. More...
 
void push_back (const std::string &blockString)
 Adds a Block to the end of the Coll. More...
 
void push_front (const value_type &block)
 Adds a Block to the begin of the Coll. More...
 
void push_front (const std::string &blockString)
 Adds a Block to the begin of the Coll. More...
 
void pop_back ()
 Removes the last element. More...
 
iterator insert (iterator position, const value_type &block)
 Inserts a Block before given position. More...
 
template<class InputIterator >
void insert (iterator position, InputIterator first, InputIterator last)
 Inserts a range into the Coll. More...
 
iterator erase (iterator position)
 Erases element at given position. More...
 
iterator erase (iterator first, iterator last)
 Erases a range of elements. More...
 
iterator erase_first (const key_type &blockName)
 Erases first Block with a given name. More...
 
iterator erase_last (const key_type &blockName)
 Erases last Block with a given name. More...
 
size_type erase (const key_type &blockName)
 Erases all Blocks with a given name. More...
 
void swap (Coll &coll)
 Swaps data with another Coll. More...
 
void clear ()
 Erases all the elements in the Coll. More...
 
void reformat ()
 Reformats all Blocks in the Coll. More...
 
void comment ()
 Comments all Blocks in the Coll. More...
 
void uncomment ()
 Uncomments all Blocks in the Coll. More...
 

Static Public Member Functions

static Coll from_str (const std::string &coll)
 Constructs a Coll with content from a string. More...
 
template<class InputIterator >
static InputIterator find (InputIterator first, InputIterator last, const key_type &blockName)
 Tries to locate a Block in a range. More...
 
template<class InputIterator >
static InputIterator find (InputIterator first, InputIterator last, const value_type::key_type &key)
 Tries to locate a Block in a range. More...
 

Detailed Description

Container of Blocks that resembles a complete SLHA structure.

This class is a container of Blocks that resembles a complete SLHA structure. Its name is an abbreviation of "collection" since it is a collection of Blocks. The elements of Coll objects can be accessed via their names (which are always compared case-insensitive) with the operator[]() and at() functions and access to single fields, Lines and Blocks via the Key type is provided by the field(), line() and block() functions. To fill this container, the functions read() or str() can be used which read data from an input stream or a string, respectively.

Examples:
01_basic_input.cpp, 02_basic_output.cpp, 03_basic_manip.cpp, 04_basic_iteration.cpp, 05_advanced_input.cpp, 06_advanced_output.cpp, 07_advanced_manip.cpp, 08_matrix_input.cpp, 09_decay_input.cpp, 10_blocks_of_the_same_name.cpp, and 11_multiple_columns.cpp.

Member Typedef Documentation

typedef std::string key_type
typedef Block value_type
typedef Block& reference
typedef const Block& const_reference
typedef impl_type::iterator iterator
typedef impl_type::const_iterator const_iterator
typedef impl_type::reverse_iterator reverse_iterator
typedef impl_type::const_reverse_iterator const_reverse_iterator
typedef impl_type::pointer pointer
typedef impl_type::const_pointer const_pointer
typedef impl_type::difference_type difference_type
typedef impl_type::size_type size_type

Constructor & Destructor Documentation

Coll ( )
inline

Constructs an empty Coll.

+ Here is the caller graph for this function:

Coll ( std::istream &  is)
inlineexplicit

Constructs a Coll with content from an input stream.

Parameters
isInput stream to read content from.
See Also
read()

+ Here is the call graph for this function:

Member Function Documentation

static Coll from_str ( const std::string &  coll)
inlinestatic

Constructs a Coll with content from a string.

Parameters
collString to read content from.

+ Here is the call graph for this function:

Coll& read ( std::istream &  is)
inline

Assigns content from an input stream to the Coll.

Parameters
isInput stream to read content from.
Returns
Reference to *this.

This function reads non-empty lines from is, transforms them into Lines, which are collected into the corresponding Blocks that are added to the Coll.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Coll& str ( const std::string &  coll)
inline

Assigns content from a string to the Coll.

Parameters
collString that is used as content for the Coll.
Returns
Reference to *this.

+ Here is the call graph for this function:

std::string str ( ) const
inline

Returns a string representation of the Coll.

reference operator[] ( const key_type blockName)
inline

Locates a Block in the Coll.

Parameters
blockNameName of the Block to be located.
Returns
Read/write reference to sought-after Block.

This function locates the first Block whose name equals blockName. If no such Block is present, an empty Block with this name is added to the end of the Coll and a reference to it is then returned.

+ Here is the call graph for this function:

reference at ( const key_type blockName)
inline

Locates a Block in the Coll.

Parameters
blockNameName of the Block to be located.
Returns
Read/write reference to sought-after Block.
Exceptions
std::out_of_rangeIf no Block with the name blockName exists.
Examples:
03_basic_manip.cpp, 05_advanced_input.cpp, 08_matrix_input.cpp, 09_decay_input.cpp, 10_blocks_of_the_same_name.cpp, and 11_multiple_columns.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const_reference at ( const key_type blockName) const
inline

Locates a Block in the Coll.

Parameters
blockNameName of the Block to be located.
Returns
Read-only (constant) reference to sought-after Block.
Exceptions
std::out_of_rangeIf no Block with the name blockName exists.

+ Here is the call graph for this function:

reference at ( const value_type::key_type key)
inline

Locates a Block in the Coll.

Parameters
keyFirst strings of the block definition of the Block to be located.
Returns
Read/write reference to sought-after Block.
Exceptions
std::out_of_rangeIf key does not match any block definition.

This functions takes a vector of strings and locates the Block whose first strings of the block definition are equal to the strings in key. If no such Block exists, std::out_of_range is thrown.

+ Here is the call graph for this function:

const_reference at ( const value_type::key_type key) const
inline

Locates a Block in the Coll.

Parameters
keyFirst strings of the block definition of the Block to be located.
Returns
Read-only (constant) reference to sought-after Block.
Exceptions
std::out_of_rangeIf key does not match any block definition.

This functions takes a vector of strings and locates the Block whose first strings of the block definition are equal to the strings in key. If no such Block exists, std::out_of_range is thrown.

+ Here is the call graph for this function:

reference front ( )
inline

Returns a read/write reference to the first element of the Coll.

const_reference front ( ) const
inline

Returns a read-only (constant) reference to the first element of the Coll.

reference back ( )
inline

Returns a read/write reference to the last element of the Coll.

+ Here is the caller graph for this function:

const_reference back ( ) const
inline

Returns a read-only (constant) reference to the last element of the Coll.

Coll::reference block ( const Key key)
inline

Accesses a Block in the Coll.

Parameters
keyKey that refers to the Block that should be accessed.
Returns
Read/write reference to the Block referred to by key.
Exceptions
std::out_of_rangeIf key refers to a non-existing Block.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Coll::const_reference block ( const Key key) const
inline

Accesses a Block in the Coll.

Parameters
keyKey that refers to the Block that should be accessed.
Returns
Read-only (constant) reference to the Block referred to by key.
Exceptions
std::out_of_rangeIf key refers to a non-existing Block.

+ Here is the call graph for this function:

Block::reference line ( const Key key)
inline

Accesses a single Line in the Coll.

Parameters
keyKey that refers to the Line that should be accessed.
Returns
Read/write reference to the Line referred to by key.
Exceptions
std::out_of_rangeIf key refers to a non-existing Line.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Block::const_reference line ( const Key key) const
inline

Accesses a single Line in the Coll.

Parameters
keyKey that refers to the Line that should be accessed.
Returns
Read-only (constant) reference to the Line referred to by key.
Exceptions
std::out_of_rangeIf key refers to a non-existing Line.

+ Here is the call graph for this function:

Line::reference field ( const Key key)
inline

Accesses a single field in the Coll.

Parameters
keyKey that refers to the field that should be accessed.
Returns
Read/write reference to the field referred to by key.
Exceptions
std::out_of_rangeIf key refers to a non-existing field.
Examples:
09_decay_input.cpp.

+ Here is the call graph for this function:

Line::const_reference field ( const Key key) const
inline

Accesses a single field in the Coll.

Parameters
keyKey that refers to the field that should be accessed.
Returns
Read-only (constant) reference to the field referred to by key.
Exceptions
std::out_of_rangeIf key refers to a non-existing field.

+ Here is the call graph for this function:

iterator begin ( )
inline

Returns a read/write iterator that points to the first element in the Coll.

Iteration is done in ordinary element order.

Examples:
03_basic_manip.cpp, and 07_advanced_manip.cpp.

+ Here is the caller graph for this function:

const_iterator begin ( ) const
inline

Returns a read-only (constant) iterator that points to the first element in the Coll.

Iteration is done in ordinary element order.

const_iterator cbegin ( ) const
inline

Returns a read-only (constant) iterator that points to the first element in the Coll.

Iteration is done in ordinary element order.

iterator end ( )
inline

Returns a read/write iterator that points one past the last element in the Coll.

Iteration is done in ordinary element order.

Examples:
03_basic_manip.cpp, 04_basic_iteration.cpp, and 07_advanced_manip.cpp.

+ Here is the caller graph for this function:

const_iterator end ( ) const
inline

Returns a read-only (constant) iterator that points one past the last element in the Coll.

Iteration is done in ordinary element order.

const_iterator cend ( ) const
inline

Returns a read-only (constant) iterator that points one past the last element in the Coll.

Iteration is done in ordinary element order.

reverse_iterator rbegin ( )
inline

Returns a read/write reverse iterator that points to the last element in the Coll.

Iteration is done in reverse element order.

Examples:
10_blocks_of_the_same_name.cpp.

+ Here is the caller graph for this function:

const_reverse_iterator rbegin ( ) const
inline

Returns a read-only (constant) reverse iterator that points to the last element in the Coll.

Iteration is done in reverse element order.

const_reverse_iterator crbegin ( ) const
inline

Returns a read-only (constant) reverse iterator that points to the last element in the Coll.

Iteration is done in reverse element order.

reverse_iterator rend ( )
inline

Returns a read/write reverse iterator that points to one before the first element in the Coll.

Iteration is done in reverse element order.

Examples:
10_blocks_of_the_same_name.cpp.

+ Here is the caller graph for this function:

const_reverse_iterator rend ( ) const
inline

Returns a read-only (constant) reverse iterator that points to one before the first element in the Coll.

Iteration is done in reverse element order.

const_reverse_iterator crend ( ) const
inline

Returns a read-only (constant) reverse iterator that points to one before the first element in the Coll.

Iteration is done in reverse element order.

iterator find ( const key_type blockName)
inline

Tries to locate a Block in the Coll.

Parameters
blockNameName of the Block to be located.
Returns
Read/write iterator pointing to sought-after element, or end() if not found.

This function takes a key and tries to locate the Block whose name matches blockName. If successful the function returns a read/write iterator pointing to the sought after Block. If unsuccessful it returns end().

Examples:
03_basic_manip.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const_iterator find ( const key_type blockName) const
inline

Tries to locate a Block in the Coll.

Parameters
blockNameName of the Block to be located.
Returns
Read-only (constant) iterator pointing to sought-after element, or end() const if not found.

This function takes a key and tries to locate the Block whose name matches blockName. If successful the function returns a read-only (constant) iterator pointing to the sought after Block. If unsuccessful it returns end() const.

+ Here is the call graph for this function:

static InputIterator find ( InputIterator  first,
InputIterator  last,
const key_type blockName 
)
inlinestatic

Tries to locate a Block in a range.

Parameters
first,lastInput iterators to the initial and final positions in a sequence.
blockNameName of the Block to be located.
Returns
Iterator pointing to sought-after element, or last if not found.

This function tries to locate in the range [first, last) the Block whose name matches blockName. If successful the function returns an iterator pointing to the sought after Block. If unsuccessful it returns last.

iterator find ( const value_type::key_type key)
inline

Tries to locate a Block in the Coll.

Parameters
keyFirst strings of the block definition of the Block to be located.
Returns
Read/write iterator pointing to sought-after element, or end() if not found.

This functions takes a vector of strings and tries to locate the Block whose first strings of the block definition are equal to the strings in key. If successful the function returns a read/write iterator pointing to the sought after Block. If unsuccessful it returns end().

+ Here is the call graph for this function:

const_iterator find ( const value_type::key_type key) const
inline

Tries to locate a Block in the Coll.

Parameters
keyFirst strings of the block definition of the Block to be located.
Returns
Read-only (constant) iterator pointing to sought-after element, or end() const if not found.

This functions takes a vector of strings and tries to locate the Block whose first strings of the block definition are equal to the strings in key. If successful the function returns a read-only (constant) iterator pointing to the sought after Block. If unsuccessful it returns end() const.

+ Here is the call graph for this function:

static InputIterator find ( InputIterator  first,
InputIterator  last,
const value_type::key_type key 
)
inlinestatic

Tries to locate a Block in a range.

Parameters
first,lastInput iterators to the initial and final positions in a sequence.
keyFirst strings of the block definition of the Block to be located.
Returns
Iterator pointing to sought-after element, or last if not found.

This function tries to locate in the range [first, last) the Block whose first strings of the block definition are equal to the strings in key. If successful the function returns an iterator pointing to the sought after Block. If unsuccessful it returns last.

size_type count ( const key_type blockName) const
inline

Counts all Blocks with a given name.

Parameters
blockNameName of the Blocks that will be counted.
Returns
Number of blocks whose name equals blockName.

+ Here is the call graph for this function:

size_type size ( ) const
inline

Returns the number of elements in the Coll.

Examples:
07_advanced_manip.cpp.

+ Here is the caller graph for this function:

size_type max_size ( ) const
inline

Returns the size() of the largest possible Coll.

bool empty ( ) const
inline

Returns true if the Coll is empty.

void push_back ( const value_type block)
inline

Adds a Block to the end of the Coll.

Parameters
blockBlock to be added.

This function creates an element at the end of the Coll and assigns the given block to it.

+ Here is the caller graph for this function:

void push_back ( const std::string &  blockString)
inline

Adds a Block to the end of the Coll.

Parameters
blockStringString that is used to construct the Block that will be added.

This function creates an element at the end of the Coll and assigns the Block that is constructed from blockString to it.

+ Here is the call graph for this function:

void push_front ( const value_type block)
inline

Adds a Block to the begin of the Coll.

Parameters
blockBlock to be added.

This function creates an element at the begin of the Coll and assigns the given block to it.

void push_front ( const std::string &  blockString)
inline

Adds a Block to the begin of the Coll.

Parameters
blockStringString that is used to construct the Block that will be added.

This function creates an element at the begin of the Coll and assigns the Block that is constructed from blockString to it.

+ Here is the call graph for this function:

void pop_back ( )
inline

Removes the last element.

This function shrinks the size() of the Coll by one.

iterator insert ( iterator  position,
const value_type block 
)
inline

Inserts a Block before given position.

Parameters
positionIterator into the Coll.
blockBlock to be inserted.
Returns
Iterator pointing to the inserted element.

This function inserts a copy of block before the specified position and thus enlarges the Coll by one.

void insert ( iterator  position,
InputIterator  first,
InputIterator  last 
)
inline

Inserts a range into the Coll.

Parameters
positionIterator into the Coll.
first,lastInput iterators to the initial and final positions in a sequence.

This function inserts copies of the Blocks in the range [first, last) into the Coll before the specified position and thus enlarges the Coll accordingly.

iterator erase ( iterator  position)
inline

Erases element at given position.

Parameters
positionIterator pointing to the element to be erased.
Returns
Iterator pointing to the next element (or end()).

This function erases the element at the given position and thus shortens the Coll by one.

Examples:
07_advanced_manip.cpp.

+ Here is the caller graph for this function:

iterator erase ( iterator  first,
iterator  last 
)
inline

Erases a range of elements.

Parameters
firstIterator pointing to the first element to be erased.
lastIterator pointing to one past the last element to be erased.
Returns
Iterator pointing to the element pointed to by last prior to erasing (or end()).

This function erases the elements in the range [first, last) and shortens the Coll accordingly.

iterator erase_first ( const key_type blockName)
inline

Erases first Block with a given name.

Parameters
blockNameName of the Block to be erased.
Returns
Iterator pointing to the next element (or end()).

This function takes a key and erases the first Block whose name matches blockName. If the Coll contains such Block, the function returns an iterator pointing to the next element (or end()). If no such Block exists, end() is returned.

+ Here is the call graph for this function:

iterator erase_last ( const key_type blockName)
inline

Erases last Block with a given name.

Parameters
blockNameName of the Block to be erased.
Returns
Iterator pointing to the next element (or end()).

This function takes a key and erases the last Block whose name matches blockName. If the Coll contains such Block, the function returns an iterator pointing to the next element (or end()). If no such Block exists, end() is returned.

+ Here is the call graph for this function:

size_type erase ( const key_type blockName)
inline

Erases all Blocks with a given name.

Parameters
blockNameName of the Blocks to be erased.
Returns
The number of Blocks erased.

+ Here is the call graph for this function:

void swap ( Coll coll)
inline

Swaps data with another Coll.

Parameters
collColl to be swapped with.
void clear ( )
inline

Erases all the elements in the Coll.

+ Here is the caller graph for this function:

void reformat ( )
inline

Reformats all Blocks in the Coll.

See Also
Block::reformat()

+ Here is the call graph for this function:

void comment ( )
inline

Comments all Blocks in the Coll.

See Also
Block::comment()

+ Here is the call graph for this function:

void uncomment ( )
inline

Uncomments all Blocks in the Coll.

See Also
Block::uncomment()

+ Here is the call graph for this function:


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