Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TArrayVector.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <array>
5
6namespace ph
7{
8
14template<typename T, std::size_t N>
15class TArrayVector final
16{
17public:
19
23 template<typename U>
24 void pushBack(U&& item);
25
29 void popBack();
30
31 T& front();
32 const T& front() const;
33 T& back();
34 const T& back() const;
35 std::size_t size() const;
36 void clear();
37 bool isEmpty() const;
38 bool isFull() const;
39
40 T* get(std::size_t index);
41 const T* get(std::size_t index) const;
42
43 T& operator [] (std::size_t index);
44 const T& operator [] (std::size_t index) const;
45
51 typename std::array<T, N>::iterator begin() noexcept;
52 typename std::array<T, N>::const_iterator begin() const noexcept;
53 typename std::array<T, N>::iterator end() noexcept;
54 typename std::array<T, N>::const_iterator end() const noexcept;
56
57private:
58 std::array<T, N> m_data;
59 std::size_t m_size;// TODO: size type based on N?
60};
61
62}// end namespace ph
63
A fixed size vector backed by an array. The container inherits the properties of a fixed size array o...
Definition TArrayVector.h:16
std::array< T, N >::iterator begin() noexcept
Definition TArrayVector.ipp:135
T & back()
Definition TArrayVector.ipp:119
void pushBack(U &&item)
Add an item to the back of the vector. The item originally at the target index will be overwritten.
Definition TArrayVector.ipp:29
T & operator[](std::size_t index)
Definition TArrayVector.ipp:87
bool isEmpty() const
Definition TArrayVector.ipp:63
std::size_t size() const
Definition TArrayVector.ipp:49
TArrayVector()
Definition TArrayVector.ipp:15
void clear()
Definition TArrayVector.ipp:57
void popBack()
Removes an item from the back of the vector. The item originally at the target index is still alive a...
Definition TArrayVector.ipp:41
std::array< T, N >::iterator end() noexcept
Definition TArrayVector.ipp:147
bool isFull() const
Definition TArrayVector.ipp:69
T * get(std::size_t index)
Definition TArrayVector.ipp:75
T & front()
Definition TArrayVector.ipp:103
The root for all renderer implementations.
Definition EEngineProject.h:6