|
Flow123d
DF_patch_fe_darcy_complete-579fe1e
|
Struct is a container that encapsulates variable size arrays. More...
#include <revertable_list.hh>

Public Member Functions | |
| RevertableList () | |
| Default constructor, reserved size is increased by one. More... | |
| RevertableList (std::size_t reserved_size, std::size_t enlarged_by=0) | |
| Constructor, create new instance with reserved size. More... | |
| RevertableList (const RevertableList &other) | |
| Copy constructor. More... | |
| RevertableList & | operator= (const RevertableList &other) |
| Assignment operator. More... | |
| void | reinit_default_list (std::size_t new_reserved_size, std::size_t new_enlarged_by) |
| void | resize (std::size_t new_size) |
| std::size_t | permanent_size () const |
| Return permanent size of list. More... | |
| std::size_t | temporary_size () const |
| Return temporary size of list (full size of stored data). More... | |
| std::size_t | reserved_size () const |
| Return reserved (maximal) size. More... | |
| std::size_t | push_back (const Type &t) |
| template<class... Args> | |
| std::size_t | emplace_back (Args &&... args) |
| std::size_t | make_permanent () |
| Finalize temporary part of data. More... | |
| std::size_t | revert_temporary () |
| Erase temporary part of data. More... | |
| void | reset () |
| Clear the list. More... | |
| std::vector< Type >::iterator | begin () |
| std::vector< Type >::iterator | end () |
| const Type & | operator[] (std::size_t pos) const |
| Return item on given position. More... | |
Private Attributes | |
| std::vector< Type > | data_ |
| Vector of items. More... | |
| std::size_t | temporary_size_ |
| Temporary size (full size of used data). More... | |
| std::size_t | permanent_size_ |
| Final size of data (part of finalize data). More... | |
| std::size_t | enlarged_by_ |
| Allow to enlarge list dynamically during call push_back if reserved size is full. More... | |
Struct is a container that encapsulates variable size arrays.
Allows to:
This algorith allows to add blocks of data, evaluates external condition and possibly reverts unfinished block if condition is not met.
Reserved (maximal) size is set in constructor. This size can be enlarged manually through method resize or constructor accepts parameter enlarged_by. If this value is greater than 0 size of container is automatically enlarged during call push_back if container is full.
Definition at line 43 of file revertable_list.hh.
|
inline |
Default constructor, reserved size is increased by one.
Definition at line 46 of file revertable_list.hh.
|
inline |
Constructor, create new instance with reserved size.
Definition at line 53 of file revertable_list.hh.
|
inline |
Copy constructor.
Definition at line 60 of file revertable_list.hh.
|
inline |
|
inline |
Create new item in list.
New item is created at the end of list and temporary size value is incremented. Method is equivalent with std::vector::emplace_back(). Method passes argumets of Type constructor.
Definition at line 144 of file revertable_list.hh.

|
inline |
|
inline |
Finalize temporary part of data.
Definition at line 155 of file revertable_list.hh.

|
inline |
Assignment operator.
Definition at line 67 of file revertable_list.hh.
|
inline |
Return item on given position.
Definition at line 188 of file revertable_list.hh.
|
inline |
Return permanent size of list.
Definition at line 102 of file revertable_list.hh.

|
inline |
Add new item of list.
New item is added to end of list and temporary size value is incremented. Method is equivalent with std::vector::push_back(). This method needs to create copy of passed Type and it's beter to use emplace_back method.
Definition at line 126 of file revertable_list.hh.
|
inline |
Reinit list initialized by default constructor.
Set new reserved size and new enlarged by value. Important: Method can be called only before first usage of RevertableList!
Definition at line 82 of file revertable_list.hh.
|
inline |
Return reserved (maximal) size.
Definition at line 114 of file revertable_list.hh.

|
inline |
Clear the list.
Definition at line 170 of file revertable_list.hh.

|
inline |
Resize to new reserved size.
New size must be higher than actual size!
Definition at line 95 of file revertable_list.hh.

|
inline |
Erase temporary part of data.
Definition at line 162 of file revertable_list.hh.

|
inline |
Return temporary size of list (full size of stored data).
Definition at line 108 of file revertable_list.hh.

|
private |
Vector of items.
Definition at line 194 of file revertable_list.hh.
|
private |
Allow to enlarge list dynamically during call push_back if reserved size is full.
Definition at line 197 of file revertable_list.hh.
|
private |
Final size of data (part of finalize data).
Definition at line 196 of file revertable_list.hh.
|
private |
Temporary size (full size of used data).
Definition at line 195 of file revertable_list.hh.