112 _data = (T*)(
new char[size *
sizeof(T)]);
113 std::copy(data, data + _size, _data);
162 if (index < 0 || index >= _size)
164 std::stringstream ss;
165 ss <<
"Index " << index <<
" out of range. [0.." << _size <<
"[";
166 throw std::out_of_range(ss.str());
174 if (index < 0 || index >= _size)
176 std::stringstream ss;
177 ss <<
"Index " << index <<
" out of range. [0.." << _size <<
"[";
178 throw std::out_of_range(ss.str());
C-Array wrapper for handle size, copy and memory.
Definition: IRArray.h:23
~IRArray()
Deconstructor.
Definition: IRArray.h:127
IRArray< T > & operator=(const IRArray< T > &obj)
Assignment operator for copy IRArray.
Definition: IRArray.h:137
IRArray(std::size_t size, const T *const data)
Initialize array with given size and data.
Definition: IRArray.h:107
const T & operator[](const std::size_t index) const
Const index operator.
Definition: IRArray.h:172
IRArray(std::size_t size)
Initialize array with given size.
Definition: IRArray.h:93
IRArray(const IRArray< T > &obj)
Copy constructor to copy given IRArray.
Definition: IRArray.h:122
T *const data() const
Returns pointer to array.
Definition: IRArray.h:190
T & operator[](const std::size_t index)
Index operator.
Definition: IRArray.h:160
std::size_t size() const
Returns size of array.
Definition: IRArray.h:184