ezEngine  Milestone 7
StaticArray_inl.h
1 
2 template <typename T, ezUInt32 C>
4 {
5  this->m_pElements = GetStaticArray();
6 }
7 
8 template <typename T, ezUInt32 C>
10 {
11  this->m_pElements = GetStaticArray();
12 
13  *this = (ezArrayPtr<const T>) rhs; // redirect this to the ezArrayPtr version
14 }
15 
16 template <typename T, ezUInt32 C>
17 template <ezUInt32 OtherCapacity>
19 {
20  this->m_pElements = GetStaticArray();
21 
22  *this = (ezArrayPtr<const T>) rhs; // redirect this to the ezArrayPtr version
23 }
24 
25 template <typename T, ezUInt32 C>
27 {
28  this->m_pElements = GetStaticArray();
29 
30  *this = rhs;
31 }
32 
33 template <typename T, ezUInt32 C>
35 {
36  this->Clear();
37 
38  this->m_pElements = nullptr;
39 }
40 
41 template <typename T, ezUInt32 C>
42 EZ_FORCE_INLINE T* ezStaticArray<T, C>::GetStaticArray()
43 {
44  return reinterpret_cast<T*>(m_Data);
45 }
46 
47 template <typename T, ezUInt32 C>
48 EZ_FORCE_INLINE void ezStaticArray<T, C>::Reserve(ezUInt32 uiCapacity)
49 {
50  EZ_ASSERT_DEV(uiCapacity <= C, "The static array has a fixed capacity of %i, cannot reserve more elements than that.", C);
51  // Nothing to do here
52 }
53 
54 template <typename T, ezUInt32 C>
55 EZ_FORCE_INLINE void ezStaticArray<T, C>::operator= (const ezStaticArray<T, C>& rhs)
56 {
57  *this = (ezArrayPtr<const T>) rhs; // redirect this to the ezArrayPtr version
58 }
59 
60 template <typename T, ezUInt32 C>
61 template <ezUInt32 OtherCapacity>
63 {
64  *this = (ezArrayPtr<const T>) rhs; // redirect this to the ezArrayPtr version
65 }
66 
67 template <typename T, ezUInt32 C>
68 EZ_FORCE_INLINE void ezStaticArray<T, C>::operator= (const ezArrayPtr<const T>& rhs)
69 {
70  ezArrayBase<T, ezStaticArray<T, C>>::operator=(rhs);
71 }
72