ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Methods | Protected Fields | List of all members
FixedCapacityVector< T, TSize > Class Template Reference

#include <fixedcapacityvector.hpp>

Inheritance diagram for FixedCapacityVector< T, TSize >:
[legend]
Collaboration diagram for FixedCapacityVector< T, TSize >:
[legend]

Class Description

template<typename T, std::size_t TSize>
class aworx::lib::monomem::util::FixedCapacityVector< T, TSize >


This class fills the gap between standard types std::array and std::vector by implementing a fixed size array, with a current filling size index. With that methods push_back and pop_back could be implemented, which satisfies the constraints given for example to underlying containers of type std::priority_queue.

The rationale here is to use fixed size memory allocation or even stack allocation, in situations where the maximum capacity needed at runtime is known upfront.

Besides aforementioned methods push_back and pop_back, a few necessary other methods of parent class std::array have been replaced, but are not explicitly mentioned with this reference documentation. Among them are size(), end(), rend() or cend().

Attention
While this type inherits std::array publically, not all standard methods and type traits have been overwritten according to the ever more complicated C++ specification. Therefore, there is not only no guarantee given that this type behaves as it is supposed to in each and every complex situation (e.g template meta programing). However, the use in accordance with type std::priority_queue is certified.

Definition at line 50 of file fixedcapacityvector.hpp.

Public Methods

void pop_back ()
 
void push_back (const T &value)
 

Protected Fields

std::size_t fillSize = 0
 The current fill.
 

Member Function Documentation

◆ pop_back()

void pop_back ( )
inline

Decreases the size of this vector by destructing and removing the given value at the current end.
In debug compilations, an ALib assertion is raised, if no elements are left.

Definition at line 74 of file fixedcapacityvector.hpp.

◆ push_back()

void push_back ( const T &  value)
inline

Increases the size of this vector by inserting given value at the end.
In debug compilations, an ALib assertion is raised, if this fixed sized vector's capacity is exceeded.

Parameters
valueThe value to insert.

Definition at line 62 of file fixedcapacityvector.hpp.


The documentation for this class was generated from the following file: