| 19 | */ |
| 20 | template<typename T> |
| 21 | class Array |
| 22 | { |
| 23 | public: |
| 24 | // ------------------------------ Constructors and Data Allocator Functions ------------------------------ // |
| 25 | /** |
| 26 | * Array constructor. |
| 27 | * Equivalent to default constructor + reset(const int size). |
| 28 | * @param size Integer with the number of T element to be allocated. E.g., size = 5 is internally similar to |
| 29 | * `new T[5]`. |
| 30 | */ |
| 31 | explicit Array(const int size); |
| 32 | |
| 33 | /** |
| 34 | * Array constructor. |
| 35 | * Equivalent to default constructor + reset(const std::vector<int>& size = {}). |
| 36 | * @param sizes Vector with the size of each dimension. E.g., size = {3, 5, 2} is internally similar to |
| 37 | * `new T[3*5*2]`. |
| 38 | */ |
| 39 | explicit Array(const std::vector<int>& sizes = {}); |
| 40 | |
| 41 | /** |
| 42 | * Array constructor. |
| 43 | * Equivalent to default constructor + reset(const int size, const T value). |
| 44 | * @param size Integer with the number of T element to be allocated. E.g., size = 5 is internally similar to |
| 45 | * `new T[5]`. |
| 46 | * @param value Initial value for each component of the Array. |
| 47 | */ |
| 48 | Array(const int size, const T value); |
| 49 | |
| 50 | /** |
| 51 | * Array constructor. |
| 52 | * Equivalent to default constructor + reset(const std::vector<int>& size, const T value). |
| 53 | * @param sizes Vector with the size of each dimension. E.g., size = {3, 5, 2} is internally similar to: |
| 54 | * `new T[3*5*2]`. |
| 55 | * @param value Initial value for each component of the Array. |
| 56 | */ |
| 57 | Array(const std::vector<int>& sizes, const T value); |
| 58 | |
| 59 | /** |
| 60 | * Array constructor. |
| 61 | * Equivalent to default constructor, but it does not allocate memory, but rather use dataPtr. |
| 62 | * @param size Integer with the number of T element to be allocated. E.g., size = 5 is internally similar to |
| 63 | * `new T[5]`. |
| 64 | * @param dataPtr Pointer to the memory to be used by the Array. |
| 65 | */ |
| 66 | Array(const int size, T* const dataPtr); |
| 67 | |
| 68 | /** |
| 69 | * Array constructor. |
| 70 | * Equivalent to default constructor, but it does not allocate memory, but rather use dataPtr. |
| 71 | * @param sizes Vector with the size of each dimension. E.g., size = {3, 5, 2} is internally similar to: |
| 72 | * `new T[3*5*2]`. |
| 73 | * @param dataPtr Pointer to the memory to be used by the Array. |
| 74 | */ |
| 75 | Array(const std::vector<int>& sizes, T* const dataPtr); |
| 76 | |
| 77 | /** |
| 78 | * Array constructor. |
nothing calls this directly
no outgoing calls
no test coverage detected