Sleeping Wombat Common Library  0.50.0
swCommonLibrary
StaticArrayContainer_Readonly.h
1 #pragma once
2 
10 
12 
13 #include <vector>
14 
15 
16 
17 namespace sw
18 {
19 
20 const int cArrayReadonlySize = 4;
21 
22 // ================================ //
23 //
25 {
26  RTTR_ENABLE( EngineObject );
27  RTTR_REGISTRATION_FRIEND
28 public:
29 
30  StructWithSimpleTypes StructsVec[ cArrayReadonlySize ];
31 
32 protected:
33 public:
35  ~StaticArrayContainer_Readonly () = default;
36 
37  void ArraysSet1 ();
38  void ArraysSet2 ();
39 
40  bool Compare ( const StaticArrayContainer_Readonly& other );
41 };
42 
43 //====================================================================================//
44 // Implementation
45 //====================================================================================//
46 
47 // ================================ //
48 //
49 inline StaticArrayContainer_Readonly::StaticArrayContainer_Readonly()
50 {
51  ArraysSet1();
52 }
53 
54 // ================================ //
55 //
56 inline void StaticArrayContainer_Readonly::ArraysSet1()
57 {
58  StructWithSimpleTypes content;
59 
60  content.FillWithDataset1();
61  StructsVec[ 0 ] = content;
62 
63  content.FillWithDataset2();
64  StructsVec[ 1 ] = content;
65 
66  content.FillWithDataset3();
67  StructsVec[ 2 ] = content;
68 
69  content.FillWithDataset3();
70  StructsVec[ 3 ] = content;
71 }
72 
73 // ================================ //
74 //
75 inline void StaticArrayContainer_Readonly::ArraysSet2()
76 {
77  StructWithSimpleTypes content;
78 
79  content.FillWithDataset3();
80  StructsVec[ 0 ] = content;
81 
82  content.FillWithDataset1();
83  StructsVec[ 1 ] = content;
84 
85  content.FillWithDataset2();
86  StructsVec[ 2 ] = content;
87 
88  content.FillWithDataset2();
89  StructsVec[ 3 ] = content;
90 }
91 
92 // ================================ //
93 //
94 inline bool StaticArrayContainer_Readonly::Compare ( const StaticArrayContainer_Readonly& other )
95 {
96  for( int i = 0; i < cArrayReadonlySize; ++i )
97  {
98  if( StructsVec[ i ] != other.StructsVec[ i ] )
99  return false;
100  }
101 
102  return true;
103 }
104 
105 
106 } // sw
107 
108 
Definition: StaticArrayContainer_Readonly.h:24
Definition: Exception.h:11
Base class for serializable objects.
Definition: EngineObject.h:24
Definition: StructWithSimpleTypes.h:18