Flow123d
JB_transport-112d700
|
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>
121 data_.emplace_back( std::forward<Args>(args)... );
151 return data_.begin();
std::size_t temporary_size_
Temporary size (full size of used data).
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 enlarged_by_
Allow to enlarge list dynamically during call push_back if reserved size is full.
std::size_t permanent_size() const
Return permanent size of list.
void reset()
Clear the list.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
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).
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
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.
#define ASSERT_GE(a, b)
Definition of comparative assert macro (Greater or Equal) only for debug mode.
std::vector< Type >::iterator begin()
std::size_t revert_temporary()
Erase temporary part of data.
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.