Coherent UI for Unreal Engine 4  2.5.5.0
A modern user interface library for games
 All Classes Functions Variables Pages
CoherentFVectorBinder.h
1 /*
2 This file is part of Coherent UI, modern user interface library for
3 games.
4 
5 Copyright (c) 2012-2014 Coherent Labs AD and/or its licensors. All
6 rights reserved in all media.
7 
8 The coded instructions, statements, computer programs, and/or related
9 material (collectively the "Data") in these files contain confidential
10 and unpublished information proprietary Coherent Labs and/or its
11 licensors, which is protected by United States of America federal
12 copyright law and by international treaties.
13 
14 This software or source code is supplied under the terms of a license
15 agreement and nondisclosure agreement with Coherent Labs Limited and may
16 not be copied, disclosed, or exploited except in accordance with the
17 terms of that agreement. The Data may not be disclosed or distributed to
18 third parties, in whole or in part, without the prior written consent of
19 Coherent Labs Limited.
20 
21 COHERENT LABS MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS
22 SOURCE CODE FOR ANY PURPOSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
23 HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, ITS AFFILIATES,
27 PARENT COMPANIES, LICENSORS, SUPPLIERS, OR CONTRIBUTORS BE LIABLE FOR
28 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 ANY WAY OUT OF THE USE OR PERFORMANCE OF THIS SOFTWARE OR SOURCE CODE,
34 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36 #pragma once
37 
38 #include "Coherent/UI/Binding/Binder.h"
39 
40 namespace Coherent
41 {
42 namespace UI
43 {
44 
45  inline void CoherentBindInternal(Binder* binder, FVector2D& value)
46  {
47  binder->MapBegin(2);
48 
49  CoherentBindInternal(binder, "X");
50  CoherentBindInternal(binder, value.X);
51  CoherentBindInternal(binder, "Y");
52  CoherentBindInternal(binder, value.Y);
53 
54  binder->MapEnd();
55  }
56 
57  inline void CoherentBindInternal(Binder* binder, const FVector2D& value)
58  {
59  binder->MapBegin(2);
60 
61  CoherentBindInternal(binder, "X");
62  CoherentBindInternal(binder, value.X);
63  CoherentBindInternal(binder, "Y");
64  CoherentBindInternal(binder, value.Y);
65 
66  binder->MapEnd();
67  }
68 
69  inline void CoherentReadInternal(Binder* binder, FVector2D& value)
70  {
71  size_t size = binder->ReadMapBegin();
72 
73  if (binder->ReadProperty("X"))
74  {
75  CoherentReadInternal(binder, value.X);
76  }
77 
78  if (binder->ReadProperty("Y"))
79  {
80  CoherentReadInternal(binder, value.Y);
81  }
82 
83  binder->ReadMapEnd();
84  }
85 
86  inline void CoherentBindInternal(Binder* binder, FVector& value)
87  {
88  binder->MapBegin(3);
89 
90  CoherentBindInternal(binder, "X");
91  CoherentBindInternal(binder, value.X);
92  CoherentBindInternal(binder, "Y");
93  CoherentBindInternal(binder, value.Y);
94  CoherentBindInternal(binder, "Z");
95  CoherentBindInternal(binder, value.Z);
96 
97  binder->MapEnd();
98  }
99 
100  inline void CoherentBindInternal(Binder* binder, const FVector& value)
101  {
102  binder->MapBegin(3);
103 
104  CoherentBindInternal(binder, "X");
105  CoherentBindInternal(binder, value.X);
106  CoherentBindInternal(binder, "Y");
107  CoherentBindInternal(binder, value.Y);
108  CoherentBindInternal(binder, "Z");
109  CoherentBindInternal(binder, value.Z);
110 
111  binder->MapEnd();
112  }
113 
114  inline void CoherentReadInternal(Binder* binder, FVector& value)
115  {
116  size_t size = binder->ReadMapBegin();
117 
118  if (binder->ReadProperty("X"))
119  {
120  CoherentReadInternal(binder, value.X);
121  }
122 
123  if (binder->ReadProperty("Y"))
124  {
125  CoherentReadInternal(binder, value.Y);
126  }
127 
128  if (binder->ReadProperty("Z"))
129  {
130  CoherentReadInternal(binder, value.Z);
131  }
132 
133  binder->ReadMapEnd();
134  }
135 
136  inline void CoherentBindInternal(Binder* binder, FVector4& value)
137  {
138  binder->MapBegin(4);
139 
140  CoherentBindInternal(binder, "X");
141  CoherentBindInternal(binder, value.X);
142  CoherentBindInternal(binder, "Y");
143  CoherentBindInternal(binder, value.Y);
144  CoherentBindInternal(binder, "Z");
145  CoherentBindInternal(binder, value.Z);
146  CoherentBindInternal(binder, "W");
147  CoherentBindInternal(binder, value.W);
148 
149  binder->MapEnd();
150  }
151 
152  inline void CoherentBindInternal(Binder* binder, const FVector4& value)
153  {
154  binder->MapBegin(4);
155 
156  CoherentBindInternal(binder, "X");
157  CoherentBindInternal(binder, value.X);
158  CoherentBindInternal(binder, "Y");
159  CoherentBindInternal(binder, value.Y);
160  CoherentBindInternal(binder, "Z");
161  CoherentBindInternal(binder, value.Z);
162  CoherentBindInternal(binder, "W");
163  CoherentBindInternal(binder, value.W);
164 
165  binder->MapEnd();
166  }
167 
168  inline void CoherentReadInternal(Binder* binder, FVector4& value)
169  {
170  size_t size = binder->ReadMapBegin();
171 
172  if (binder->ReadProperty("X"))
173  {
174  CoherentReadInternal(binder, value.X);
175  }
176 
177  if (binder->ReadProperty("Y"))
178  {
179  CoherentReadInternal(binder, value.Y);
180  }
181 
182  if (binder->ReadProperty("Z"))
183  {
184  CoherentReadInternal(binder, value.Z);
185  }
186 
187  if (binder->ReadProperty("W"))
188  {
189  CoherentReadInternal(binder, value.W);
190  }
191 
192  binder->ReadMapEnd();
193  }
194 }
195 }