API Documentation
Loading...
Searching...
No Matches
TableColumn.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Database
28File: TableColumn
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/String.h>
35#include <NDEVR/Time.h>
36#include <NDEVR/File.h>
37#include <NDEVR/UUID.h>
38#include <NDEVR/Vector.h>
39#include <NDEVR/TranslatedString.h>
40#include <NDEVR/TypeInfo.h>
41#include <NDEVR/RGBColor.h>
42#include <NDEVR/BitFlag.h>
43#include <NDEVR/Compressor.h>
44namespace NDEVR
45{
46 class RGBColor;
47 class BinaryFile;
48 /**--------------------------------------------------------------------------------------------------
49 \brief Records changes to a table or column noting the bounds of the data adjusted. Useful for optimized
50 saving or mirroring of data.
51 **/
53 {
55 {
56 e_update
57 , e_insertion
58 , e_deletion
59 };
60 TableChange(TableChangeType type, uint04 start, uint04 size, Time time = Time::SystemTime())
61 : time(time)
62 , start(start)
63 , size(size)
64 , type(type)
65 {}
70 };
71 /**--------------------------------------------------------------------------------------------------
72 \brief A virtual storage type that is used with Table class to store data where the actual mechanism
73 for storage can be abstracted away.
74 **/
76 {
77 public:
78 TableColumn(const String& label);
79 TableColumn(const String& label, const TypeInfo type);
80 virtual ~TableColumn();
81 const String& label() const;
82 void setLabel(const String& label);
83 virtual void setSize(uint04 size) = 0;
84 virtual void setRowSize(uint04, uint04) { lib_assert(false, "Must be of array type to use"); };
85 virtual uint04 getRowSize(uint04) const { lib_assert(false, "Must be of array type to use"); return 0; };
86 virtual TypeInfo type() const { return m_type; }
87 virtual void removeRow(uint04 index) = 0;
88 virtual void removeRows(uint04 index, uint04 size) = 0;
89 virtual void removeRows(const Buffer<uint04>& sorted_remove_indices) = 0;
90 virtual void insert(uint04 index) = 0;
91 virtual void set(uint04 index, bool value) = 0;
92 virtual void set(uint04 index, uint01 value) = 0;
93 virtual void set(uint04 index, uint02 value) = 0;
94 virtual void set(uint04 index, uint04 value) = 0;
95 virtual void set(uint04 index, uint08 value) = 0;
96 virtual void set(uint04 index, sint01 value) = 0;
97 virtual void set(uint04 index, sint02 value) = 0;
98 virtual void set(uint04 index, sint04 value) = 0;
99 virtual void set(uint04 index, sint08 value) = 0;
100 virtual void set(uint04 index, fltp04 value) = 0;
101 virtual void set(uint04 index, fltp08 value) = 0;
102 virtual void set(uint04 index, const String& value) = 0;
103 virtual void set(uint04 index, RGBColor value) = 0;
104 virtual void set(uint04 index, uint04 vector_pos, bool value) = 0;
105 virtual void set(uint04 index, uint04 vector_pos, uint01 value) = 0;
106 virtual void set(uint04 index, uint04 vector_pos, uint02 value) = 0;
107 virtual void set(uint04 index, uint04 vector_pos, uint04 value) = 0;
108 virtual void set(uint04 index, uint04 vector_pos, uint08 value) = 0;
109 virtual void set(uint04 index, uint04 vector_pos, sint01 value) = 0;
110 virtual void set(uint04 index, uint04 vector_pos, sint02 value) = 0;
111 virtual void set(uint04 index, uint04 vector_pos, sint04 value) = 0;
112 virtual void set(uint04 index, uint04 vector_pos, sint08 value) = 0;
113 virtual void set(uint04 index, uint04 vector_pos, fltp04 value) = 0;
114 virtual void set(uint04 index, uint04 vector_pos, fltp08 value) = 0;
115 virtual void set(uint04 index, uint04 vector_pos, const String& value) = 0;
116 virtual void set(uint04 index, const Matrix<fltp08>& transform);
117 virtual void set(uint04 index, const Matrix<fltp04>& transform);
118 virtual void compress(BinaryCompressionObject& object) = 0;
120 {
121 /*if (m_compression_valid)
122 {
123 uint08 hash = tableHash();
124 if (m_compression_hash != hash)
125 {
126 m_compression_hash = hash;
127 m_compression_valid = false;
128 }
129 }
130 else
131 {
132 m_compression_hash = tableHash();
133 }
134 if (!m_compression_valid)
135 {*/
136 compress(object);
137 /*}
138 else
139 {
140 object = m_compression_object;
141 }*/
142 }
144 {
145 m_compression_valid = true;
146 m_compression_object = object;
147 m_compression_hash = tableHash();
148 }
149 virtual void mapToFile(BinaryFile& file, int compression) = 0;
150 virtual void mapToFile(BinaryFile& file, BinaryCompressionObject& object) = 0;
151 virtual void mapFromFile(BinaryFile& file, uint08 version_number) = 0;
152 virtual void set(uint04 index, const UUID& value);
153 void set(uint04 index, const Time& time);
154 void set(uint04 index, const Vector<32, bool>& value);
155
156 template<uint01 t_dims, class t_type>
157 void set(uint04 index, const Triangle<t_dims, t_type>& value)
158 {
159 lib_assert(type().vector_size == t_dims * 3, "Unexpected vector size write to column");
160 for (uint01 i = 0; i < 3; i++)
161 for (uint01 n = 0; n < t_dims; n++)
162 set(index, 3 * i + n, value[i][n]);
163 }
164
165
166 template<uint01 t_dims, class t_type>
167 void set(uint04 index, const Bounds<t_dims, t_type>& value)
168 {
169 lib_assert(type().vector_size == t_dims * 2, "Unexpected vector size write to column");
170 for (uint01 i = 0; i < 2; i++)
171 for (uint01 n = 0; n < t_dims; n++)
172 set(index, t_dims * i + n, value[i][n]);
173 }
174
175 template<class t_type, uint01 t_col, uint01 t_row>
176 void set(uint04 index, const Matrix<t_type, t_col, t_row>& matrix)
177 {
178 lib_assert(type().vector_size == t_col * t_row, "Unexpected vector size write to column");
179 for (uint01 col = 0; col < t_col; col++)
180 for (uint01 row = 0; row < t_row; row++)
181 set(index, col * t_row + row, matrix[col][row]);
182 }
183 template<class t_class>
184 typename std::enable_if<IsVec<t_class>::value>::type set(uint04 index, const t_class& value)
185 {
186 if (t_class::NumberOfDimensions() == 1)
187 set(index, value[0]);
188 else
189 setVector(index, value);
190 }
191 template<class t_class>
192 typename std::enable_if<ObjectInfo<t_class>::Enum>::type set(uint04 index, const t_class& value)
193 {
194 lib_assert(type().vector_size == 0, "Unexpected vector size write to column");
195 set(index, cast<uint04>(value));
196 }
197 inline void set(uint04 index, const BitFlag& bitflag)
198 {
199 set(index, bitflag.bits());
200 }
201 template<class t_class>
202 typename std::enable_if<!ObjectInfo<t_class>::Enum && !IsVec<t_class>::value>::type set(uint04 index, const t_class& value)
203 {
204 lib_assert(type().vector_size == 0, "Unexpected vector size write to column");
205 set(index, String(value));
206 }
207
208 template<class t_type>
209 void set(t_type* values, uint04 start_index, uint04 size)
210 {
211 if (GetTypeInfo<t_type>() == type())
212 {
213 memcpy(((t_type*)begin()) + start_index, values, size * sizeof(t_type));
214 }
215 else for (uint04 i = 0; i < size; i++)
216 {
217 set(i + start_index, values[i]);
218 }
219 }
220 template<uint01 t_dims, class t_type>
221 void setVector(uint04 index, const Vector<t_dims, t_type>& value)
222 {
223 const uint01 dim_size = getMin(cast<uint01>(type().vector_size), t_dims);
224 for (uint01 i = 0; i < dim_size; i++)
225 set(index, i, value[i]);
226 }
227
228 virtual bool isSame(uint04 index, const String& value) const = 0;
229 virtual bool isSame(uint04 index, const char* value) const = 0;
230 virtual bool contains(uint04 index, const String& value, bool ignore_case) const = 0;
231 virtual bool contains(uint04 index, const char* value, bool ignore_case) const = 0;
232 virtual bool beginsWith(uint04 index, const String& value, bool ignore_case) const = 0;
233 virtual bool beginsWith(uint04 index, const char* value, bool ignore_case) const = 0;
234
235 template<class t_class>
236 void get(uint04 index, Vector<1, t_class>& vector) const
237 {
238 get(index, vector[0]);
239 }
240
241 void get(uint04 index, BitFlag& bitflag) const
242 {
243 uint01 value;
244 get(index, value);
245 bitflag = BitFlag(value);
246 }
247
248 template<class t_class>
249 typename std::enable_if<IsVec<t_class>::value && t_class::NumberOfDimensions() != 1>::type get(uint04 index, t_class& vector) const
250 {
251 getVector(index, vector);
252 }
253 template<class t_class>
254 typename std::enable_if<ObjectInfo<t_class>::Enum>::type get(uint04 index, t_class& enum_value) const
255 {
256 uint04 value;
257 get(index, value);
258 enum_value = cast<t_class>(value);
259 }
260
261
262 template<class t_type>
263 inline uint04 getIndexOf(const t_type& object) const
264 {
265 for (uint04 i = 0; i < size(); i++)
266 {
267 if (object == get<t_type>(i))
268 return i;
269 }
271 }
272 void setCompressionMode(CompressionMode compression_mode)
273 {
274 if (m_compression_mode != compression_mode)
275 {
276 m_compression_mode = compression_mode;
277 m_compression_valid = false;
278 }
279 }
280
281 virtual void get(uint04 index, uint04 vector_pos, bool& value) const = 0;
282 virtual void get(uint04 index, uint04 vector_pos, uint01& value) const = 0;
283 virtual void get(uint04 index, uint04 vector_pos, uint02& value) const = 0;
284 virtual void get(uint04 index, uint04 vector_pos, uint04& value) const = 0;
285 virtual void get(uint04 index, uint04 vector_pos, uint08& value) const = 0;
286 virtual void get(uint04 index, uint04 vector_pos, sint01& value) const = 0;
287 virtual void get(uint04 index, uint04 vector_pos, sint02& value) const = 0;
288 virtual void get(uint04 index, uint04 vector_pos, sint04& value) const = 0;
289 virtual void get(uint04 index, uint04 vector_pos, sint08& value) const = 0;
290 virtual void get(uint04 index, uint04 vector_pos, fltp04& value) const = 0;
291 virtual void get(uint04 index, uint04 vector_pos, fltp08& value) const = 0;
292 virtual void get(uint04 index, uint04 vector_pos, String& value) const = 0;
293 virtual void get(uint04 index, bool& value) const = 0;
294 virtual void get(uint04 index, uint01& value) const = 0;
295 virtual void get(uint04 index, uint02& value) const = 0;
296 virtual void get(uint04 index, uint04& value) const = 0;
297 virtual void get(uint04 index, uint08& value) const = 0;
298 virtual void get(uint04 index, sint01& value) const = 0;
299 virtual void get(uint04 index, sint02& value) const = 0;
300 virtual void get(uint04 index, sint04& value) const = 0;
301 virtual void get(uint04 index, sint08& value) const = 0;
302 virtual void get(uint04 index, fltp04& value) const = 0;
303 virtual void get(uint04 index, fltp08& value) const = 0;
304 virtual void get(uint04 index, String& value) const = 0;
305 virtual void get(uint04 index, RGBColor& value) const = 0;
306 virtual void get(uint04 index, Matrix<fltp08>& transform) const;
307 virtual void get(uint04 index, Matrix<fltp04>& transform) const;
308
309 virtual void getVector(uint04 index, Vector<3, fltp04>& vector) const;
310 virtual void getVector(uint04 index, Vector<3, fltp08>& vector) const;
311 virtual void getVector(uint04 index, Vector<3, uint04>& vector) const;
312 virtual void getVector(uint04 index, Vector<2, uint04>& vector) const;
313 virtual void getVector(uint04 index, Vector<1, uint04>& vector) const;
314
315 template<class t_type, uint01 t_col, uint01 t_row>
316 void get(uint04 index, Matrix<t_type, t_col, t_row>& matrix) const
317 {
318 for (uint01 col = 0; col < t_col; col++)
319 for (uint01 row = 0; row < t_row; row++)
320 get(index, col * t_row + row, matrix[col][row]);
321 }
322
323 void get(uint04 index, File& file) const
324 {
325 String value;
326 get(index, value);
327 file = value;
328 }
329
330 virtual void get(uint04 index, UUID& vector) const
331 {
332 for (uint01 i = 0; i < 16; i++)
333 get(index, i, vector[i]);
334 }
335
336 void get(uint04 index, Time& time) const
337 {
338 uint08 value;
339 get(index, value);
340 time = Time(value);
341 }
342
343 void get(uint04 index, TranslatedString& string) const
344 {
345 String value;
346 get(index, value);
347 string = TranslatedString(value);
348 }
349
350 void get(uint04 index, Vector<32, bool>& value) const
351 {
352 uint04 int_value;
353 get(index, int_value);
354 value = rcast<Vector<32, bool>>(int_value);
355 //memcpy(&value, &int_value, sizeof(int_value));
356 }
357
358 template<uint01 t_dims, class t_type>
359 void get(uint04 index, Bounds<t_dims, t_type>& bounds) const
360 {
361 for (uint01 i = 0; i < 2; i++)
362 for (uint01 n = 0; n < t_dims; n++)
363 get(index, t_dims * i + n, bounds[i][n]);
364 }
365
366 template<uint01 t_dims, class t_type>
367 void get(uint04 index, Triangle<t_dims, t_type>& tri) const
368 {
369 for (uint01 i = 0; i < 3; i++)
370 for (uint01 n = 0; n < 3 * t_dims; n++)
371 get(index, 3 * i + n, tri[i][n]);
372 }
373
374 template<class t_class>
375 t_class get(uint04 index) const
376 {
377 t_class value;
378 get(index, value);
379 return value;
380 }
381 template<class t_class>
382 t_class get(uint04 index, uint04 sub_index) const
383 {
384 t_class value;
385 get(index, sub_index, value);
386 return value;
387 }
388 template<uint01 t_dims, class t_type>
389 void getVector(uint04 index, Vector<t_dims, t_type>& value) const
390 {
391 for (uint01 i = 0; i < t_dims; i++)
392 get(index, i, value[i]);
393 }
394 template<class t_type>
395 void insert(uint04 index, const t_type& value)
396 {
397 insert(index);
398 set(index, value);
399 }
400
401 virtual void setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn& from_column)
402 {
403 switch (type().vector_size)
404 {
405 case 0:
406 case 1:
407 {
408 if (type().is_string)
409 setAll<String>(to_location, from_location, size, from_column);
410 else
411 _setAll<1>(to_location, from_location, size, from_column);
412 } break;
413
414 case 2: _setAll<2>(to_location, from_location, size, from_column); break;
415 case 3: _setAll<3>(to_location, from_location, size, from_column); break;
416 case 4: _setAll<4>(to_location, from_location, size, from_column); break;
417 case 16: _setAll<16>(to_location, from_location, size, from_column); break;
418 default: setAll<String>(to_location, from_location, size, from_column); break;
419 }
420 };
421
422 template<class t_type>
423 void setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn& from_column)
424 {
425 bool can_copy = ObjectInfo<t_type>::Primitive;
426 can_copy &= !ObjectInfo<t_type>::Boolean;
427 can_copy &= type() == GetTypeInfo<t_type>();
428 can_copy &= from_column.type() == type();
429 can_copy &= begin() != nullptr;
430 can_copy &= from_column.begin() != nullptr;
431 if(can_copy)
432 {
433 memmove(
434 (uint01*)(begin()) + to_location * sizeof(t_type)
435 , (uint01*)(from_column.begin()) + from_location * sizeof(t_type)
436 , size * sizeof(t_type));
437 }
438 else
439 {
440 for (uint04 i = 0; i < size; i++)
441 {
442 set(to_location + i, from_column.get<t_type>(from_location + i));
443 }
444 }
445 }
446 virtual TableColumn* getSelected(const Buffer<bool>& selected_indices) const = 0;
447 virtual void insertRows(uint04 location, uint04 size) = 0;
448 virtual void addRow() { insertRows(size(), 1); }
449 virtual void insertIndices(uint04 location, uint04 size) = 0;
450 virtual void removeIndices(uint04 location, uint04 size) = 0;
451 virtual void removeIndices(const Buffer<uint04>& offset_lookup_list) = 0;
452 virtual void removeRows(uint04 offset, const Buffer<bool>& indices) = 0;
453
455 {
456 return m_modified_time;
457 }
459 {
460 m_modified_time = Time(0);
461 m_changes.clear();
462 }
464 {
465 update(TableChange(TableChange::e_update, 0, size()));
466 }
467
468 virtual void updateFrom(const TableColumn& column);
469
470 void update(const TableChange& change);
471
472 virtual void copyRow(uint04 source, uint04 destination) = 0;
473 virtual void copyRows(uint04 source, uint04 destination, uint04 size) = 0;
474
475 template<class t_type>
476 void setDefaultValue(const t_type& value)
477 {
478 set(Constant<uint04>::Invalid, value);
479 }
480 template<class t_type>
481 t_type getDefaultValue() const
482 {
483 return get<t_type>(Constant<uint04>::Invalid);
484 }
486 {
487 return m_changes;
488 }
489 template<class t_type>
491 {
492 Buffer<t_type> values(size);
493 values.setSize(size);
494 if (GetTypeInfo<t_type>() == type())
495 {
496 memcpy(values.begin(), ((const t_type*)begin()) + start, size * sizeof(t_type));
497 }
498 else
499 {
500 for (uint04 i = 0; i < size; ++i)
501 get(i + start, values[i]);
502 }
503 return values;
504 }
505
507 Buffer<TableChange> changesSince(const Time& time, const Bounds<1, uint04>& range) const;
508 bool hasChangesSince(const Time& time, const Bounds<1, uint04>& range) const;
509 virtual uint04 size() const = 0;
510 virtual void* begin() = 0;
511 virtual void* end() = 0;
512
513 virtual const void* begin() const = 0;
514 virtual const void* end() const = 0;
515 BinaryCompressionObject& compressionObject() { return m_compression_object; }
516 bool compressionValid() const { return m_compression_valid; }
517 private:
518 template<uint01 t_dims>
519 void _setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn& from_column)
520 {
521 if constexpr (t_dims == 1)
522 {
523 if (type().is_number)
524 {
525 if (type().is_float)
526 {
527 if (type().byte_size == 4)
528 setAll<fltp04>(to_location, from_location, size, from_column);
529 if (type().byte_size == 8)
530 setAll<fltp08>(to_location, from_location, size, from_column);
531 }
532 else if (type().is_unsigned)
533 {
534 if (type().byte_size == 1)
535 setAll<uint01>(to_location, from_location, size, from_column);
536 if (type().byte_size == 2)
537 setAll<uint02>(to_location, from_location, size, from_column);
538 if (type().byte_size == 4)
539 setAll<uint04>(to_location, from_location, size, from_column);
540 if (type().byte_size == 8)
541 setAll<uint08>(to_location, from_location, size, from_column);
542 }
543 else
544 {
545 if (type().byte_size == 1)
546 setAll<sint01>(to_location, from_location, size, from_column);
547 if (type().byte_size == 2)
548 setAll<sint02>(to_location, from_location, size, from_column);
549 if (type().byte_size == 4)
550 setAll<sint04>(to_location, from_location, size, from_column);
551 if (type().byte_size == 8)
552 setAll<sint08>(to_location, from_location, size, from_column);
553 }
554 }
555 else
556 {
557 lib_assert(false, "Table copy type not supported");
558 }
559 }
560 else
561 {
562 if (type().is_number)
563 {
564 if (type().is_float)
565 {
566 if (type().byte_size == 4)
567 setAll<Vector<t_dims, fltp04>>(to_location, from_location, size, from_column);
568 if (type().byte_size == 8)
569 setAll<Vector<t_dims, fltp08>>(to_location, from_location, size, from_column);
570 }
571 else if (type().is_unsigned)
572 {
573 if (type().byte_size == 1)
574 setAll<Vector<t_dims, uint01>>(to_location, from_location, size, from_column);
575 if (type().byte_size == 2)
576 setAll<Vector<t_dims, uint02>>(to_location, from_location, size, from_column);
577 if (type().byte_size == 4)
578 setAll<Vector<t_dims, uint04>>(to_location, from_location, size, from_column);
579 if (type().byte_size == 8)
580 setAll<Vector<t_dims, uint08>>(to_location, from_location, size, from_column);
581 }
582 else
583 {
584 if (type().byte_size == 1)
585 setAll<Vector<t_dims, sint01>>(to_location, from_location, size, from_column);
586 if (type().byte_size == 2)
587 setAll<Vector<t_dims, sint02>>(to_location, from_location, size, from_column);
588 if (type().byte_size == 4)
589 setAll<Vector<t_dims, sint04>>(to_location, from_location, size, from_column);
590 if (type().byte_size == 8)
591 setAll<Vector<t_dims, sint08>>(to_location, from_location, size, from_column);
592 }
593 }
594 else if (type().is_color)
595 {
596 setAll<RGBColor>(to_location, from_location, size, from_column);
597 }
598 else
599 {
600 lib_assert(false, "Table copy type not supported");
601 }
602 }
603 };
604 virtual uint08 tableHash() const
605 {
606 uint08 result = 2166136261U;
607 uint01* start = (uint01*)begin();
608 uint01* stop = (uint01*)end();
609 for (uint01* c = start; c < stop; c++)
610 result = (127 * result) ^ *c;
611 return result;
612 }
613 protected:
620 CompressionMode m_compression_mode = CompressionMode::e_default_compression;
622 };
623}
#define NDEVR_DATABASE_API
Definition DLLInfo.h:50
#define lib_assert(expression, message)
Definition LibAssert.h:61
Logic for reading or writing to a binary file including logic for.
Definition BinaryFile.h:59
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:55
uint01 bits() const
Definition BitFlag.hpp:237
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
void setSize(t_index_type new_size)
Definition Buffer.hpp:803
decltype(auto) begin()
Definition Buffer.hpp:402
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Definition Matrix.hpp:176
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
The core String class for the NDEVR API.
Definition String.h:69
A virtual storage type that is used with Table class to store data where the actual mechanism for sto...
Definition TableColumn.h:76
virtual void get(uint04 index, uint04 vector_pos, uint01 &value) const =0
t_type getDefaultValue() const
Definition TableColumn.h:481
void updateAll()
Definition TableColumn.h:463
virtual void get(uint04 index, Matrix< fltp08 > &transform) const
virtual void removeIndices(const Buffer< uint04 > &offset_lookup_list)=0
virtual void get(uint04 index, Matrix< fltp04 > &transform) const
Buffer< TableChange > changesSince(const Time &time) const
String m_label
Definition TableColumn.h:616
virtual void get(uint04 index, uint04 vector_pos, sint04 &value) const =0
void insert(uint04 index, const t_type &value)
Definition TableColumn.h:395
virtual void getVector(uint04 index, Vector< 1, uint04 > &vector) const
virtual uint04 getRowSize(uint04) const
Definition TableColumn.h:85
virtual void set(uint04 index, uint04 vector_pos, sint02 value)=0
virtual void set(uint04 index, uint04 vector_pos, uint04 value)=0
void get(uint04 index, Vector< 32, bool > &value) const
Definition TableColumn.h:350
Buffer< t_type > getAll(uint04 start, uint04 size) const
Definition TableColumn.h:490
virtual void set(uint04 index, const UUID &value)
void setVector(uint04 index, const Vector< t_dims, t_type > &value)
Definition TableColumn.h:221
std::enable_if< ObjectInfo< t_class >::Enum >::type get(uint04 index, t_class &enum_value) const
Definition TableColumn.h:254
virtual void getVector(uint04 index, Vector< 3, fltp04 > &vector) const
virtual void set(uint04 index, uint04 vector_pos, fltp04 value)=0
virtual void removeRows(uint04 index, uint04 size)=0
void set(uint04 index, const Vector< 32, bool > &value)
void setLabel(const String &label)
virtual void addRow()
Definition TableColumn.h:448
virtual void * end()=0
void get(uint04 index, Bounds< t_dims, t_type > &bounds) const
Definition TableColumn.h:359
virtual TableColumn * getSelected(const Buffer< bool > &selected_indices) const =0
virtual void get(uint04 index, UUID &vector) const
Definition TableColumn.h:330
virtual bool beginsWith(uint04 index, const String &value, bool ignore_case) const =0
BinaryCompressionObject & compressionObject()
Definition TableColumn.h:515
virtual bool contains(uint04 index, const char *value, bool ignore_case) const =0
virtual void set(uint04 index, sint01 value)=0
TableColumn(const String &label, const TypeInfo type)
void set(uint04 index, const Bounds< t_dims, t_type > &value)
Definition TableColumn.h:167
bool m_compression_valid
Definition TableColumn.h:621
void set(t_type *values, uint04 start_index, uint04 size)
Definition TableColumn.h:209
virtual void get(uint04 index, uint08 &value) const =0
TableColumn(const String &label)
virtual bool isSame(uint04 index, const String &value) const =0
virtual void getVector(uint04 index, Vector< 2, uint04 > &vector) const
virtual void get(uint04 index, uint04 vector_pos, uint04 &value) const =0
virtual uint04 size() const =0
virtual void mapToFile(BinaryFile &file, BinaryCompressionObject &object)=0
t_class get(uint04 index) const
Definition TableColumn.h:375
virtual void get(uint04 index, uint04 vector_pos, uint08 &value) const =0
bool hasChangesSince(const Time &time, const Bounds< 1, uint04 > &range) const
virtual void get(uint04 index, uint04 vector_pos, sint02 &value) const =0
TypeInfo m_type
Definition TableColumn.h:617
void get(uint04 index, TranslatedString &string) const
Definition TableColumn.h:343
virtual void compressIfNeeded(BinaryCompressionObject &object)
Definition TableColumn.h:119
Time m_modified_time
Definition TableColumn.h:615
virtual void get(uint04 index, sint04 &value) const =0
virtual void set(uint04 index, uint04 vector_pos, const String &value)=0
virtual void set(uint04 index, uint04 vector_pos, bool value)=0
void set(uint04 index, const Matrix< t_type, t_col, t_row > &matrix)
Definition TableColumn.h:176
virtual void insertIndices(uint04 location, uint04 size)=0
virtual void set(uint04 index, const Matrix< fltp04 > &transform)
virtual void set(uint04 index, const Matrix< fltp08 > &transform)
virtual void set(uint04 index, uint01 value)=0
void setDefaultValue(const t_type &value)
Definition TableColumn.h:476
virtual void get(uint04 index, sint01 &value) const =0
void get(uint04 index, Matrix< t_type, t_col, t_row > &matrix) const
Definition TableColumn.h:316
virtual void set(uint04 index, uint04 vector_pos, uint02 value)=0
std::enable_if< IsVec< t_class >::value &&t_class::NumberOfDimensions()!=1 >::type get(uint04 index, t_class &vector) const
Definition TableColumn.h:249
virtual void compress(BinaryCompressionObject &object)=0
virtual void get(uint04 index, String &value) const =0
const Buffer< TableChange > & changes() const
Definition TableColumn.h:485
virtual void set(uint04 index, sint08 value)=0
std::enable_if<!ObjectInfo< t_class >::Enum &&!IsVec< t_class >::value >::type set(uint04 index, const t_class &value)
Definition TableColumn.h:202
virtual void set(uint04 index, uint04 vector_pos, sint04 value)=0
Buffer< TableChange > changesSince(const Time &time, const Bounds< 1, uint04 > &range) const
void clearUpdates()
Definition TableColumn.h:458
virtual void set(uint04 index, const String &value)=0
virtual void set(uint04 index, uint08 value)=0
virtual void get(uint04 index, fltp08 &value) const =0
t_class get(uint04 index, uint04 sub_index) const
Definition TableColumn.h:382
virtual void get(uint04 index, bool &value) const =0
virtual void set(uint04 index, uint04 value)=0
virtual void get(uint04 index, uint04 vector_pos, fltp08 &value) const =0
virtual void insertRows(uint04 location, uint04 size)=0
virtual void set(uint04 index, RGBColor value)=0
virtual void copyRows(uint04 source, uint04 destination, uint04 size)=0
virtual bool beginsWith(uint04 index, const char *value, bool ignore_case) const =0
virtual void get(uint04 index, uint04 vector_pos, fltp04 &value) const =0
void get(uint04 index, Triangle< t_dims, t_type > &tri) const
Definition TableColumn.h:367
virtual void set(uint04 index, sint04 value)=0
virtual void set(uint04 index, uint04 vector_pos, fltp08 value)=0
virtual void set(uint04 index, uint02 value)=0
virtual void get(uint04 index, fltp04 &value) const =0
virtual void get(uint04 index, RGBColor &value) const =0
virtual void get(uint04 index, uint04 vector_pos, bool &value) const =0
void update(const TableChange &change)
void get(uint04 index, BitFlag &bitflag) const
Definition TableColumn.h:241
uint04 getIndexOf(const t_type &object) const
Definition TableColumn.h:263
virtual void get(uint04 index, sint08 &value) const =0
void set(uint04 index, const BitFlag &bitflag)
Definition TableColumn.h:197
virtual void setSize(uint04 size)=0
virtual void removeRows(const Buffer< uint04 > &sorted_remove_indices)=0
void set(uint04 index, const Triangle< t_dims, t_type > &value)
Definition TableColumn.h:157
virtual const void * end() const =0
virtual bool contains(uint04 index, const String &value, bool ignore_case) const =0
void setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn &from_column)
Definition TableColumn.h:423
virtual void get(uint04 index, sint02 &value) const =0
virtual void get(uint04 index, uint04 &value) const =0
virtual void get(uint04 index, uint01 &value) const =0
virtual void setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn &from_column)
Definition TableColumn.h:401
virtual ~TableColumn()
virtual void set(uint04 index, uint04 vector_pos, uint08 value)=0
void setCompressionMode(CompressionMode compression_mode)
Definition TableColumn.h:272
virtual void set(uint04 index, uint04 vector_pos, uint01 value)=0
virtual void set(uint04 index, fltp04 value)=0
BinaryCompressionObject m_compression_object
Definition TableColumn.h:614
uint08 m_compression_hash
Definition TableColumn.h:618
virtual void insert(uint04 index)=0
std::enable_if< IsVec< t_class >::value >::type set(uint04 index, const t_class &value)
Definition TableColumn.h:184
virtual void copyRow(uint04 source, uint04 destination)=0
virtual void get(uint04 index, uint04 vector_pos, sint01 &value) const =0
virtual void getVector(uint04 index, Vector< 3, uint04 > &vector) const
const String & label() const
virtual TypeInfo type() const
Definition TableColumn.h:86
virtual void getVector(uint04 index, Vector< 3, fltp08 > &vector) const
virtual void get(uint04 index, uint04 vector_pos, uint02 &value) const =0
virtual void setRowSize(uint04, uint04)
Definition TableColumn.h:84
void get(uint04 index, Time &time) const
Definition TableColumn.h:336
virtual void removeRow(uint04 index)=0
virtual bool isSame(uint04 index, const char *value) const =0
virtual void removeRows(uint04 offset, const Buffer< bool > &indices)=0
virtual void updateFrom(const TableColumn &column)
virtual void get(uint04 index, uint04 vector_pos, String &value) const =0
virtual void removeIndices(uint04 location, uint04 size)=0
virtual void mapToFile(BinaryFile &file, int compression)=0
virtual void * begin()=0
void get(uint04 index, Vector< 1, t_class > &vector) const
Definition TableColumn.h:236
void getVector(uint04 index, Vector< t_dims, t_type > &value) const
Definition TableColumn.h:389
virtual void set(uint04 index, fltp08 value)=0
virtual void mapFromFile(BinaryFile &file, uint08 version_number)=0
virtual void get(uint04 index, uint02 &value) const =0
Time modifiedTime() const
Definition TableColumn.h:454
virtual void set(uint04 index, bool value)=0
void updateCompressionInfo(BinaryCompressionObject &object)
Definition TableColumn.h:143
Buffer< TableChange > m_changes
Definition TableColumn.h:619
virtual void get(uint04 index, uint04 vector_pos, sint08 &value) const =0
void set(uint04 index, const Time &time)
virtual void set(uint04 index, uint04 vector_pos, sint01 value)=0
virtual void set(uint04 index, sint02 value)=0
std::enable_if< ObjectInfo< t_class >::Enum >::type set(uint04 index, const t_class &value)
Definition TableColumn.h:192
void get(uint04 index, File &file) const
Definition TableColumn.h:323
virtual const void * begin() const =0
bool compressionValid() const
Definition TableColumn.h:516
virtual void set(uint04 index, uint04 vector_pos, sint08 value)=0
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A triangle is a polygon with three edges and three vertices. It is one of the basic shapes in geometr...
Definition Triangle.hpp:138
Stores information about a type, relevant for certain templated functions. To get information about a...
Definition TypeInfo.h:43
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:64
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
Definition BaseValues.hpp:71
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
int8_t sint01
-Defines an alias representing a 1 byte, signed integer. -Can represent exact integer values -127 thr...
Definition BaseValues.hpp:50
CompressionMode
Logical information about the type of compression implemented or requested.
Definition Compressor.h:16
int16_t sint02
-Defines an alias representing a 2 byte, signed integer. -Can represent exact integer values -32767 t...
Definition BaseValues.hpp:57
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:106
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:88
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05...
Definition BaseFunctions.hpp:56
A container for storing compressed data, typically used for File IO operations. Responsible for stori...
Definition Compressor.h:52
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Definition Vector.hpp:768
Information about the object.
Definition ObjectInfo.h:54
Records changes to a table or column noting the bounds of the data adjusted. Useful for optimized sav...
Definition TableColumn.h:53
TableChange(TableChangeType type, uint04 start, uint04 size, Time time=Time::SystemTime())
Definition TableColumn.h:60
uint04 size
Definition TableColumn.h:68
uint04 start
Definition TableColumn.h:67
TableChangeType
Definition TableColumn.h:55
TableChangeType type
Definition TableColumn.h:69
Time time
Definition TableColumn.h:66