1 #ifndef CORE_Collection_H
2 #define CORE_Collection_H
5 #include "CORE_Object.h"
8 #include "shared_pointer.h"
48 template<
typename T,
class I>
105 static_cast<I*
>(
this)->
setSize(n);
112 return static_cast<const I*
>(
this)->
getSize();
118 return static_cast<I*
>(
this)->
resize(n);
127 return (*
static_cast<const I*
>(
this))[i];
133 return (*
static_cast<I*
>(
this))[i];
144 return static_cast<const I*
>(
this)->
cbegin();
149 inline constexpr
auto cend()
const {
150 return static_cast<const I*
>(
this)->
cend();
156 return static_cast<I*
>(
this)->
begin();
162 return static_cast<I*
>(
this)->
end();
169 return static_cast<I*
>(
this)->
rbegin();
175 return static_cast<I*
>(
this)->
rend();
182 return static_cast<const I*
>(
this)->
crbegin();
187 inline constexpr
auto crend()
const {
188 return static_cast<const I*
>(
this)->
crend();
225 template<
typename LambdaFct>
241 return functions_type::getTypeName<T>();
258 std::stringstream cstr;
261 [&cstr](
const auto& Vi) {
264 cstr.seekp(-1, std::ios_base::end);
this class describes a general container of values of type T where implemented class is I
Definition: CORE_Collection.h:49
auto rend()
return reverse end iterator for writing
Definition: CORE_Collection.h:174
constexpr auto cbegin() const
return begin iterator for reading
Definition: CORE_Collection.h:143
virtual tMemSize getMemorySize() const override
return the memory size of the class and the memory size of all its attributes/associations
Definition: CORE_Collection.h:88
auto begin()
return begin iterator for writing
Definition: CORE_Collection.h:155
void transform(LambdaFct &&F)
transform the transform element with the lambda function Ti = F(Ti)
Definition: CORE_Collection.h:226
auto end()
return end iterator for writing
Definition: CORE_Collection.h:161
T & operator[](const tIndex &i)
get the i-th element for writting. Do not verify the bounds
Definition: CORE_Collection.h:132
tString getDataTypeName() const
get the type of data
Definition: CORE_Collection.h:240
CORE_Collection()
build an array of T*
Definition: CORE_Collection.h:65
constexpr auto crend() const
return reverse end iterator for reading
Definition: CORE_Collection.h:187
constexpr auto crbegin() const
return reverse begin iterator for reading
Definition: CORE_Collection.h:181
tIndex getSize() const
return the size of the container
Definition: CORE_Collection.h:111
auto rbegin()
return reverse begin iterator for writing
Definition: CORE_Collection.h:168
virtual tString toString() const override
return the string representation of the object node
Definition: CORE_Collection.h:257
void setSize(const tIndex &n)
set the size of the container
Definition: CORE_Collection.h:104
virtual ~CORE_Collection()
destroy an array of T*
Definition: CORE_Collection.h:74
constexpr auto cend() const
return end iterator for reading
Definition: CORE_Collection.h:149
void resize(const tIndex &n)
modify the size of the array and keep its old values
Definition: CORE_Collection.h:117
const T & operator[](const tIndex &i) const
get the i-th element for reading. Do not verify the bounds
Definition: CORE_Collection.h:126
abstract base class for most classes.
Definition: CORE_Object.h:65
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
virtual tString toString() const
return the string representation of the object node
Definition: CORE_Object.h:333