SLHAea
0.1
containers for SUSY Les Houches Accord input/output
|
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 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 |
Public Member Functions | |
Coll () | |
Constructs an empty Coll. More... | |
Coll (std::istream &is) | |
Constructs a Coll with content from an input stream. More... | |
Coll & | read (std::istream &is) |
Assigns content from an input stream to the Coll. More... | |
Coll & | str (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... | |
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.
typedef std::string key_type |
typedef Block value_type |
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 |
|
inline |
Constructs an empty Coll.
|
inlineexplicit |
Constructs a Coll with content from an input stream.
is | Input stream to read content from. |
|
inlinestatic |
Constructs a Coll with content from a string.
coll | String to read content from. |
|
inline |
Assigns content from an input stream to the Coll.
is | Input stream to read content from. |
*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.
|
inline |
Assigns content from a string to the Coll.
coll | String that is used as content for the Coll. |
*this
.
|
inline |
Returns a string representation of the Coll.
Locates a Block in the Coll.
blockName | Name of the Block to be located. |
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.
Locates a Block in the Coll.
blockName | Name of the Block to be located. |
std::out_of_range | If no Block with the name blockName exists. |
|
inline |
|
inline |
Locates a Block in the Coll.
key | First strings of the block definition of the Block to be located. |
std::out_of_range | If 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.
|
inline |
Locates a Block in the Coll.
key | First strings of the block definition of the Block to be located. |
std::out_of_range | If 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.
|
inline |
Returns a read/write reference to the first element of the Coll.
|
inline |
Returns a read-only (constant) reference to the first element of the Coll.
|
inline |
Returns a read/write reference to the last element of the Coll.
|
inline |
Returns a read-only (constant) reference to the last element of the Coll.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Accesses a single field in the Coll.
key | Key that refers to the field that should be accessed. |
key
. std::out_of_range | If key refers to a non-existing field. |
|
inline |
Accesses a single field in the Coll.
key | Key that refers to the field that should be accessed. |
key
. std::out_of_range | If key refers to a non-existing field. |
|
inline |
Returns a read/write iterator that points to the first element in the Coll.
Iteration is done in ordinary element order.
|
inline |
Returns a read-only (constant) iterator that points to the first element in the Coll.
Iteration is done in ordinary element order.
|
inline |
Returns a read-only (constant) iterator that points to the first element in the Coll.
Iteration is done in ordinary element order.
|
inline |
Returns a read/write iterator that points one past the last element in the Coll.
Iteration is done in ordinary element order.
|
inline |
Returns a read-only (constant) iterator that points one past the last element in the Coll.
Iteration is done in ordinary element order.
|
inline |
Returns a read-only (constant) iterator that points one past the last element in the Coll.
Iteration is done in ordinary element order.
|
inline |
Returns a read/write reverse iterator that points to the last element in the Coll.
Iteration is done in reverse element order.
|
inline |
Returns a read-only (constant) reverse iterator that points to the last element in the Coll.
Iteration is done in reverse element order.
|
inline |
Returns a read-only (constant) reverse iterator that points to the last element in the Coll.
Iteration is done in reverse element order.
|
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.
|
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.
|
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.
Tries to locate a Block in the Coll.
blockName | Name of the Block to be located. |
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().
|
inline |
Tries to locate a Block in the Coll.
blockName | Name of the Block to be located. |
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.
|
inlinestatic |
Tries to locate a Block in a range.
first,last | Input iterators to the initial and final positions in a sequence. |
blockName | Name of the Block to be located. |
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
.
|
inline |
Tries to locate a Block in the Coll.
key | First strings of the block definition of the Block to be located. |
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().
|
inline |
Tries to locate a Block in the Coll.
key | First strings of the block definition of the Block to be located. |
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.
|
inlinestatic |
Tries to locate a Block in a range.
first,last | Input iterators to the initial and final positions in a sequence. |
key | First strings of the block definition of the Block to be located. |
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
.
|
inline |
Returns the number of elements in the Coll.
|
inline |
Returns true if the Coll is empty.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Removes the last element.
This function shrinks the size() of the Coll by one.
|
inline |
|
inline |
Inserts a range into the Coll.
position | Iterator into the Coll. |
first,last | Input 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.
Erases element at given position
.
position | Iterator pointing to the element to be erased. |
This function erases the element at the given position
and thus shortens the Coll by one.
Erases a range of elements.
first | Iterator pointing to the first element to be erased. |
last | Iterator pointing to one past the last element to be erased. |
last
prior to erasing (or end()).This function erases the elements in the range [first
, last
) and shortens the Coll accordingly.
Erases first Block with a given name.
blockName | Name of the Block to be erased. |
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.
Erases last Block with a given name.
blockName | Name of the Block to be erased. |
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.
|
inline |
Swaps data with another Coll.
coll | Coll to be swapped with. |
|
inline |
Erases all the elements in the Coll.
|
inline |
Reformats all Blocks in the Coll.
|
inline |
|
inline |
Uncomments all Blocks in the Coll.