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;
49 {
51 {
52 e_update
53 , e_insertion
54 , e_deletion
55 };
56 TableChange(TableChangeType type, uint04 start, uint04 size, Time time = Time::SystemTime())
57 : time(time)
58 , start(start)
59 , size(size)
60 , type(type)
61 {}
66 };
68 {
69 public:
70 TableColumn(const String& label);
71 TableColumn(const String& label, const TypeInfo type);
72 virtual ~TableColumn();
73 const String& label() const;
74 void setLabel(const String& label);
75 virtual void setSize(uint04 size) = 0;
76 virtual void setRowSize(uint04, uint04) { lib_assert(false, "Must be of array type to use"); };
77 virtual uint04 getRowSize(uint04) const { lib_assert(false, "Must be of array type to use"); return 0; };
78 virtual TypeInfo type() const { return m_type; }
79 virtual void removeRow(uint04 index) = 0;
80 virtual void removeRows(uint04 index, uint04 size) = 0;
81 virtual void removeRows(const Buffer<uint04>& sorted_remove_indices) = 0;
82 virtual void insert(uint04 index) = 0;
83 virtual void set(uint04 index, bool value) = 0;
84 virtual void set(uint04 index, uint01 value) = 0;
85 virtual void set(uint04 index, uint02 value) = 0;
86 virtual void set(uint04 index, uint04 value) = 0;
87 virtual void set(uint04 index, uint08 value) = 0;
88 virtual void set(uint04 index, sint01 value) = 0;
89 virtual void set(uint04 index, sint02 value) = 0;
90 virtual void set(uint04 index, sint04 value) = 0;
91 virtual void set(uint04 index, sint08 value) = 0;
92 virtual void set(uint04 index, fltp04 value) = 0;
93 virtual void set(uint04 index, fltp08 value) = 0;
94 virtual void set(uint04 index, const String& value) = 0;
95 virtual void set(uint04 index, RGBColor value) = 0;
96 virtual void set(uint04 index, uint04 vector_pos, bool value) = 0;
97 virtual void set(uint04 index, uint04 vector_pos, uint01 value) = 0;
98 virtual void set(uint04 index, uint04 vector_pos, uint02 value) = 0;
99 virtual void set(uint04 index, uint04 vector_pos, uint04 value) = 0;
100 virtual void set(uint04 index, uint04 vector_pos, uint08 value) = 0;
101 virtual void set(uint04 index, uint04 vector_pos, sint01 value) = 0;
102 virtual void set(uint04 index, uint04 vector_pos, sint02 value) = 0;
103 virtual void set(uint04 index, uint04 vector_pos, sint04 value) = 0;
104 virtual void set(uint04 index, uint04 vector_pos, sint08 value) = 0;
105 virtual void set(uint04 index, uint04 vector_pos, fltp04 value) = 0;
106 virtual void set(uint04 index, uint04 vector_pos, fltp08 value) = 0;
107 virtual void set(uint04 index, uint04 vector_pos, const String& value) = 0;
108 virtual void set(uint04 index, const Matrix<fltp08>& transform);
109 virtual void set(uint04 index, const Matrix<fltp04>& transform);
110 virtual void compress(BinaryCompressionObject& object) = 0;
112 {
113 /*if (m_compression_valid)
114 {
115 uint08 hash = tableHash();
116 if (m_compression_hash != hash)
117 {
118 m_compression_hash = hash;
119 m_compression_valid = false;
120 }
121 }
122 else
123 {
124 m_compression_hash = tableHash();
125 }
126 if (!m_compression_valid)
127 {*/
128 compress(object);
129 /*}
130 else
131 {
132 object = m_compression_object;
133 }*/
134 }
136 {
137 m_compression_valid = true;
138 m_compression_object = object;
139 m_compression_hash = tableHash();
140 }
141 virtual void mapToFile(BinaryFile& file, int compression) = 0;
142 virtual void mapToFile(BinaryFile& file, BinaryCompressionObject& object) = 0;
143 virtual void mapFromFile(BinaryFile& file, uint08 version_number) = 0;
144 virtual void set(uint04 index, const UUID& value);
145 void set(uint04 index, const Time& time);
146 void set(uint04 index, const Vector<32, bool>& value);
147
148 template<uint01 t_dims, class t_type>
149 void set(uint04 index, const Triangle<t_dims, t_type>& value)
150 {
151 lib_assert(type().vector_size == t_dims * 3, "Unexpected vector size write to column");
152 for (uint01 i = 0; i < 3; i++)
153 for (uint01 n = 0; n < t_dims; n++)
154 set(index, 3 * i + n, value[i][n]);
155 }
156
157
158 template<uint01 t_dims, class t_type>
159 void set(uint04 index, const Bounds<t_dims, t_type>& value)
160 {
161 lib_assert(type().vector_size == t_dims * 2, "Unexpected vector size write to column");
162 for (uint01 i = 0; i < 2; i++)
163 for (uint01 n = 0; n < t_dims; n++)
164 set(index, t_dims * i + n, value[i][n]);
165 }
166
167 template<class t_type, uint01 t_col, uint01 t_row>
168 void set(uint04 index, const Matrix<t_type, t_col, t_row>& matrix)
169 {
170 lib_assert(type().vector_size == t_col * t_row, "Unexpected vector size write to column");
171 for (uint01 col = 0; col < t_col; col++)
172 for (uint01 row = 0; row < t_row; row++)
173 set(index, col * t_row + row, matrix[col][row]);
174 }
175 template<class t_class>
176 typename std::enable_if<IsVec<t_class>::value>::type set(uint04 index, const t_class& value)
177 {
178 if (t_class::NumberOfDimensions() == 1)
179 set(index, value[0]);
180 else
181 setVector(index, value);
182 }
183 template<class t_class>
184 typename std::enable_if<ObjectInfo<t_class>::Enum>::type set(uint04 index, const t_class& value)
185 {
186 lib_assert(type().vector_size == 0, "Unexpected vector size write to column");
187 set(index, cast<uint04>(value));
188 }
189 inline void set(uint04 index, const BitFlag& bitflag)
190 {
191 set(index, bitflag.bits());
192 }
193 template<class t_class>
194 typename std::enable_if<!ObjectInfo<t_class>::Enum && !IsVec<t_class>::value>::type set(uint04 index, const t_class& value)
195 {
196 lib_assert(type().vector_size == 0, "Unexpected vector size write to column");
197 set(index, String(value));
198 }
199
200 template<class t_type>
201 void set(t_type* values, uint04 start_index, uint04 size)
202 {
203 if (GetTypeInfo<t_type>() == type())
204 {
205 memcpy(((t_type*)begin()) + start_index, values, size * sizeof(t_type));
206 }
207 else for (uint04 i = 0; i < size; i++)
208 {
209 set(i + start_index, values[i]);
210 }
211 }
212 template<uint01 t_dims, class t_type>
213 void setVector(uint04 index, const Vector<t_dims, t_type>& value)
214 {
215 const uint01 dim_size = getMin(cast<uint01>(type().vector_size), t_dims);
216 for (uint01 i = 0; i < dim_size; i++)
217 set(index, i, value[i]);
218 }
219
220 virtual bool isSame(uint04 index, const String& value) const = 0;
221 virtual bool isSame(uint04 index, const char* value) const = 0;
222 virtual bool contains(uint04 index, const String& value, bool ignore_case) const = 0;
223 virtual bool contains(uint04 index, const char* value, bool ignore_case) const = 0;
224 virtual bool beginsWith(uint04 index, const String& value, bool ignore_case) const = 0;
225 virtual bool beginsWith(uint04 index, const char* value, bool ignore_case) const = 0;
226
227 template<class t_class>
228 void get(uint04 index, Vector<1, t_class>& vector) const
229 {
230 get(index, vector[0]);
231 }
232
233 void get(uint04 index, BitFlag& bitflag) const
234 {
235 uint01 value;
236 get(index, value);
237 bitflag = BitFlag(value);
238 }
239
240 template<class t_class>
241 typename std::enable_if<IsVec<t_class>::value && t_class::NumberOfDimensions() != 1>::type get(uint04 index, t_class& vector) const
242 {
243 getVector(index, vector);
244 }
245 template<class t_class>
246 typename std::enable_if<ObjectInfo<t_class>::Enum>::type get(uint04 index, t_class& enum_value) const
247 {
248 uint04 value;
249 get(index, value);
250 enum_value = cast<t_class>(value);
251 }
252
253
254 template<class t_type>
255 inline uint04 getIndexOf(const t_type& object) const
256 {
257 for (uint04 i = 0; i < size(); i++)
258 {
259 if (object == get<t_type>(i))
260 return i;
261 }
263 }
264 void setCompressionMode(CompressionMode compression_mode)
265 {
266 if (m_compression_mode != compression_mode)
267 {
268 m_compression_mode = compression_mode;
269 m_compression_valid = false;
270 }
271 }
272
273 virtual void get(uint04 index, uint04 vector_pos, bool& value) const = 0;
274 virtual void get(uint04 index, uint04 vector_pos, uint01& value) const = 0;
275 virtual void get(uint04 index, uint04 vector_pos, uint02& value) const = 0;
276 virtual void get(uint04 index, uint04 vector_pos, uint04& value) const = 0;
277 virtual void get(uint04 index, uint04 vector_pos, uint08& value) const = 0;
278 virtual void get(uint04 index, uint04 vector_pos, sint01& value) const = 0;
279 virtual void get(uint04 index, uint04 vector_pos, sint02& value) const = 0;
280 virtual void get(uint04 index, uint04 vector_pos, sint04& value) const = 0;
281 virtual void get(uint04 index, uint04 vector_pos, sint08& value) const = 0;
282 virtual void get(uint04 index, uint04 vector_pos, fltp04& value) const = 0;
283 virtual void get(uint04 index, uint04 vector_pos, fltp08& value) const = 0;
284 virtual void get(uint04 index, uint04 vector_pos, String& value) const = 0;
285 virtual void get(uint04 index, bool& value) const = 0;
286 virtual void get(uint04 index, uint01& value) const = 0;
287 virtual void get(uint04 index, uint02& value) const = 0;
288 virtual void get(uint04 index, uint04& value) const = 0;
289 virtual void get(uint04 index, uint08& value) const = 0;
290 virtual void get(uint04 index, sint01& value) const = 0;
291 virtual void get(uint04 index, sint02& value) const = 0;
292 virtual void get(uint04 index, sint04& value) const = 0;
293 virtual void get(uint04 index, sint08& value) const = 0;
294 virtual void get(uint04 index, fltp04& value) const = 0;
295 virtual void get(uint04 index, fltp08& value) const = 0;
296 virtual void get(uint04 index, String& value) const = 0;
297 virtual void get(uint04 index, RGBColor& value) const = 0;
298 virtual void get(uint04 index, Matrix<fltp08>& transform) const;
299 virtual void get(uint04 index, Matrix<fltp04>& transform) const;
300
301 virtual void getVector(uint04 index, Vector<3, fltp04>& vector) const;
302 virtual void getVector(uint04 index, Vector<3, fltp08>& vector) const;
303 virtual void getVector(uint04 index, Vector<3, uint04>& vector) const;
304 virtual void getVector(uint04 index, Vector<2, uint04>& vector) const;
305 virtual void getVector(uint04 index, Vector<1, uint04>& vector) const;
306
307 template<class t_type, uint01 t_col, uint01 t_row>
308 void get(uint04 index, Matrix<t_type, t_col, t_row>& matrix) const
309 {
310 for (uint01 col = 0; col < t_col; col++)
311 for (uint01 row = 0; row < t_row; row++)
312 get(index, col * t_row + row, matrix[col][row]);
313 }
314
315 void get(uint04 index, File& file) const
316 {
317 String value;
318 get(index, value);
319 file = value;
320 }
321
322 virtual void get(uint04 index, UUID& vector) const
323 {
324 for (uint01 i = 0; i < 16; i++)
325 get(index, i, vector[i]);
326 }
327
328 void get(uint04 index, Time& time) const
329 {
330 uint08 value;
331 get(index, value);
332 time = Time(value);
333 }
334
335 void get(uint04 index, TranslatedString& string) const
336 {
337 String value;
338 get(index, value);
339 string = TranslatedString(value);
340 }
341
342 void get(uint04 index, Vector<32, bool>& value) const
343 {
344 uint04 int_value;
345 get(index, int_value);
346 value = rcast<Vector<32, bool>>(int_value);
347 //memcpy(&value, &int_value, sizeof(int_value));
348 }
349
350 template<uint01 t_dims, class t_type>
351 void get(uint04 index, Bounds<t_dims, t_type>& bounds) const
352 {
353 for (uint01 i = 0; i < 2; i++)
354 for (uint01 n = 0; n < t_dims; n++)
355 get(index, t_dims * i + n, bounds[i][n]);
356 }
357
358 template<uint01 t_dims, class t_type>
359 void get(uint04 index, Triangle<t_dims, t_type>& tri) const
360 {
361 for (uint01 i = 0; i < 3; i++)
362 for (uint01 n = 0; n < 3 * t_dims; n++)
363 get(index, 3 * i + n, tri[i][n]);
364 }
365
366 template<class t_class>
367 t_class get(uint04 index) const
368 {
369 t_class value;
370 get(index, value);
371 return value;
372 }
373 template<class t_class>
374 t_class get(uint04 index, uint04 sub_index) const
375 {
376 t_class value;
377 get(index, sub_index, value);
378 return value;
379 }
380 template<uint01 t_dims, class t_type>
381 void getVector(uint04 index, Vector<t_dims, t_type>& value) const
382 {
383 for (uint01 i = 0; i < t_dims; i++)
384 get(index, i, value[i]);
385 }
386 template<class t_type>
387 void insert(uint04 index, const t_type& value)
388 {
389 insert(index);
390 set(index, value);
391 }
392
393 virtual void setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn& from_column)
394 {
395 switch (type().vector_size)
396 {
397 case 0:
398 case 1:
399 {
400 if (type().is_string)
401 setAll<String>(to_location, from_location, size, from_column);
402 else
403 _setAll<1>(to_location, from_location, size, from_column);
404 } break;
405
406 case 2: _setAll<2>(to_location, from_location, size, from_column); break;
407 case 3: _setAll<3>(to_location, from_location, size, from_column); break;
408 case 4: _setAll<4>(to_location, from_location, size, from_column); break;
409 case 16: _setAll<16>(to_location, from_location, size, from_column); break;
410 default: setAll<String>(to_location, from_location, size, from_column); break;
411 }
412 };
413
414 template<class t_type>
415 void setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn& from_column)
416 {
417 bool can_copy = ObjectInfo<t_type>::Primitive;
418 can_copy &= !ObjectInfo<t_type>::Boolean;
419 can_copy &= type() == GetTypeInfo<t_type>();
420 can_copy &= from_column.type() == type();
421 can_copy &= begin() != nullptr;
422 can_copy &= from_column.begin() != nullptr;
423 if(can_copy)
424 {
425 memmove(
426 (uint01*)(begin()) + to_location * sizeof(t_type)
427 , (uint01*)(from_column.begin()) + from_location * sizeof(t_type)
428 , size * sizeof(t_type));
429 }
430 else
431 {
432 for (uint04 i = 0; i < size; i++)
433 {
434 set(to_location + i, from_column.get<t_type>(from_location + i));
435 }
436 }
437 }
438 virtual TableColumn* getSelected(const Buffer<bool>& selected_indices) const = 0;
439 virtual void insertRows(uint04 location, uint04 size) = 0;
440 virtual void addRow() { insertRows(size(), 1); }
441 virtual void insertIndices(uint04 location, uint04 size) = 0;
442 virtual void removeIndices(uint04 location, uint04 size) = 0;
443 virtual void removeIndices(const Buffer<uint04>& offset_lookup_list) = 0;
444 virtual void removeRows(uint04 offset, const Buffer<bool>& indices) = 0;
445
447 {
448 return m_modified_time;
449 }
451 {
452 m_modified_time = Time(0);
453 m_changes.clear();
454 }
456 {
457 update(TableChange(TableChange::e_update, 0, size()));
458 }
459
460 virtual void updateFrom(const TableColumn& column);
461
462 void update(const TableChange& change);
463
464 virtual void copyRow(uint04 source, uint04 destination) = 0;
465 virtual void copyRows(uint04 source, uint04 destination, uint04 size) = 0;
466
467 template<class t_type>
468 void setDefaultValue(const t_type& value)
469 {
470 set(Constant<uint04>::NaN, value);
471 }
472 template<class t_type>
473 t_type getDefaultValue() const
474 {
475 return get<t_type>(Constant<uint04>::NaN);
476 }
478 {
479 return m_changes;
480 }
481 template<class t_type>
483 {
484 Buffer<t_type> values(size);
485 values.setSize(size);
486 if (GetTypeInfo<t_type>() == type())
487 {
488 memcpy(values.begin(), ((const t_type*)begin()) + start, size * sizeof(t_type));
489 }
490 else
491 {
492 for (uint04 i = 0; i < size; ++i)
493 get(i + start, values[i]);
494 }
495 return values;
496 }
497
498 Buffer<TableChange> changesSince(const Time& time) const;
499 Buffer<TableChange> changesSince(const Time& time, const Bounds<1, uint04>& range) const;
500 bool hasChangesSince(const Time& time, const Bounds<1, uint04>& range) const;
501 virtual uint04 size() const = 0;
502 virtual void* begin() = 0;
503 virtual void* end() = 0;
504
505 virtual const void* begin() const = 0;
506 virtual const void* end() const = 0;
507 BinaryCompressionObject& compressionObject() { return m_compression_object; }
508 bool compressionValid() const { return m_compression_valid; }
509 protected:
510 template<uint01 t_dims>
511 void _setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn& from_column)
512 {
513 if constexpr (t_dims == 1)
514 {
515 if (type().is_number)
516 {
517 if (type().is_float)
518 {
519 if (type().byte_size == 4)
520 setAll<fltp04>(to_location, from_location, size, from_column);
521 if (type().byte_size == 8)
522 setAll<fltp08>(to_location, from_location, size, from_column);
523 }
524 else if (type().is_unsigned)
525 {
526 if (type().byte_size == 1)
527 setAll<uint01>(to_location, from_location, size, from_column);
528 if (type().byte_size == 2)
529 setAll<uint02>(to_location, from_location, size, from_column);
530 if (type().byte_size == 4)
531 setAll<uint04>(to_location, from_location, size, from_column);
532 if (type().byte_size == 8)
533 setAll<uint08>(to_location, from_location, size, from_column);
534 }
535 else
536 {
537 if (type().byte_size == 1)
538 setAll<sint01>(to_location, from_location, size, from_column);
539 if (type().byte_size == 2)
540 setAll<sint02>(to_location, from_location, size, from_column);
541 if (type().byte_size == 4)
542 setAll<sint04>(to_location, from_location, size, from_column);
543 if (type().byte_size == 8)
544 setAll<sint08>(to_location, from_location, size, from_column);
545 }
546 }
547 else
548 {
549 lib_assert(false, "Table copy type not supported");
550 }
551 }
552 else
553 {
554 if (type().is_number)
555 {
556 if (type().is_float)
557 {
558 if (type().byte_size == 4)
559 setAll<Vector<t_dims, fltp04>>(to_location, from_location, size, from_column);
560 if (type().byte_size == 8)
561 setAll<Vector<t_dims, fltp08>>(to_location, from_location, size, from_column);
562 }
563 else if (type().is_unsigned)
564 {
565 if (type().byte_size == 1)
566 setAll<Vector<t_dims, uint01>>(to_location, from_location, size, from_column);
567 if (type().byte_size == 2)
568 setAll<Vector<t_dims, uint02>>(to_location, from_location, size, from_column);
569 if (type().byte_size == 4)
570 setAll<Vector<t_dims, uint04>>(to_location, from_location, size, from_column);
571 if (type().byte_size == 8)
572 setAll<Vector<t_dims, uint08>>(to_location, from_location, size, from_column);
573 }
574 else
575 {
576 if (type().byte_size == 1)
577 setAll<Vector<t_dims, sint01>>(to_location, from_location, size, from_column);
578 if (type().byte_size == 2)
579 setAll<Vector<t_dims, sint02>>(to_location, from_location, size, from_column);
580 if (type().byte_size == 4)
581 setAll<Vector<t_dims, sint04>>(to_location, from_location, size, from_column);
582 if (type().byte_size == 8)
583 setAll<Vector<t_dims, sint08>>(to_location, from_location, size, from_column);
584 }
585 }
586 else if (type().is_color)
587 {
588 setAll<RGBColor>(to_location, from_location, size, from_column);
589 }
590 else
591 {
592 lib_assert(false, "Table copy type not supported");
593 }
594 }
595 };
596 virtual uint08 tableHash() const
597 {
598 uint08 result = 2166136261U;
599 uint01* start = (uint01*)begin();
600 uint01* stop = (uint01*)end();
601 for (uint01* c = start; c < stop; c++)
602 result = (127 * result) ^ *c;
603 return result;
604 }
605 protected:
612 CompressionMode m_compression_mode = CompressionMode::e_default_compression;
614 };
615}
#define NDEVR_DATABASE_API
Definition DLLInfo.h:71
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
Definition BinaryFile.h:51
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:68
uint01 bits() const
Definition BitFlag.hpp:371
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:57
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
void setSize(t_index_type new_size)
Definition Buffer.hpp:1413
decltype(auto) begin()
Definition Buffer.hpp:504
Definition File.h:47
Definition Matrix.hpp:173
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
Definition String.h:40
Definition TableColumn.h:68
virtual void get(uint04 index, uint04 vector_pos, uint01 &value) const =0
t_type getDefaultValue() const
Definition TableColumn.h:473
void updateAll()
Definition TableColumn.h:455
virtual void removeIndices(const Buffer< uint04 > &offset_lookup_list)=0
String m_label
Definition TableColumn.h:608
virtual void get(uint04 index, uint04 vector_pos, sint04 &value) const =0
void insert(uint04 index, const t_type &value)
Definition TableColumn.h:387
virtual uint04 getRowSize(uint04) const
Definition TableColumn.h:77
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:342
Buffer< t_type > getAll(uint04 start, uint04 size) const
Definition TableColumn.h:482
void setVector(uint04 index, const Vector< t_dims, t_type > &value)
Definition TableColumn.h:213
std::enable_if< ObjectInfo< t_class >::Enum >::type get(uint04 index, t_class &enum_value) const
Definition TableColumn.h:246
virtual void set(uint04 index, uint04 vector_pos, fltp04 value)=0
virtual void removeRows(uint04 index, uint04 size)=0
virtual void addRow()
Definition TableColumn.h:440
virtual void * end()=0
void get(uint04 index, Bounds< t_dims, t_type > &bounds) const
Definition TableColumn.h:351
virtual TableColumn * getSelected(const Buffer< bool > &selected_indices) const =0
virtual void get(uint04 index, UUID &vector) const
Definition TableColumn.h:322
virtual bool beginsWith(uint04 index, const String &value, bool ignore_case) const =0
BinaryCompressionObject & compressionObject()
Definition TableColumn.h:507
virtual bool contains(uint04 index, const char *value, bool ignore_case) const =0
virtual void set(uint04 index, sint01 value)=0
void set(uint04 index, const Bounds< t_dims, t_type > &value)
Definition TableColumn.h:159
bool m_compression_valid
Definition TableColumn.h:613
void set(t_type *values, uint04 start_index, uint04 size)
Definition TableColumn.h:201
virtual void get(uint04 index, uint08 &value) const =0
virtual bool isSame(uint04 index, const String &value) const =0
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:367
virtual void get(uint04 index, uint04 vector_pos, uint08 &value) const =0
void _setAll(uint04 to_location, uint04 from_location, uint04 size, const TableColumn &from_column)
Definition TableColumn.h:511
virtual void get(uint04 index, uint04 vector_pos, sint02 &value) const =0
TypeInfo m_type
Definition TableColumn.h:609
void get(uint04 index, TranslatedString &string) const
Definition TableColumn.h:335
virtual void compressIfNeeded(BinaryCompressionObject &object)
Definition TableColumn.h:111
Time m_modified_time
Definition TableColumn.h:607
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:168
virtual void insertIndices(uint04 location, uint04 size)=0
virtual void set(uint04 index, uint01 value)=0
void setDefaultValue(const t_type &value)
Definition TableColumn.h:468
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:308
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:241
virtual void compress(BinaryCompressionObject &object)=0
virtual void get(uint04 index, String &value) const =0
const Buffer< TableChange > & changes() const
Definition TableColumn.h:477
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:194
virtual void set(uint04 index, uint04 vector_pos, sint04 value)=0
void clearUpdates()
Definition TableColumn.h:450
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:374
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:359
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 get(uint04 index, BitFlag &bitflag) const
Definition TableColumn.h:233
uint04 getIndexOf(const t_type &object) const
Definition TableColumn.h:255
virtual void get(uint04 index, sint08 &value) const =0
void set(uint04 index, const BitFlag &bitflag)
Definition TableColumn.h:189
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:149
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:415
virtual uint08 tableHash() const
Definition TableColumn.h:596
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:393
virtual void set(uint04 index, uint04 vector_pos, uint08 value)=0
void setCompressionMode(CompressionMode compression_mode)
Definition TableColumn.h:264
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:606
uint08 m_compression_hash
Definition TableColumn.h:610
virtual void insert(uint04 index)=0
std::enable_if< IsVec< t_class >::value >::type set(uint04 index, const t_class &value)
Definition TableColumn.h:176
virtual void copyRow(uint04 source, uint04 destination)=0
virtual void get(uint04 index, uint04 vector_pos, sint01 &value) const =0
virtual TypeInfo type() const
Definition TableColumn.h:78
virtual void get(uint04 index, uint04 vector_pos, uint02 &value) const =0
virtual void setRowSize(uint04, uint04)
Definition TableColumn.h:76
void get(uint04 index, Time &time) const
Definition TableColumn.h:328
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 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:228
void getVector(uint04 index, Vector< t_dims, t_type > &value) const
Definition TableColumn.h:381
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:446
virtual void set(uint04 index, bool value)=0
void updateCompressionInfo(BinaryCompressionObject &object)
Definition TableColumn.h:135
Buffer< TableChange > m_changes
Definition TableColumn.h:611
virtual void get(uint04 index, uint04 vector_pos, sint08 &value) const =0
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:184
void get(uint04 index, File &file) const
Definition TableColumn.h:315
virtual const void * begin() const =0
bool compressionValid() const
Definition TableColumn.h:508
virtual void set(uint04 index, uint04 vector_pos, sint08 value)=0
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition TranslatedString.h:9
Definition Triangle.hpp:143
Definition TypeInfo.h:39
Definition UUID.h:66
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
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:76
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
Definition BaseValues.hpp:86
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:157
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
int8_t sint01
-Defines an alias representing a 1 byte, signed integer. -Can represent exact integer values -127 thr...
Definition BaseValues.hpp:56
CompressionMode
Definition Compressor.h:12
int16_t sint02
-Defines an alias representing a 2 byte, signed integer. -Can represent exact integer values -32767 t...
Definition BaseValues.hpp:66
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer -Can represent exact integer values 0 thro...
Definition BaseValues.hpp:132
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:109
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator.
Definition BaseFunctions.hpp:67
Definition Compressor.h:38
Definition BaseValues.hpp:272
Definition Vector.hpp:828
Information about the object.
Definition ObjectInfo.h:56
Definition TableColumn.h:49
TableChange(TableChangeType type, uint04 start, uint04 size, Time time=Time::SystemTime())
Definition TableColumn.h:56
uint04 size
Definition TableColumn.h:64
uint04 start
Definition TableColumn.h:63
TableChangeType
Definition TableColumn.h:51
TableChangeType type
Definition TableColumn.h:65
Time time
Definition TableColumn.h:62