C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CORE_VectorList< T, I > Class Template Reference

this class describes a list K -> T whre I is the implemented class More...

#include <CORE_VectorList.h>

Inheritance diagram for CORE_VectorList< T, I >:
Inheritance graph
[legend]
Collaboration diagram for CORE_VectorList< T, I >:
Collaboration graph
[legend]

Public Member Functions

virtual tMemSize getMemorySize () const override
 return the memory size of the class and the memory size of all its attributes/associations More...
 
virtual tMemSize getContentsMemorySize () const override
 return the memory size of the included associations More...
 
void setSize (const tIndex &n)
 set the size of the container More...
 
tIndex getSize () const
 return the size of the container More...
 
const T & operator[] (const tIndex &i) const
 get the i-th element for reading. Do not verify the bounds More...
 
T & operator[] (const tIndex &i)
 get the i-th element for writting. Do not verify the bounds More...
 
constexpr auto cbegin () const
 return begin iterator for reading More...
 
constexpr auto cend () const
 return end iterator for reading More...
 
auto begin ()
 return begin iterator for writing More...
 
auto end ()
 return end iterator for writing More...
 
auto rbegin ()
 return reverse begin iterator for writing More...
 
auto rend ()
 return reverse end iterator for writing More...
 
constexpr auto crbegin () const
 return reverse begin iterator for reading More...
 
constexpr auto crend () const
 return reverse end iterator for reading More...
 
void copy (const Self &cpy)
 copy the container More...
 
template<typename Q , class I1 >
void copy (Self &&cpy)
 copy the conatiner : mv is destroyed after this More...
 
void copy (const std::initializer_list< T > &vs)
 initialize the array to the values of list More...
 
void copy (std::initializer_list< T > &&vs)
 initialize the array to the values of list More...
 
std::vector< T > & getValues ()
 return the values of the list More...
 
const std::vector< T > & getValues () const
 return the values of the list More...
 
tString getDataTypeName () const
 get the type of data More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F)
 transform the transform element with the lambda function Ti = F(Ti) More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F, const Self &X)
 transform the transform element with the lambda function Ti = F(Xi) More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F, const Self &X, const Self &Y)
 transform the transform element with the lambda function Ti = F(Xi,Yi) More...
 
void directionalSort (const tUChar &order)
 sort the element More...
 
- Public Member Functions inherited from CORE_List< T, tIndex, I >
virtual CORE_UniquePointer< CORE_List< T, tIndex, I > > newInstance () const=0
 create a New instance within an unique smart pointer More...
 
const T & operator[] (const tIndex &i) const
 get the i-th element for reading. Do not verify the bounds More...
 
T & operator[] (const tIndex &i)
 get the i-th element for writting. Do not verify the bounds More...
 
tString getDataTypeName () const
 get the type of data More...
 
void sort ()
 sort the list in the incresing order
 
void directionalSort (const tUChar &order)
 sort the element More...
 
- Public Member Functions inherited from CORE_Collection< T, I >
void setSize (const tIndex &n)
 set the size of the container More...
 
tIndex getSize () const
 return the size of the container More...
 
void resize (const tIndex &n)
 modify the size of the array and keep its old values
 
const T & operator[] (const tIndex &i) const
 get the i-th element for reading. Do not verify the bounds More...
 
T & operator[] (const tIndex &i)
 get the i-th element for writting. Do not verify the bounds More...
 
constexpr auto cbegin () const
 return begin iterator for reading More...
 
constexpr auto cend () const
 return end iterator for reading More...
 
auto begin ()
 return begin iterator for writing More...
 
auto end ()
 return end iterator for writing More...
 
auto rbegin ()
 return reverse begin iterator for writing More...
 
auto rend ()
 return reverse end iterator for writing More...
 
constexpr auto crbegin () const
 return reverse begin iterator for reading More...
 
constexpr auto crend () const
 return reverse end iterator for reading More...
 
template<typename LambdaFct >
void transform (LambdaFct &&F)
 transform the transform element with the lambda function Ti = F(Ti) More...
 
tString getDataTypeName () const
 get the type of data More...
 
virtual tString toString () const override
 return the string representation of the object node More...
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 

Static Public Member Functions

static void Copy (const std::valarray< T > &X, std::vector< T > &R)
 copy the array More...
 
