Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
ElementList Class Reference

A type used as a collection of elements. More...

#include <ElementList.hpp>

Public Types

using value_type = Element
 The type of the value stored in a ElementList (for STL compatibility reasons).
 

Public Member Functions

 ElementList ()
 Construct a default ElementList object.
 
 ElementList (std::initializer_list< Element > elements)
 Construct an ElementList object with given elements.
 
 ElementList (const Vec< Element > &elements)
 Construct an ElementList object with given elements.
 
auto append (const Element &element) -> void
 Append a new element to the list of elements.
 
auto data () const -> const Vec< Element > &
 Return the internal collection of Element objects.
 
auto empty () const -> bool
 Return true if there are no elements in the collection.
 
auto size () const -> Index
 Return the number of elements in the collection.
 
auto operator[] (Index i) const -> const Element &
 Return the Element object with given index.
 
auto find (const String &symbol) const -> Index
 Return the index of the first element with given symbol or the number of elements if not found.
 
auto findWithSymbol (const String &symbol) const -> Index
 Return the index of the first element with given symbol or the number of elements if not found.
 
auto findWithName (const String &name) const -> Index
 Return the index of the first element with given unique name or the number of elements if not found.
 
auto index (const String &symbol) const -> Index
 Return the index of the first element with given symbol or throw a runtime error if not found.
 
auto indexWithSymbol (const String &symbol) const -> Index
 Return the index of the first element with given symbol or throw a runtime error if not found.
 
auto indexWithName (const String &name) const -> Index
 Return the index of the first element with given unique name or throw a runtime error if not found.
 
auto get (const String &symbol) const -> const Element &
 Return the element with given symbol.
 
auto getWithSymbol (const String &symbol) const -> const Element &
 Return the element with given symbol.
 
auto getWithName (const String &name) const -> const Element &
 Return the element with given name.
 
auto withSymbols (const StringList &symbols) const -> ElementList
 Return all elements with given symbols.
 
auto withNames (const StringList &names) const -> ElementList
 Return all elements with given names.
 
auto withTag (const String &tag) const -> ElementList
 Return all elements with a given tag.
 
auto withoutTag (const String &tag) const -> ElementList
 Return all elements without a given tag.
 
auto withTags (const StringList &tags) const -> ElementList
 Return all elements with given tags.
 
auto withoutTags (const StringList &tags) const -> ElementList
 Return all elements without given tags.
 
 operator Vec< Element > & ()
 Convert this ElementList object into its Vec<Element>.
 
 operator Vec< Element >const & () const
 Convert this ElementList object into its Vec<Element>.
 
template<typename InputIterator >
 ElementList (InputIterator begin, InputIterator end)
 Construct an ElementList object with given begin and end iterators.
 
auto begin () const
 Return begin const iterator of this ElementList instance (for STL compatibility reasons).
 
auto begin ()
 Return begin iterator of this ElementList instance (for STL compatibility reasons).
 
auto end () const
 Return end const iterator of this ElementList instance (for STL compatibility reasons).
 
auto end ()
 Return end iterator of this ElementList instance (for STL compatibility reasons).
 
auto push_back (const Element &elements) -> void
 Append a new Element at the back of the container (for STL compatibility reasons).
 
template<typename Iterator , typename InputIterator >
auto insert (Iterator pos, InputIterator begin, InputIterator end) -> void
 Insert a container of Element objects into this ElementList instance (for STL compatibility reasons).
 

Detailed Description

A type used as a collection of elements.


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