43template<
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE>
46 FIELD_ARRAY_TYPE _data;
47 using size_type = std::size_t;
52 _data(FIELD_ARRAY_TYPE(size_type(0))),_size(size_type(0)) { }
55 _data(FIELD_ARRAY_TYPE(count)),_size(count) { }
62 FIELD_ARRAY_TYPE&
data(){
return _data; }
68 constexpr size_type
size(){
return _size;}
72 constexpr void reserve( size_type new_capacity );
74 constexpr size_type
capacity(){
return _data.count(); }
82 constexpr void erase(size_type i){
83 _data.swap(i, _size-1);
89 size_type new_capacity = 2*this->
capacity();
90 if (this->
capacity()==0){ new_capacity=1; }
91 this->
resize( new_capacity );
96 template<
typename COMMUNICATABLE>
99 const std::vector<unsigned int> indices{(
static_cast<unsigned int>(_size)-1)};
100 COMMUNICATABLE(_data).deserialize(indices, buffer);
103 template<
typename INTERFACE>
105 const std::vector<unsigned int> indices{
static_cast<unsigned int>(interface.getId())};
106 auto communicatable = interface.getCommunicatable();
107 int serialSize = communicatable.size(indices);
108 std::shared_ptr<std::uint8_t[]> buffer(
new std::uint8_t[serialSize]{ });
109 communicatable.serialize(indices, buffer.get());
110 push_back<decltype(communicatable)>( buffer.get() );
115 void resize( size_type new_capacity ){ _data.resize(new_capacity); }
Container is a std::vector inspired data wrapper that allows for simple content manipulation of its o...
void resize(size_type new_capacity)
constexpr void shrink_to_fit()
constexpr size_type capacity()
constexpr void erase(size_type i)
constexpr size_type max_size()
void swapElements(size_type i, size_type j)
void push_back(INTERFACE &interface)
constexpr void push_back()
void push_back(std::uint8_t *buffer)
FIELD_ARRAY_TYPE & data()
Container(size_type count)
constexpr size_type size()
constexpr size_type getExtent()
constexpr void reserve(size_type new_capacity)
constexpr void pop_back()
Top level namespace for all of OpenLB.