static void Copy (const std::initializer_list< T > &X, std::vector< T > &R)
 copy the array R=X More...
 
static void Copy (std::initializer_list< T > &&X, std::vector< T > &R)
 copy the array R=X More...
 
template<class Q >
static void Copy (const std::vector< Q > &X, std::vector< T > &R)
 copy the array R=X More...
 
static void Copy (const std::vector< T > &X, std::vector< T > &R)
 copy the array More...
 
template<typename Q >
static void Copy (const tIndex &n, const Q *X, std::vector< T > &R)
 copy the array More...
 
- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Protected Member Functions

 CORE_VectorList ()
 build a list
 
 CORE_VectorList (const tIndex &n)
 build a list of size n
 
virtual ~CORE_VectorList ()
 destroy the instance of class
 
- Protected Member Functions inherited from CORE_List< T, tIndex, I >
 CORE_List ()
 build an array of T*
 
virtual ~CORE_List ()
 destroy an array of T*
 
- Protected Member Functions inherited from CORE_Collection< T, I >
 CORE_Collection ()
 build an array of T*
 
virtual ~CORE_Collection ()
 destroy an array of T*
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Detailed Description

template<typename T, class I>
class CORE_VectorList< T, I >

this class describes a list K -> T whre I is the implemented class

Member Function Documentation

◆ begin()

template<typename T , class I >
auto CORE_VectorList< T, I >::begin ( )
inline

return begin iterator for writing

Returns
begin iterator

◆ cbegin()

template<typename T , class I >
constexpr auto CORE_VectorList< T, I >::cbegin ( ) const
inlineconstexpr

return begin iterator for reading

Returns
begin iterator

◆ cend()

template<typename T , class I >
constexpr auto CORE_VectorList< T, I >::cend ( ) const
inlineconstexpr

return end iterator for reading

Returns
end iterator

◆ copy() [1/4]

template<typename T , class I >
void CORE_VectorList< T, I >::copy ( const Self cpy)
inline

copy the container

Parameters
[in]cpy: container to copy

◆ copy() [2/4]

template<typename T , class I >
void CORE_VectorList< T, I >::copy ( const std::initializer_list< T > &  vs)
inline

initialize the array to the values of list

Parameters
[in]vs: values of the array

◆ Copy() [1/6]

template<typename T , class I >
static void CORE_VectorList< T, I >::Copy ( const std::initializer_list< T > &  X,
std::vector< T > &  R 
)
inlinestatic

copy the array R=X

Parameters
[in]X: val array to copy
[out]Rcopied val array

◆ Copy() [2/6]

template<typename T , class I >
static void CORE_VectorList< T, I >::Copy ( const std::valarray< T > &  X,
std::vector< T > &  R 
)
inlinestatic

copy the array

Parameters
[in]X: val array to copy
[out]Rcopied val array

Uses the std::valarray==()

◆ Copy() [3/6]

template<typename T , class I >
template<class Q >
static void CORE_VectorList< T, I >::Copy ( const std::vector< Q > &  X,
std::vector< T > &  R 
)
inlinestatic

copy the array R=X

Parameters
[in]X: vector to copy
[out]Rcopied val array

Uses the std::for_each methods when T != Q

◆ Copy() [4/6]

template<typename T , class I >
static void CORE_VectorList< T, I >::Copy ( const std::vector< T > &  X,
std::vector< T > &  R 
)
inlinestatic

copy the array

Parameters
[in]X: val array to copy
[out]Rcopied val array

Uses the std::valarray==()

◆ Copy() [5/6]

template<typename T , class I >
template<typename Q >
static void CORE_VectorList< T, I >::Copy ( const tIndex &  n,
const Q *  X,
std::vector< T > &  R 
)
inlinestatic

copy the array

Parameters
[in]n: number of values to copy
[in]X: values to copy (size of X must be greater than n)
[out]Rcopied val array

Uses the pointer loop

◆ copy() [3/4]

template<typename T , class I >
template<typename Q , class I1 >
void CORE_VectorList< T, I >::copy ( Self &&  cpy)
inline

copy the conatiner : mv is destroyed after this

Parameters
[in]cpy:container to move

◆ copy() [4/4]

template<typename T , class I >
void CORE_VectorList< T, I >::copy ( std::initializer_list< T > &&  vs)
inline

