18 #ifndef REVARTABLE_LIST_HH_ 19 #define REVARTABLE_LIST_HH_ 49 data_.reserve(reserved_size);
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 permanent_size() const
Return permanent size of list.
RevertableList(const RevertableList &other)
Copy constructor.
std::vector< Type >::iterator end()
#define ASSERT_GT(a, b)
Definition of comparative assert macro (Greater Than)
std::size_t revert_temporary()
Erase temporary part of data.
const Type & operator[](std::size_t pos) const
Return item on given position.
std::size_t temporary_size_
Temporary size (full size of used data).
std::size_t permanent_size_
Final size of data (part of finalize data).
std::vector< Type >::iterator begin()
std::size_t reserved_size() const
Return reserved (maximal) size.
void reset()
Clear the list.
std::size_t enlardeg_by_
Allow to enlarge list dynamically during call push_back if reserved size is full. ...
std::size_t push_back(const Type &t)
std::size_t emplace_back(Args &&...args)
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.
void resize(std::size_t new_size)
Struct is a container that encapsulates variable size arrays.
std::size_t temporary_size() const
Return temporary size of list (full size of stored data).
std::size_t make_permanent()
Finalize temporary part of data.
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.