ug4
|
A container that is divided into different sections. More...
#include <section_container.h>
Classes | |
struct | Section |
Public Types | |
typedef Container::const_iterator | const_iterator |
typedef TContainer | Container |
typedef Container::iterator | iterator |
typedef TValue | value_type |
Public Member Functions | |
void | append (const SectionContainer &c) |
appends the elements of the given container to the current one More... | |
value_type & | back (int secIndex=-1) |
returns the last entry in the given section. More... | |
iterator | begin () |
const_iterator | begin () const |
void | clear () |
void | clear_section (int sectionIndex) |
iterator | end () |
const_iterator | end () const |
void | erase (const iterator &iter, int sectionIndex) |
value_type & | front (int secIndex=-1) |
returns the first entry in the given section. More... | |
Container & | get_container () |
returns the container for raw access. More... | |
iterator | insert (const TValue &val, int sectionIndex) |
uint | num_elements () const |
uint | num_elements (int sectionIndex) const |
int | num_sections () const |
iterator | section_begin (int sectionIndex) |
const_iterator | section_begin (int sectionIndex) const |
iterator | section_end (int sectionIndex) |
const_iterator | section_end (int sectionIndex) const |
SectionContainer () | |
void | transfer_elements (SectionContainer &c) |
takes all elements from the given section container and transfers them to this one. More... | |
Protected Types | |
typedef std::vector< Section > | SectionVec |
Protected Member Functions | |
void | add_sections (int num) |
Protected Attributes | |
Container | m_container |
uint | m_numElements |
SectionVec | m_vSections |
A container that is divided into different sections.
This container can be used to store values that have a common base, but can be sorted in different sections. The SectionContainer supplies you with interfaces to iterate over a certain section or to iterate over the complete container. The SectionContainer works on containers of the standard template library. Be sure, that TContainer holds values of type TValue. TContainer has to support the container operations of a std::list.
typedef Container::const_iterator ug::SectionContainer< TValue, TContainer >::const_iterator |
typedef TContainer ug::SectionContainer< TValue, TContainer >::Container |
typedef Container::iterator ug::SectionContainer< TValue, TContainer >::iterator |
|
protected |
typedef TValue ug::SectionContainer< TValue, TContainer >::value_type |
ug::SectionContainer< TValue, TContainer >::SectionContainer |
|
protected |
void ug::SectionContainer< TValue, TContainer >::append | ( | const SectionContainer< TValue, TContainer > & | c | ) |
appends the elements of the given container to the current one
Note that the append operation is performed for each section separately.
References ug::SectionContainer< TValue, TContainer >::num_sections(), ug::SectionContainer< TValue, TContainer >::section_begin(), and ug::SectionContainer< TValue, TContainer >::section_end().
Referenced by ug::MultiGridSubsetHandler::join_subset_lists().
SectionContainer< TValue, TContainer >::value_type & ug::SectionContainer< TValue, TContainer >::back | ( | int | secIndex = -1 | ) |
returns the last entry in the given section.
use index -1 to get the last entry of the complete chain. Make sure to only call this method if there are elements in the given section at all.
|
inline |
References ug::SectionContainer< TValue, TContainer >::m_container.
Referenced by ug::attachment_traits< Vertex *, ElementStorage< Vertex > >::elements_begin(), ug::attachment_traits< Edge *, ElementStorage< Edge > >::elements_begin(), ug::attachment_traits< Face *, ElementStorage< Face > >::elements_begin(), and ug::attachment_traits< Volume *, ElementStorage< Volume > >::elements_begin().
|
inline |
void ug::SectionContainer< TValue, TContainer >::clear |
void ug::SectionContainer< TValue, TContainer >::clear_section | ( | int | sectionIndex | ) |
|
inline |
References ug::SectionContainer< TValue, TContainer >::m_container.
Referenced by ug::attachment_traits< Vertex *, ElementStorage< Vertex > >::elements_end(), ug::attachment_traits< Edge *, ElementStorage< Edge > >::elements_end(), ug::attachment_traits< Face *, ElementStorage< Face > >::elements_end(), and ug::attachment_traits< Volume *, ElementStorage< Volume > >::elements_end().
|
inline |
void ug::SectionContainer< TValue, TContainer >::erase | ( | const iterator & | iter, |
int | sectionIndex | ||
) |
SectionContainer< TValue, TContainer >::value_type & ug::SectionContainer< TValue, TContainer >::front | ( | int | secIndex = -1 | ) |
returns the first entry in the given section.
use index -1 to get the first entry of the complete chain. Make sure to only call this method if there are elements in the given section at all.
|
inline |
returns the container for raw access.
Use this method with extreme care. Changes to the elements and to the layout of the container may most likely result in a corruption of the SectionContainer.
References ug::SectionContainer< TValue, TContainer >::m_container.
Referenced by ug::MGSelector::add_level(), ug::GridSubsetHandler::add_required_subset_lists(), ug::MGSelector::disable_element_support(), ug::ElementStorage< TElem >::ElementStorage(), ug::MGSelector::enable_element_support(), ug::MultiGridSubsetHandler::new_subset(), and ug::ElementStorage< TElem >::~ElementStorage().
SectionContainer< TValue, TContainer >::iterator ug::SectionContainer< TValue, TContainer >::insert | ( | const TValue & | val, |
int | sectionIndex | ||
) |
|
inline |
uint ug::SectionContainer< TValue, TContainer >::num_elements | ( | int | sectionIndex | ) | const |
|
inline |
SectionContainer< TValue, TContainer >::iterator ug::SectionContainer< TValue, TContainer >::section_begin | ( | int | sectionIndex | ) |
if the section is empty section_begin and section_end return the same iterators. However, no assumptions on the positions of these iterators should be made.
Referenced by ug::SectionContainer< TValue, TContainer >::append(), and ug::SectionContainer< TValue, TContainer >::transfer_elements().
SectionContainer< TValue, TContainer >::const_iterator ug::SectionContainer< TValue, TContainer >::section_begin | ( | int | sectionIndex | ) | const |
SectionContainer< TValue, TContainer >::iterator ug::SectionContainer< TValue, TContainer >::section_end | ( | int | sectionIndex | ) |
if the section is empty section_begin and section_end return the same iterators. However, no assumptions on the positions of these iterators should be made.
Referenced by ug::SectionContainer< TValue, TContainer >::append(), and ug::SectionContainer< TValue, TContainer >::transfer_elements().
SectionContainer< TValue, TContainer >::const_iterator ug::SectionContainer< TValue, TContainer >::section_end | ( | int | sectionIndex | ) | const |
void ug::SectionContainer< TValue, TContainer >::transfer_elements | ( | SectionContainer< TValue, TContainer > & | c | ) |
takes all elements from the given section container and transfers them to this one.
References ug::SectionContainer< TValue, TContainer >::erase(), ug::SectionContainer< TValue, TContainer >::num_sections(), ug::SectionContainer< TValue, TContainer >::section_begin(), and ug::SectionContainer< TValue, TContainer >::section_end().
Referenced by ug::GridSubsetHandler::join_subset_lists().
|
protected |
|
protected |
Referenced by ug::SectionContainer< TValue, TContainer >::num_elements().
|
protected |
Referenced by ug::SectionContainer< TValue, TContainer >::num_sections().