initialize the array to the values of list

Parameters
[in]vs: values of the array

◆ Copy() [6/6]

template<typename T , class I >
static void CORE_VectorList< T, I >::Copy ( std::initializer_list< T > &&  X,
std::vector< T > &  R 
)
inlinestatic

copy the array R=X

Parameters
[in]X: val array to copy
[out]Rcopied val array

◆ crbegin()

template<typename T , class I >
constexpr auto CORE_VectorList< T, I >::crbegin ( ) const
inlineconstexpr

return reverse begin iterator for reading

Returns
begin iterator

◆ crend()

template<typename T , class I >
constexpr auto CORE_VectorList< T, I >::crend ( ) const
inlineconstexpr

return reverse end iterator for reading

Returns
end iterator

◆ directionalSort()

template<typename T , class I >
void CORE_VectorList< T, I >::directionalSort ( const tUChar &  order)
inline

sort the element

Parameters
[in]order'i' or 'd'

◆ end()

template<typename T , class I >
auto CORE_VectorList< T, I >::end ( )
inline

return end iterator for writing

Returns
end iterator

◆ getContentsMemorySize()

template<typename T , class I >
virtual tMemSize CORE_VectorList< T, I >::getContentsMemorySize ( ) const
inlineoverridevirtual

return the memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from CORE_Object.

Reimplemented in CORE_StringsList.

◆ getDataTypeName()

template<typename T , class I >
tString CORE_VectorList< T, I >::getDataTypeName ( ) const
inline

get the type of data

Returns
the type of data as string

◆ getMemorySize()

template<typename T , class I >
virtual tMemSize CORE_VectorList< T, I >::getMemorySize ( ) const
inlineoverridevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_List< T, tIndex, I >.

Reimplemented in CORE_StringsList.

◆ getSize()

template<typename T , class I >
tIndex CORE_VectorList< T, I >::getSize ( ) const
inline

return the size of the container

Returns
the size container

◆ getValues() [1/2]

template<typename T , class I >
std::vector<T>& CORE_VectorList< T, I >::getValues ( )
inline

return the values of the list

Returns
the values of the list as a vector

◆ getValues() [2/2]

template<typename T , class I >
const std::vector<T>& CORE_VectorList< T, I >::getValues ( ) const
inline

return the values of the list

Returns
the values of the list as a vector

◆ operator[]() [1/2]

template<typename T , class I >
T& CORE_VectorList< T, I >::operator[] ( const tIndex &  i)
inline

get the i-th element for writting. Do not verify the bounds

Parameters
[in]iindex of the element

◆ operator[]() [2/2]

template<typename T , class I >
const T& CORE_VectorList< T, I >::operator[] ( const tIndex &  i) const
inline

get the i-th element for reading. Do not verify the bounds

Parameters
[in]iindex of the element

◆ rbegin()

template<typename T , class I >
auto CORE_VectorList< T, I >::rbegin ( )
inline

return reverse begin iterator for writing

Returns
begin iterator

◆ rend()

template<typename T , class I >
auto CORE_VectorList< T, I >::rend ( )
inline

return reverse end iterator for writing

Returns
end iterator

◆ setSize()

template<typename T , class I >
void CORE_VectorList< T, I >::setSize ( const tIndex &  n)
inline

set the size of the container

Parameters
[in]n:size of the container

◆ transform() [1/3]

template<typename T , class I >
template<typename LambdaFct >
void CORE_VectorList< T, I >::transform ( LambdaFct &&  F)
inline

transform the transform element with the lambda function Ti = F(Ti)

Parameters
[in]F: lambda function with one variable

◆ transform() [2/3]

template<typename T , class I >
template<typename LambdaFct >
void CORE_VectorList< T, I >::transform ( LambdaFct &&  F,
const Self X 
)
inline

transform the transform element with the lambda function Ti = F(Xi)

Parameters
[in]F: lambda function with one variable
[in]X: argument of F

◆ transform() [3/3]

template<typename T , class I >
template<typename LambdaFct >
void CORE_VectorList< T, I >::transform ( LambdaFct &&  F,
const Self X,
const Self Y 
)
inline

transform the transform element with the lambda function Ti = F(Xi,Yi)

Parameters
[in]F: lambda function with one variable
[in]X: first argument of F
[in]Y: second argument of F

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