NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
NeArray3.h
1
11#pragma once
12
13#include <NeCoreLib.h>
14#include <cstddef>
15#include <vector>
16
17namespace NeuralEngine
18{
19
20 template <typename T>
21
30 class Array3
31 {
32 public:
33
49 Array3(size_t bound0, size_t bound1, size_t bound2);
50
67 Array3(size_t bound0, size_t bound1, size_t bound2, T* objects);
68
69
81 Array3();
82 Array3(Array3 const&);
83 Array3& operator=(Array3 const&);
84 Array3(Array3&&);
85 Array3& operator=(Array3&&);
86
87 // Access to the array. Sample usage is
88 // Array3<T> myArray(4, 3, 2);
89 // T** slice1 = myArray[1];
90 // T* slice1row2 = myArray[1][2];
91 // T slice1Row2Col3 = myArray[1][2][3];
92 inline size_t GetBound0() const;
93 inline size_t GetBound1() const;
94 inline size_t GetBound2() const;
95 inline T* const* operator[] (int slice) const;
96 inline T** operator[] (int slice);
97
98 private:
99 void SetPointers(T* objects);
100 void SetPointers(Array3 const& other);
101
102 size_t mBound0, mBound1, mBound2;
103 std::vector<T> mObjects;
104 std::vector<T*> mIndirect1;
105 std::vector<T**> mIndirect2;
106 };
107#include "NeArray3.inl"
108}
The Array3 class represents a 3-dimensional array that minimizes the number of new and delete calls....
Definition: NeArray3.h:31
Array3()
Default constructor.
Definition: NeArray3.inl:37