Flow123d
JS_before_hm-1804-gf2ad740aa
|
Go to the documentation of this file.
18 #ifndef REVARTABLE_LIST_HH_
19 #define REVARTABLE_LIST_HH_
67 data_.reserve(new_size);
85 return data_.capacity();
113 template<
class... Args>
120 data_.emplace_back( std::forward<Args>(args)... );
150 return data_.begin();
std::size_t temporary_size_
Temporary size (full size of used data).
#define ASSERT_GT(a, b)
Definition of comparative assert macro (Greater Than)
std::size_t make_permanent()
Finalize temporary part of data.
std::vector< Type >::iterator end()
std::size_t emplace_back(Args &&... args)
std::size_t push_back(const Type &t)
std::size_t permanent_size() const
Return permanent size of list.
void reset()
Clear the list.
std::size_t reserved_size() const
Return reserved (maximal) size.
std::size_t temporary_size() const
Return temporary size of list (full size of stored data).
RevertableList(const RevertableList &other)
Copy constructor.
Struct is a container that encapsulates variable size arrays.
void resize(std::size_t new_size)
const Type & operator[](std::size_t pos) const
Return item on given position.
std::vector< Type >::iterator begin()
std::size_t revert_temporary()
Erase temporary part of data.
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
std::size_t enlardeg_by_
Allow to enlarge list dynamically during call push_back if reserved size is full.
std::size_t permanent_size_
Final size of data (part of finalize data).
RevertableList(std::size_t reserved_size, std::size_t enlarged_by=0)
Constructor, create new instance with reserved size.
std::vector< Type > data_
Vector of items.