NDEVR
API Documentation
TableColumnType.h
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: TableColumnType
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#if __clang__
34 #pragma clang diagnostic push
35 #pragma clang diagnostic ignored "-Woverloaded-virtual"
36#endif
37#include "DLLInfo.h"
38#include <NDEVR/TableColumn.h>
39#include <NDEVR/RGBColor.h>
40#include <NDEVR/Matrix.h>
41#include <NDEVR/Bounds.h>
42#include <NDEVR/TypeInfo.h>
43#include <NDEVR/BinaryFile.h>
44#include <NDEVR/String.h>
45#include <NDEVR/Compressor.h>
46#include "BinaryFileTableInfo.h"
47namespace NDEVR
48{
55 template<class t_type>
64 };
65
70 template<class t_buffer_type>
71 struct DefaultSetter<Buffer<t_buffer_type>> {
77 {
78 lib_assert(false, "not yet implemented");
79 //a.setDefaultValue(b.getDefaultValue<StringView>());
80 }
81 };
82
87 template<>
96 };
97
102 template<class t_type>
104 {
105 public:
108 virtual TypeInfo type() const override
109 {
110 return GetTypeInfo<t_type>();
111 }
112
114 virtual void setDefaultValue(const StringAllocatingView& value) override
115 {
116 m_default_value = value.getAs<t_type>();
117 }
118
121 {
122 return StringAllocatingView::Allocate(m_default_value);
123 }
124
128 , m_default_value(Constant<t_type>::Invalid)
129 {
130 }
131
134 TableColumnBuffer(const StringView& label, const t_type& default_value)
136 , m_default_value(default_value)
137 {
138 }
139
144 , m_default_value(Constant<t_type>::Invalid)
145 , m_buffer(buffer)
146 {}
147
150 virtual void swap(uint04 a, uint04 b) override
151 {
152 m_buffer.swapIndices(a, b);
153 }
154
157 [[nodiscard]] inline decltype(auto) operator[](const uint04 index)
158 {
159 return m_buffer[index];
160 }
161
164 [[nodiscard]] inline decltype(auto) operator[](const uint04 index) const
165 {
166 return m_buffer[index];
167 }
168
171 void set(uint04 index, const t_type& value)
172 {
173 m_buffer[index] = value;
174 }
175
181 {
182 if (!m_has_been_read)
183 return;
184 m_has_been_read = false;
185 if (file.version_number < 1762047417)
186 {
187 if (file.version_number > 1539350691)
188 m_default_value = m_buffer[0];//default was front
189 m_buffer.removeIndex(0);
190 }
191 else
192 {
193 m_default_value = m_buffer.last();
194 m_buffer.removeLast();
195 }
196 }
197
203 virtual void mapFromFile(BinaryFileTableInfo& file) override
204 {
205 if (file.version_number <= 1539350691)//versions <= 1539350691 had error in default value, so ignore
206 {
207 file.file.seek(file.file.position() + sizeof(t_type));
208 file.file.readNow(m_buffer);
209 }
210 else if (file.version_number <= 1613942093)
211 {
212 Buffer<t_type> default_value_buffer;
213 file.file.readNow(default_value_buffer);
214 lib_assert(default_value_buffer.size() == 1, "Bad buffer read");
215 file.file.readNow(m_buffer);
216 m_default_value = default_value_buffer[0];
217 }
218 else
219 {
220 file.file.read(m_buffer);
221 m_has_been_read = true;
222 }
223 }
224
229 void setSize(uint04 size) override
230 {
231 uint04 old_size = m_buffer.size();
232 if (old_size < size)
233 {
234 m_buffer.template addSpace<true>(1 + size - old_size);
235 m_buffer.setAllToValue(defaultValue(), old_size, size - old_size);
236 m_buffer.removeLast();//size confirmed
237 }
238 else
239 {
240 m_buffer.setSize(size);
241 }
242 }
243
245 virtual void setDefaultValueFrom(const TableColumn& column) override
246 {
248 }
249 public:
252 void insert(uint04 index) override
253 {
254 m_buffer.template addSpace<true>(index, 1U);
255 m_buffer[index] = defaultValue();
256 }
257
259 virtual void resetRow(uint04 row) override
260 {
262 }
263
266 virtual void copyRow(uint04 source, uint04 destination) override
267 {
268 m_buffer[destination] = m_buffer[source];
269 }
270
276 virtual void copyRows(uint04 source, uint04 destination, uint04 size) override
277 {
278 if (destination < source)//prevent overlap
279 {
280 for (uint04 i = 0; i < size; i++)
281 m_buffer[destination + i] = m_buffer[source + i];
282 }
283 else
284 {
285 for (uint04 i = size - 1; IsValid(i); i--)
286 m_buffer[destination + i] = m_buffer[source + i];
287 }
288 }
289
291 void removeRow(uint04 index) override
292 {
293 m_buffer.removeIndex(index);
294 }
295
298 virtual void removeRows(uint04 index, uint04 size) override
299 {
300 m_buffer.removeIndices(index, size);
301 }
302
306 virtual void removeRows(const Buffer<uint04>& sorted_remove_indices) override
307 {
308 if (sorted_remove_indices.size() == 0)
309 return;
310 uint04 current_position = 0;
311 uint04 current_remove_index = 0;
312 for (uint04 i = 0; i < m_buffer.size(); i++)
313 {
314 if (current_remove_index >= sorted_remove_indices.size() || i != sorted_remove_indices[current_remove_index])
315 {
316 m_buffer[current_position++] = m_buffer[i];
317 }
318 else
319 {
320 current_remove_index++;
321 }
322 }
323 lib_assert(current_remove_index == sorted_remove_indices.size(), "Unexpected end remove value");
324 m_buffer.setSize(current_position);
325 }
326
333 void removeRows(uint04 offset, const Buffer<bool>& indices) override
334 {
335 uint04 current_position = offset;
336 for (uint04 i = 0; i < indices.size(); i++)
337 {
338 if (!indices[i])
339 {
340 m_buffer[current_position] = m_buffer[offset + i];
341 current_position++;
342 }
343 }
344 uint04 removed_size = current_position;
345 for (uint04 i = offset + indices.size(); i < m_buffer.size(); i++)
346 {
347 m_buffer[current_position] = m_buffer[i];
348 current_position++;
349 }
350 m_buffer.setSize(m_buffer.size() - (indices.size() - (removed_size - offset)));
351 }
352
357 virtual void compress(BinaryCompressionObject& object) override
358 {
360 object.compression_mode = m_compression_mode;
361 m_buffer.add(defaultValue());
363 m_buffer.removeLast();
364 }
365
368 virtual void mapToFile(BinaryFileTableInfo& file, int compression) override
369 {
370 _mapToFile(file, cast<CompressionMode>(compression));
371 }
372
376 {
377 _mapToFile(file, object);
378 }
379
383 void* begin() override { lib_assert(!ObjectInfo<t_type>::Boolean, "Begin not supported for boolean"); return m_buffer.ptr(); }
386 void* end() override { return ((uint01*)m_buffer.ptr()) + m_buffer.memSize(); }
387
391 const void* begin() const override { lib_assert(!ObjectInfo<t_type>::Boolean, "Begin not supported for boolean"); return m_buffer.ptr(); }
394 const void* end() const override { return ((uint01*)m_buffer.ptr()) + m_buffer.memSize(); }
395
397 virtual void addRow() override
398 {
399 t_type value = defaultValue();
400 m_buffer.add(value);
401 }
402
406 virtual void insertRows(uint04 location, uint04 size) override
407 {
408 m_buffer.template addSpace<true>(location, size);
409 m_buffer.setAllToValue(defaultValue(), location, size);
410 }
411
415 [[nodiscard]] bool isSame(uint04 index, const StringView& value) const override { return value.getAs<t_type>() == pullValue(index); }
421 [[nodiscard]] bool contains(uint04 index, const StringView& value, bool ignore_case) const override { return String(pullValue(index)).hasSubString(value, ignore_case); }
427 [[nodiscard]] bool beginsWith(uint04 index, const StringView& value, bool ignore_case) const override { return String(pullValue(index)).beginsWith(value, ignore_case); }
430 uint04 size() const override { return m_buffer.size(); }
431 private:
438 void _mapToFile(BinaryFileTableInfo& file, CompressionMode compression)
439 {
440 m_buffer.add(defaultValue());//append default value to end
441 file.file.write(m_buffer, compression);
442 m_buffer.removeLast();
443 }
447 void _mapToFile(BinaryFileTableInfo& file, BinaryCompressionObject& object)
448 {
449 file.file.writeCompression(object);
450 }
451 protected:
455 decltype(auto) pullValue(uint04 index)
456 {
457 return m_buffer[index];
458 }
459
462 decltype(auto) pullValue(uint04 index) const
463 {
464 return m_buffer[index];
465 }
466
468 decltype(auto) defaultValue()
469 {
470 return m_default_value;
471 }
472
474 decltype(auto) defaultValue() const
475 {
476 return m_default_value;
477 }
481 bool m_has_been_read = false;
482 };
483
489 template<uint01 t_dims, class t_type>
490 class TableVectorType : public TableColumnBuffer<Vector<t_dims, t_type>>
491 {
492 public:
495 virtual TypeInfo type() const override
496 {
498 }
499
502 : TableColumnBuffer<Vector<t_dims, t_type>>(label)
503 {}
504
508 : TableColumnBuffer<Vector<t_dims, t_type>>(buffer, label)
509 {}
510 public:
513 virtual uint04 getRowSize(uint04) const override { return t_dims; };
514
517 virtual void set(uint04 index, uint04 vector_pos, bool value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
518 virtual void set(uint04 index, uint04 vector_pos, uint01 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
519 virtual void set(uint04 index, uint04 vector_pos, uint02 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
520 virtual void set(uint04 index, uint04 vector_pos, uint04 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
521 virtual void set(uint04 index, uint04 vector_pos, uint08 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
522 virtual void set(uint04 index, uint04 vector_pos, sint01 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
523 virtual void set(uint04 index, uint04 vector_pos, sint02 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
524 virtual void set(uint04 index, uint04 vector_pos, sint04 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
525 virtual void set(uint04 index, uint04 vector_pos, sint08 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
526 virtual void set(uint04 index, uint04 vector_pos, fltp04 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
527 virtual void set(uint04 index, uint04 vector_pos, fltp08 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = cast<t_type>(value); };
528
529 virtual void set(uint04 index, uint04 vector_pos, const StringView& value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)] = value.getAs<t_type>(); };
531
534 virtual void set(uint04 index, bool value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
535 virtual void set(uint04 index, uint01 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
536 virtual void set(uint04 index, uint02 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
537 virtual void set(uint04 index, uint04 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
538 virtual void set(uint04 index, uint08 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
539 virtual void set(uint04 index, sint01 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
540 virtual void set(uint04 index, sint02 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
541 virtual void set(uint04 index, sint04 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
542 virtual void set(uint04 index, sint08 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
543 virtual void set(uint04 index, fltp04 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
544 virtual void set(uint04 index, fltp08 value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = cast<t_type>(value); };
545 virtual void set(uint04 index, const StringView& value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = value.getAs<Vector<t_dims, t_type>>(); };
546 virtual void set(uint04 index, RGBColor value) override { TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index) = value.as<t_dims, t_type>(); };
548
551 virtual void get(uint04 index, uint04 vector_pos, bool& value) const override { value = cast<bool>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
552 virtual void get(uint04 index, uint04 vector_pos, uint01& value) const override { value = cast<uint01>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
553 virtual void get(uint04 index, uint04 vector_pos, uint02& value) const override { value = cast<uint02>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
554 virtual void get(uint04 index, uint04 vector_pos, uint04& value) const override { value = cast<uint04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
555 virtual void get(uint04 index, uint04 vector_pos, uint08& value) const override { value = cast<uint08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
556 virtual void get(uint04 index, uint04 vector_pos, sint01& value) const override { value = cast<sint01>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
557 virtual void get(uint04 index, uint04 vector_pos, sint02& value) const override { value = cast<sint02>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
558 virtual void get(uint04 index, uint04 vector_pos, sint04& value) const override { value = cast<sint04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
559 virtual void get(uint04 index, uint04 vector_pos, sint08& value) const override { value = cast<sint08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
560 virtual void get(uint04 index, uint04 vector_pos, fltp04& value) const override { value = cast<fltp04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
561 virtual void get(uint04 index, uint04 vector_pos, fltp08& value) const override { value = cast<fltp08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
562 virtual void get(uint04 index, uint04 vector_pos, StringAllocatingView& value) const override { value.allocate(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[cast<uint01>(vector_pos)]); };
564
568 virtual void get(uint04 index, bool& value) const override { if constexpr (t_dims == 1) value = cast<bool>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<bool>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
569 virtual void get(uint04 index, uint01& value) const override { if constexpr (t_dims == 1) value = cast<uint01>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<uint01>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
570 virtual void get(uint04 index, uint02& value) const override { if constexpr (t_dims == 1) value = cast<uint02>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<uint02>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
571 virtual void get(uint04 index, uint04& value) const override { if constexpr (t_dims == 1) value = cast<uint04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<uint04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
572 virtual void get(uint04 index, uint08& value) const override { if constexpr (t_dims == 1) value = cast<uint08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<uint08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
573 virtual void get(uint04 index, sint01& value) const override { if constexpr (t_dims == 1) value = cast<sint01>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<sint01>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
574 virtual void get(uint04 index, sint02& value) const override { if constexpr (t_dims == 1) value = cast<sint02>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<sint02>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
575 virtual void get(uint04 index, sint04& value) const override { if constexpr (t_dims == 1) value = cast<sint04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<sint04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
576 virtual void get(uint04 index, sint08& value) const override { if constexpr (t_dims == 1) value = cast<sint08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<sint08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
577 virtual void get(uint04 index, fltp04& value) const override { if constexpr (t_dims == 1) value = cast<fltp04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<fltp04>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
578 virtual void get(uint04 index, fltp08& value) const override { if constexpr (t_dims == 1) value = cast<fltp08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); else value = cast<fltp08>(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)[0]); };
579 virtual void get(uint04 index, StringAllocatingView& value) const override { value.allocate(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index)); };
581
582 virtual void get(uint04, StringView&) const override { lib_assert(false, "Cannot get String view"); }
584 virtual void get(uint04 index, RGBColor& value) const override { value = RGBColor(TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index).template as<4, t_type>()); };
585
587 void getVector(uint04 index, Vector<3, fltp04>& vector) const override
588 {
589 vector = TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index).template as<3, fltp04>();
590 }
591
592 void getVector(uint04 index, Vector<3, fltp08>& vector) const override
593 {
594 vector = TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index).template as<3, fltp08>();
595 }
596
597 void getVector(uint04 index, Vector<3, uint04>& vector) const override
598 {
599 vector = TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index).template as<3, uint04>();
600 }
601
602 void getVector(uint04 index, Vector<2, uint04>& vector) const override
603 {
604 vector = TableColumnBuffer<Vector<t_dims, t_type>>::pullValue(index).template as<2, uint04>();
605 }
606
607
610 uint08 tableHash() const override
611 {
612 uint08 result = 2166136261U;
613 std::hash<t_type> hash;
615 {
616 for (uint01 i = 0; i < t_dims; i++)
617 result = (127 * result) + hash(v[i]);
618 }
619 return result;
620 }
621
624 TableVectorType<t_dims, t_type>* getSelected(const Buffer<bool>& selected_indices) const override
625 {
627 new_vector_array->setSize(selected_indices.count(true));
628 uint04 current_index = 0;
629 for (uint04 i = 0; i < selected_indices.size(); i++)
630 {
631 if (selected_indices[i])
632 {
633 new_vector_array->m_buffer[current_index++] = TableColumnBuffer<Vector<t_dims, t_type>>::m_buffer[i];
634 }
635 }
636 return new_vector_array;
637 }
638
644 virtual void insertIndices(uint04 location, uint04 size) override
645 {
646 if (size == 0)
647 return;
649 for (uint04 i = 0; i < TableColumnBuffer<Vector<t_dims, t_type>>::m_buffer.size(); i++)
650 {
651 for (uint01 n = 0; n < t_dims; n++)
652 {
655 {
657 update_range.addToBounds(i);
658 }
659 }
660 }
661 if (update_range != Constant<Bounds<1, uint04>>::Min)
662 {
664 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
666 }
667 }
668
674 virtual void removeIndices(uint04 location, uint04 size) override
675 {
676 if (size == 0)
677 return;
679 for (uint04 i = 0; i < TableColumnBuffer<Vector<t_dims, t_type>>::m_buffer.size(); i++)
680 {
681 for (uint01 n = 0; n < t_dims; n++)
682 {
685 {
687 TableColumnBuffer<Vector<t_dims, t_type>>::m_buffer[i][n] = Constant<t_type>::Invalid;
688 else
690 update_range.addToBounds(i);
691 }
692 }
693 }
694 if (update_range != Constant<Bounds<1, uint04>>::Min)
695 {
697 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
699 }
700 }
701
708 virtual void swapIndices(uint04 a, uint04 b) override
709 {
710 for (uint04 i = 0; i < TableColumnBuffer<Vector<t_dims, t_type>>::m_buffer.size(); i++)
711 {
712 for (uint01 n = 0; n < t_dims; n++)
713 {
715 continue;
717 if (val == a)
719 else if (val == b)
721 }
722 }
723 }
724
729 virtual void removeIndices(const Buffer<uint04>& offset_lookup_list) override
730 {
732 for (uint04 i = 0; i < TableColumnBuffer<Vector<t_dims, t_type>>::m_buffer.size(); i++)
733 {
734 for (uint01 n = 0; n < t_dims; n++)
735 {
737 {
738 uint04 new_index = offset_lookup_list[cast<uint04>(TableColumnBuffer<Vector<t_dims, t_type>>::m_buffer[i][n])];
740 update_range.addToBounds(i);
741 }
742 }
743 }
744 if (update_range != Constant<Bounds<1, uint04>>::Min)
745 {
747 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
749 }
750 }
751
754 virtual void get(uint04 index, Bounds<3, fltp08>& b) const override
755 {
756 lib_assert(t_dims == 6, "Bounds can only be accessed from 6 dimension vectors");
757 if constexpr (std::is_same_v<fltp08, t_type>)
758 {
760 }
761 else
762 {
763 Bounds<3, t_type> bounds;
764 memcpy(&bounds, &TableVectorType<t_dims, t_type>::pullValue(index), sizeof(Bounds<3, t_type>));
765 b = bounds.template as<3, fltp08>();
766 }
767 }
768 virtual void get(uint04 index, Bounds<3, fltp04>& b) const override
769 {
770 lib_assert(t_dims == 6, "Bounds can only be accessed from 6 dimension vectors");
771 if constexpr (std::is_same_v<fltp04, t_type>)
772 {
774 }
775 else
776 {
777 Bounds<3, t_type> bounds;
778 memcpy(&bounds, &TableVectorType<t_dims, t_type>::pullValue(index), sizeof(Bounds<3, t_type>));
779 b = bounds.template as<3, fltp04>();
780 }
781 }
782
783 virtual void set(uint04 index, const Bounds<3, fltp08>& b) override
784 {
785 lib_assert(t_dims == 6, "Bounds can only be accessed from 6 dimension vectors");
786 if constexpr (std::is_same_v<fltp08, t_type>)
787 {
789 }
790 else
791 {
792 Bounds<3, t_type> bounds = b.as<3, t_type>();
793 memcpy(&TableVectorType<t_dims, t_type>::pullValue(index), &bounds, sizeof(Bounds<3, t_type>));
794 }
795 }
796
797 virtual void set(uint04 index, const Bounds<3, fltp04>& b) override
798 {
799 lib_assert(t_dims == 6, "Bounds can only be accessed from 6 dimension vectors");
800 if constexpr (std::is_same_v<fltp04, t_type>)
801 {
803 }
804 else
805 {
806 Bounds<3, t_type> bounds = b.as<3, t_type>();
807 memcpy(&TableVectorType<t_dims, t_type>::pullValue(index), &bounds, sizeof(Bounds<3, t_type>));
808 }
809 }
810
811 };
812
817 template<class t_type, uint01 t_cols, uint01 t_rows>
818 class TableMatrixType : public TableVectorType<t_cols * t_rows, t_type>
819 {
820 public:
821 using TableVectorType<t_cols* t_rows, t_type>::m_default_value;
825 : TableVectorType<t_cols* t_rows, t_type>(label)
826 {}
827 public:
831 void set(uint04 index, const StringView& value) override
832 {
835 };
836
839 void get(uint04 index, StringAllocatingView& value) const override
840 {
842 };
843
845 virtual void setDefaultValue(const StringAllocatingView& value) override
846 {
848 memcpy(&m_default_value, &mat, sizeof(Matrix<t_type, t_cols, t_rows>));
849 }
850
851 void get(uint04 index, StringView& value) const override
852 {
853 UNUSED(index);
854 UNUSED(value);
855 lib_assert(false, "Cannot get as string view");
856 };
857
861 virtual void get(uint04 index, Matrix<fltp08>& transform) const override
862 {
863 if constexpr (t_cols == 4 && t_rows == 4 && std::is_same_v<fltp08, t_type>)
864 {
866 }
867 else
868 {
871 transform = matrix.template as<fltp08, 4, 4>();
872 }
873 }
874 virtual void get(uint04 index, Matrix<fltp04>& transform) const override
875 {
876 if constexpr (t_cols == 4 && t_rows == 4 && std::is_same_v<fltp04, t_type>)
877 {
879 }
880 else
881 {
884 transform = matrix.template as<fltp04, 4, 4>();
885 }
886 }
887 virtual void set(uint04 index, const Matrix<fltp08>& transform) override
888 {
889 if constexpr (t_cols == 4 && t_rows == 4 && std::is_same_v<fltp08, t_type>)
890 {
892 }
893 else
894 {
895 Matrix<t_type, t_cols, t_rows> matrix = transform.as<t_type, t_cols, t_rows>();
897 }
898 }
899 virtual void set(uint04 index, const Matrix<fltp04>& transform) override
900 {
901 if constexpr (t_cols == 4 && t_rows == 4 && std::is_same_v<fltp04, t_type>)
902 {
904 }
905 else
906 {
907 Matrix<t_type, t_cols, t_rows> matrix = transform.as<t_type, t_cols, t_rows>();
909 }
910 }
911
912 };
913
918 template<class t_type>
919 class TableVectorType<1, t_type> : public TableColumnBuffer<t_type>
920 {
921 public:
924 virtual TypeInfo type() const override
925 {
926 return GetTypeInfo<t_type>();
927 }
928
933
937 : TableColumnBuffer<t_type>(buffer, label)
938 {}
939 public:
942 virtual uint04 getRowSize(uint04) const override { return 1; };
943
945 void set(uint04 index, uint04, bool value) override { TableColumnBuffer<t_type>::pullValue(index) = value; };
946 void set(uint04 index, uint04, uint01 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
947 void set(uint04 index, uint04, uint02 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
948 void set(uint04 index, uint04, uint04 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
949 void set(uint04 index, uint04, uint08 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
950 void set(uint04 index, uint04, sint01 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
951 void set(uint04 index, uint04, sint02 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
952 void set(uint04 index, uint04, sint04 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
953 void set(uint04 index, uint04, sint08 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
954 void set(uint04 index, uint04, fltp04 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
955 void set(uint04 index, uint04, fltp08 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
956
957 void set(uint04 index, uint04, const StringView& value) override { TableColumnBuffer<t_type>::pullValue(index) = value.getAs<t_type>(); };
959
961 void set(uint04 index, bool value) override { TableColumnBuffer<t_type>::pullValue(index) = value; };
962 void set(uint04 index, uint01 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
963 void set(uint04 index, uint02 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
964 void set(uint04 index, uint04 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
965 void set(uint04 index, uint08 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
966 void set(uint04 index, sint01 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
967 void set(uint04 index, sint02 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
968 void set(uint04 index, sint04 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
969 void set(uint04 index, sint08 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
970 void set(uint04 index, fltp04 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
971 void set(uint04 index, fltp08 value) override { TableColumnBuffer<t_type>::pullValue(index) = cast<t_type>(value); };
972 void set(uint04 index, const StringView& value) override { TableColumnBuffer<t_type>::pullValue(index) = value.getAs<t_type>(); };
973 void set(uint04, RGBColor) override { /*TableColumnBuffer<t_type>::pullValue(index) = value.getAs<Vector<t_dims, t_type>>();*/ };
975
977 void get(uint04 index, uint04, bool& value) const override { value = cast<bool>(TableColumnBuffer<t_type>::pullValue(index)); };
978 void get(uint04 index, uint04, uint01& value) const override { value = cast<uint01>(TableColumnBuffer<t_type>::pullValue(index)); };
979 void get(uint04 index, uint04, uint02& value) const override { value = cast<uint02>(TableColumnBuffer<t_type>::pullValue(index)); };
980 void get(uint04 index, uint04, uint04& value) const override { value = cast<uint04>(TableColumnBuffer<t_type>::pullValue(index)); };
981 void get(uint04 index, uint04, uint08& value) const override { value = cast<uint08>(TableColumnBuffer<t_type>::pullValue(index)); };
982 void get(uint04 index, uint04, sint01& value) const override { value = cast<sint01>(TableColumnBuffer<t_type>::pullValue(index)); };
983 void get(uint04 index, uint04, sint02& value) const override { value = cast<sint02>(TableColumnBuffer<t_type>::pullValue(index)); };
984 void get(uint04 index, uint04, sint04& value) const override { value = cast<sint04>(TableColumnBuffer<t_type>::pullValue(index)); };
985 void get(uint04 index, uint04, sint08& value) const override { value = cast<sint08>(TableColumnBuffer<t_type>::pullValue(index)); };
986 void get(uint04 index, uint04, fltp04& value) const override { value = cast<fltp04>(TableColumnBuffer<t_type>::pullValue(index)); };
987 void get(uint04 index, uint04, fltp08& value) const override { value = cast<fltp08>(TableColumnBuffer<t_type>::pullValue(index)); };
988 void get(uint04 index, uint04, StringAllocatingView& value) const override { value.allocate(TableColumnBuffer<t_type>::pullValue(index)); };
990
992 void get(uint04 index, bool& value) const override { value = TableColumnBuffer<t_type>::pullValue(index); };
993 void get(uint04 index, uint01& value) const override { value = cast<uint01>(TableColumnBuffer<t_type>::pullValue(index)); };
994 void get(uint04 index, uint02& value) const override { value = cast<uint02>(TableColumnBuffer<t_type>::pullValue(index)); };
995 void get(uint04 index, uint04& value) const override { value = cast<uint04>(TableColumnBuffer<t_type>::pullValue(index)); };
996 void get(uint04 index, uint08& value) const override { value = cast<uint08>(TableColumnBuffer<t_type>::pullValue(index)); };
997 void get(uint04 index, sint01& value) const override { value = cast<sint01>(TableColumnBuffer<t_type>::pullValue(index)); };
998 void get(uint04 index, sint02& value) const override { value = cast<sint02>(TableColumnBuffer<t_type>::pullValue(index)); };
999 void get(uint04 index, sint04& value) const override { value = cast<sint04>(TableColumnBuffer<t_type>::pullValue(index)); };
1000 void get(uint04 index, sint08& value) const override { value = cast<sint08>(TableColumnBuffer<t_type>::pullValue(index)); };
1001 void get(uint04 index, fltp04& value) const override { value = cast<fltp04>(TableColumnBuffer<t_type>::pullValue(index)); };
1002 void get(uint04 index, fltp08& value) const override { value = cast<fltp08>(TableColumnBuffer<t_type>::pullValue(index)); };
1003 void get(uint04 index, StringAllocatingView& value) const override { value.allocate(TableColumnBuffer<t_type>::pullValue(index)); };
1004 void get(uint04, StringView&) const override { lib_assert(false, "Cannot get as string view"); };
1005 void get(uint04, RGBColor&) const override { /*value = RGBColor(m_buffer[index].getAs<4, t_type>());*/ };
1007
1011 TableVectorType<1, t_type>* getSelected(const Buffer<bool>& selected_indices) const override
1012 {
1014 new_vector_array->setSize(selected_indices.count(true));
1015 uint04 current_index = 0;
1016 for (uint04 i = 0; i < selected_indices.size(); i++)
1017 {
1018 if (selected_indices[i])
1019 {
1020 new_vector_array->m_buffer[current_index++] = TableColumnBuffer<t_type>::m_buffer[i];
1021 }
1022 }
1023 return new_vector_array;
1024 }
1025
1028 virtual void insertIndices(uint04 location, uint04 size) override
1029 {
1030 this->template _insertIndices<t_type>(location, size);
1031 }
1032
1035 virtual void removeIndices(uint04 location, uint04 size) override
1036 {
1037 this->template _removeIndices<t_type>(location, size);
1038 }
1039
1041 virtual void removeIndices(const Buffer<uint04>& offset_lookup_list) override
1042 {
1043 this->template _removeIndices<t_type>(offset_lookup_list);
1044 }
1045
1048 virtual void swapIndices(uint04 a, uint04 b) override
1049 {
1050 this->template _swapIndices<t_type>(a, b);
1051 }
1052 private:
1055 template<class t_n_type>
1056 void _insertIndices(uint04 location, typename std::enable_if<ObjectInfo<t_n_type>::Number && ObjectInfo<t_n_type>::Dimensions < 16, uint04>::type size)
1057 {
1058 if (size == 0)
1059 return;
1060 Bounds<1, uint04> update_range = Constant<Bounds<1, uint04>>::Min;
1061 for (uint04 i = 0; i < TableColumnBuffer<t_type>::m_buffer.size(); i++)
1062 {
1064 uint04 value = cast<uint04>(it);
1065 if (value >= location && IsValid(value))
1066 {
1067 it += cast<t_type>(size);
1068 update_range.addToBounds(i);
1069 }
1070 }
1071 if (update_range != Constant<Bounds<1, uint04>>::Min)
1072 {
1074 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
1076 }
1077 }
1079 template<class t_n_type>
1080 void _insertIndices(uint04 location, typename std::enable_if<!ObjectInfo<t_n_type>::Number || ObjectInfo<t_n_type>::Dimensions >= 16, uint04>::type size) {
1081 UNUSED(location);
1082 UNUSED(size);
1083 };
1084
1087 template<class t_n_type>
1088 void _removeIndices(uint04 location, typename std::enable_if<ObjectInfo<t_n_type>::Number && ObjectInfo<t_n_type>::Dimensions < 16, uint04>::type size)
1089 {
1090 if (size == 0)
1091 return;
1092 Bounds<1, uint04> update_range = Constant<Bounds<1, uint04>>::Min;
1093 for (uint04 i = 0; i < TableColumnBuffer<t_type>::m_buffer.size(); i++)
1094 {
1096 {
1098 TableColumnBuffer<t_type>::m_buffer[i] = Constant<t_type>::Invalid;
1099 else
1101 update_range.addToBounds(i);
1102 }
1103 }
1104 if (update_range != Constant<Bounds<1, uint04>>::Min)
1105 {
1107 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
1109 }
1110 }
1112 template<class t_n_type>
1113 void _removeIndices(uint04 location, typename std::enable_if<!ObjectInfo<t_n_type>::Number || ObjectInfo<t_n_type>::Dimensions >= 16, uint04>::type size) {UNUSED(location); UNUSED(size); }
1114
1116 template<class t_n_type>
1117 void _removeIndices(typename std::enable_if<ObjectInfo<t_n_type>::Number, const Buffer<uint04>&>::type offset_lookup_list)
1118 {
1119 Bounds<1, uint04> update_range = Constant<Bounds<1, uint04>>::Min;
1120 for (uint04 i = 0; i < TableColumnBuffer<t_type>::m_buffer.size(); i++)
1121 {
1123 {
1124 uint04 value = offset_lookup_list[cast<uint04>(TableColumnBuffer<t_type>::m_buffer[i])];
1126 {
1128 update_range.addToBounds(i);
1129 }
1130 }
1131 }
1132 if (update_range != Constant<Bounds<1, uint04>>::Min)
1133 {
1135 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
1137 }
1138 }
1142 template<class t_n_type>
1143 void _swapIndices(typename std::enable_if<ObjectInfo<t_n_type>::Number, uint04>::type a, uint04 b)
1144 {
1145 for (uint04 i = 0; i < TableColumnBuffer<t_type>::m_buffer.size(); i++)
1146 {
1148 continue;
1150 if (val == a)
1152 else if (val == b)
1154 }
1155 }
1157 template<class t_n_type>
1158 void _swapIndices(typename std::enable_if<!ObjectInfo<t_n_type>::Number, uint04>::type a, uint04 b) { UNUSED(a); UNUSED(b);}
1160 template<class t_n_type>
1161 void _removeIndices(typename std::enable_if<!ObjectInfo<t_n_type>::Number, const Buffer<uint04>&>::type offset_lookup_list) {UNUSED(offset_lookup_list);}
1162 };
1163
1168 template<>
1169 class TableVectorType<1, UUID> : public TableVectorType<16, uint01>
1170 {
1171 public:
1177 public:
1180 void get(uint04, bool& value) const override { value = false; };
1181 void set(uint04 index, bool value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1182 void set(uint04 index, uint01 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1183 void set(uint04 index, uint02 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1184 void set(uint04 index, uint04 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1185 void set(uint04 index, uint08 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1186 void set(uint04 index, sint01 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1187 void set(uint04 index, sint02 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1188 void set(uint04 index, sint04 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1189 void set(uint04 index, sint08 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1190 void set(uint04 index, fltp04 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1191 void set(uint04 index, fltp08 value) override { TableVectorType<16, uint01>::pullValue(index) = UUID(0).appendUUID(value); };
1192 void set(uint04 index, RGBColor value) override { UNUSED(index); UNUSED(value); lib_assert(false, "cannot get as color");/*TableColumnBuffer<t_type>::pullValue(index) = value.getAs<Vector<t_dims, t_type>>();*/ };
1193 void set(uint04 index, const StringView& value) override { TableVectorType<16, uint01>::pullValue(index) = value.getAs<UUID>(); };
1194 void get(uint04 index, StringAllocatingView& value) const override { value.allocate(UUID(TableVectorType<16, uint01>::pullValue(index))); };
1195 void get(uint04, StringView&) const override { lib_assert(false, "cannot get as string view"); };
1197
1201 virtual void set(uint04 index, const UUID& value) final override
1202 {
1204 }
1205
1208 virtual void get(uint04 index, UUID& id) const final override
1209 {
1211 }
1212
1215 decltype(auto) pullValue(uint04 index)
1216 {
1217 return m_buffer[index];
1218 }
1219
1222 decltype(auto) pullValue(uint04 index) const
1223 {
1224 return m_buffer[index];
1225 }
1226 };
1227
1233 template<class t_type>
1234 class TableColumnTypeBuffer : public TableColumnBuffer<Buffer<t_type>>
1235 {
1236 public:
1239 virtual TypeInfo type() const override
1240 {
1242 }
1243
1248 public:
1250 void set(uint04 index, uint04 vector_pos, bool value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1251 void set(uint04 index, uint04 vector_pos, uint01 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1252 void set(uint04 index, uint04 vector_pos, uint02 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1253 void set(uint04 index, uint04 vector_pos, uint04 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1254 void set(uint04 index, uint04 vector_pos, uint08 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1255 void set(uint04 index, uint04 vector_pos, sint01 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1256 void set(uint04 index, uint04 vector_pos, sint02 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1257 void set(uint04 index, uint04 vector_pos, sint04 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1258 void set(uint04 index, uint04 vector_pos, sint08 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1259 void set(uint04 index, uint04 vector_pos, fltp04 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1260 void set(uint04 index, uint04 vector_pos, fltp08 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = cast<t_type>(value); };
1261 void set(uint04 index, uint04 vector_pos, const StringView& value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos] = value.getAs<t_type>(); };
1263
1265 void set(uint04 index, bool value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1266 void set(uint04 index, uint01 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1267 void set(uint04 index, uint02 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1268 void set(uint04 index, uint04 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1269 void set(uint04 index, uint08 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1270 void set(uint04 index, sint01 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1271 void set(uint04 index, sint02 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1272 void set(uint04 index, sint04 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1273 void set(uint04 index, sint08 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1274 void set(uint04 index, fltp04 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1275 void set(uint04 index, fltp08 value) override { TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(cast<t_type>(value)); };
1276 void set(uint04 index, const StringView& value) override { UNUSED(index); UNUSED(value);/*TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(value.getAs<Vector<t_dims, t_type>>());*/ };
1277 void set(uint04 index, RGBColor value) override { UNUSED(index); UNUSED(value);/*TableColumnBuffer<Buffer<t_type>>::pullValue(index).setAllToValue(value.getAs<t_dims, t_type>());*/ };
1279
1281 void get(uint04 index, uint04 vector_pos, bool& value) const override { value = cast<bool>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1282 void get(uint04 index, uint04 vector_pos, uint01& value) const override { value = cast<uint01>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1283 void get(uint04 index, uint04 vector_pos, uint02& value) const override { value = cast<uint02>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1284 void get(uint04 index, uint04 vector_pos, uint04& value) const override { value = cast<uint04>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1285 void get(uint04 index, uint04 vector_pos, uint08& value) const override { value = cast<uint08>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1286 void get(uint04 index, uint04 vector_pos, sint01& value) const override { value = cast<sint01>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1287 void get(uint04 index, uint04 vector_pos, sint02& value) const override { value = cast<sint02>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1288 void get(uint04 index, uint04 vector_pos, sint04& value) const override { value = cast<sint04>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1289 void get(uint04 index, uint04 vector_pos, sint08& value) const override { value = cast<sint08>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1290 void get(uint04 index, uint04 vector_pos, fltp04& value) const override { value = cast<fltp04>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1291 void get(uint04 index, uint04 vector_pos, fltp08& value) const override { value = cast<fltp08>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos]); };
1292 void get(uint04 index, uint04 vector_pos, StringAllocatingView& value) const override { value.allocate(cast<fltp08>(TableColumnBuffer<Buffer<t_type>>::pullValue(index)[vector_pos])); };
1294
1296 void get(uint04 index, bool& value) const override { value = cast<bool>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1297 void get(uint04 index, uint01& value) const override { value = cast<uint01>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1298 void get(uint04 index, uint02& value) const override { value = cast<uint02>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1299 void get(uint04 index, uint04& value) const override { value = cast<uint04>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1300 void get(uint04 index, uint08& value) const override { value = cast<uint08>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1301 void get(uint04 index, sint01& value) const override { value = cast<sint01>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1302 void get(uint04 index, sint02& value) const override { value = cast<sint02>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1303 void get(uint04 index, sint04& value) const override { value = cast<sint04>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1304 void get(uint04 index, sint08& value) const override { value = cast<sint08>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1305 void get(uint04 index, fltp04& value) const override { value = cast<fltp04>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1306 void get(uint04 index, fltp08& value) const override { value = cast<fltp08>(TableColumnBuffer<Buffer<t_type>>::pullValue(index).last()); };
1307 void get(uint04 index, StringAllocatingView& value) const override { lib_assert(false, "unimplemented"); UNUSED(index); UNUSED(value);/*value = String(TableColumnBuffer<Buffer<t_type>>::pullValue(index));*/ };
1308 void get(uint04 index, StringView& value) const override { lib_assert(false, "unimplemented"); UNUSED(index); UNUSED(value);/*value = String(TableColumnBuffer<Buffer<t_type>>::pullValue(index));*/ };
1309 void get(uint04 index, RGBColor& value) const override { lib_assert(false, "unimplemented"); UNUSED(index); UNUSED(value);/*value = RGBColor(m_buffer[index].last());*/ };
1311
1313 virtual void insertIndices(uint04 location, uint04 size) override
1314 {
1315 this->template _insertIndices<t_type>(location, size);
1316 }
1317
1318 virtual void removeIndices(uint04 location, uint04 size) override
1319 {
1320 this->template _removeIndices<t_type>(location, size);
1321 }
1322
1323 virtual void removeIndices(const Buffer<uint04>& offset_lookup_list) override
1324 {
1325 this->template _removeIndices<t_type>(offset_lookup_list);
1326 }
1327
1328 virtual void swapIndices(uint04 a, uint04 b) override
1329 {
1330 this->template _swapIndices<t_type>(a, b);
1331 }
1332
1334 uint08 tableHash() const override
1335 {
1336 uint08 result = 2166136261U;
1337 std::hash<t_type> hash;
1339 {
1340 for(uint04 i = 0; i < b.size(); i++)
1341 result = (127 * result) + hash(b[i]);
1342 }
1343 return result;
1344 }
1345
1348 uint04 getRowSize(uint04 index) const override { return TableColumnBuffer<Buffer<t_type>>::m_buffer[index].size(); };
1350 TableColumnTypeBuffer<t_type>* getSelected(const Buffer<bool>& selected_indices) const override { UNUSED(selected_indices); return nullptr; };
1351 private:
1353 template<class t_n_type>
1354 void _insertIndices(uint04 location, typename std::enable_if<ObjectInfo<t_n_type>::Number, uint04>::type size)
1355 {
1356 if (size == 0)
1357 return;
1358 Bounds<1, uint04> update_range = Constant<Bounds<1, uint04>>::Min;
1359 for (uint04 i = 0; i < TableColumnBuffer<Buffer<t_type>>::m_buffer.size(); i++)
1360 {
1361 for (uint04 n = 0; n < TableColumnBuffer<Buffer<t_type>>::m_buffer[i].size(); n++)
1362 {
1365 {
1367 update_range.addToBounds(i);
1368 }
1369 }
1370 }
1371 if (update_range != Constant<Bounds<1, uint04>>::Min)
1372 {
1374 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
1376 }
1377 }
1379 template<class t_n_type>
1380 void _insertIndices(uint04 location, typename std::enable_if<!ObjectInfo<t_n_type>::Number, uint04>::type size) { UNUSED(location); UNUSED(size); }
1381
1384 template<class t_n_type>
1385 void _removeIndices(uint04 location, typename std::enable_if<ObjectInfo<t_n_type>::Number, uint04>::type size)
1386 {
1387 if (size == 0)
1388 return;
1389 Bounds<1, uint04> update_range = Constant<Bounds<1, uint04>>::Min;
1390 for (uint04 i = 0; i < TableColumnBuffer<Buffer<t_type>>::m_buffer.size(); i++)
1391 {
1392 for (uint04 n = TableColumnBuffer<Buffer<t_type>>::m_buffer[i].size() - 1; IsValid(n); --n)
1393 {
1394 if (TableColumnBuffer<Buffer<t_type>>::m_buffer[i][n] >= cast<t_type>(location) && IsValid(TableColumnBuffer<Buffer<t_type>>::m_buffer[i][n]))
1395 {
1396 if (TableColumnBuffer<Buffer<t_type>>::m_buffer[i][n] < cast<t_type>(location + size))
1398 else
1400 update_range.addToBounds(i);
1401 }
1402 }
1403 }
1404 if (update_range != Constant<Bounds<1, uint04>>::Min)
1405 {
1407 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
1409 }
1410 }
1414 template<class t_n_type>
1415 void _swapIndices(typename std::enable_if<ObjectInfo<t_n_type>::Number, uint04>::type a, uint04 b)
1416 {
1417 for (uint04 i = 0; i < TableColumnBuffer<Buffer<t_type>>::m_buffer.size(); i++)
1418 {
1419 for (uint04 n = TableColumnBuffer<Buffer<t_type>>::m_buffer[i].size() - 1; IsValid(n); --n)
1420 {
1421 if (!IsValid(TableColumnBuffer<Buffer<t_type>>::m_buffer[i][n]))
1422 continue;
1423 uint04 val = cast<uint04>(TableColumnBuffer<Buffer<t_type>>::m_buffer[i][n]);
1424 if (val == a)
1426 else if (val == b)
1428 }
1429
1430 }
1431 }
1433 template<class t_n_type>
1434 void _removeIndices(uint04 location, typename std::enable_if<!ObjectInfo<t_n_type>::Number, uint04>::type size)
1435 {
1436 UNUSED(location);
1437 UNUSED(size);
1438 }
1439
1442 template<class t_n_type>
1443 void _removeIndices(typename std::enable_if<ObjectInfo<t_n_type>::Number, const Buffer<uint04>&>::type offset_lookup_list)
1444 {
1445 Bounds<1, uint04> update_range = Constant<Bounds<1, uint04>>::Min;
1446 for (uint04 i = 0; i < TableColumnBuffer<Buffer<t_type>>::m_buffer.size(); i++)
1447 {
1448 for (uint04 n = TableColumnBuffer<Buffer<t_type>>::m_buffer[i].size() - 1; IsValid(n); --n)
1449 {
1450 if (IsValid(TableColumnBuffer<Buffer<t_type>>::m_buffer[i][n]))
1451 {
1452 uint04 value = offset_lookup_list[cast<uint04>(TableColumnBuffer<Buffer<t_type>>::m_buffer[i][n])];
1453 if (IsInvalid(value))
1454 {
1456 update_range.addToBounds(i);
1457 }
1458 else if(TableColumnBuffer<Buffer<t_type>>::m_buffer[i][n] != cast<t_type>(value))
1459 {
1461 update_range.addToBounds(i);
1462 }
1463 }
1464 }
1465 }
1466 if (update_range != Constant<Bounds<1, uint04>>::Min)
1467 {
1469 TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
1471 }
1472 }
1474 template<class t_n_type>
1475 void _swapIndices(typename std::enable_if<!ObjectInfo<t_n_type>::Number, uint04>::type a, uint04 b)
1476 {
1477 UNUSED(a);
1478 UNUSED(b);
1479 }
1481 template<class t_n_type>
1482 void _removeIndices(typename std::enable_if<!ObjectInfo<t_n_type>::Number, const Buffer<uint04>&>::type offset_lookup_list)
1483 {
1484 UNUSED(offset_lookup_list);
1485 }
1486 };
1487
1493 class NDEVR_DATABASE_API TableColumnString : public TableColumnBuffer<String>
1494 {
1495 public:
1498 virtual TypeInfo type() const override
1499 {
1500 return GetTypeInfo<String>();
1501 }
1502
1507 public:
1509 void removeRows(uint04 offset, const Buffer<bool>& indices) override { UNUSED(offset); UNUSED(indices);};
1511 void set(uint04 index, uint04 vector_pos, bool value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1512 void set(uint04 index, uint04 vector_pos, uint01 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1513 void set(uint04 index, uint04 vector_pos, uint02 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1514 void set(uint04 index, uint04 vector_pos, uint04 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1515 void set(uint04 index, uint04 vector_pos, uint08 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1516 void set(uint04 index, uint04 vector_pos, sint01 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1517 void set(uint04 index, uint04 vector_pos, sint02 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1518 void set(uint04 index, uint04 vector_pos, sint04 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1519 void set(uint04 index, uint04 vector_pos, sint08 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1520 void set(uint04 index, uint04 vector_pos, fltp04 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1521 void set(uint04 index, uint04 vector_pos, fltp08 value) override { TableColumnBuffer<String>::pullValue(index).insert(vector_pos, String(value)); };
1522 void set(uint04, uint04, const StringView&) override { lib_assert(false, "Not implemented"); };
1524
1526 void set(uint04 index, bool value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1527 void set(uint04 index, uint01 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1528 void set(uint04 index, uint02 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1529 void set(uint04 index, uint04 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1530 void set(uint04 index, uint08 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1531 void set(uint04 index, sint01 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1532 void set(uint04 index, sint02 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1533 void set(uint04 index, sint04 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1534 void set(uint04 index, sint08 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1535 void set(uint04 index, fltp04 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1536 void set(uint04 index, fltp08 value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1537 void set(uint04 index, const StringView& value) override { TableColumnBuffer<String>::pullValue(index) = value; };
1538 void set(uint04 index, RGBColor value) override { TableColumnBuffer<String>::pullValue(index).setFrom(value); };
1540
1544 void get(uint04 index, uint04 vector_pos, bool& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<bool>(); };
1545 void get(uint04 index, uint04 vector_pos, uint01& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<uint01>(); };
1546 void get(uint04 index, uint04 vector_pos, uint02& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<uint02>(); };
1547 void get(uint04 index, uint04 vector_pos, uint04& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<uint04>(); };
1548 void get(uint04 index, uint04 vector_pos, uint08& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<uint08>(); };
1549 void get(uint04 index, uint04 vector_pos, sint01& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<sint01>(); };
1550 void get(uint04 index, uint04 vector_pos, sint02& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<sint02>(); };
1551 void get(uint04 index, uint04 vector_pos, sint04& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<sint04>(); };
1552 void get(uint04 index, uint04 vector_pos, sint08& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<sint08>(); };
1553 void get(uint04 index, uint04 vector_pos, fltp04& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<fltp04>(); };
1554 void get(uint04 index, uint04 vector_pos, fltp08& value) const override { value = String(&TableColumnBuffer<String>::pullValue(index)[vector_pos]).getAs<fltp08>(); };
1555 void get(uint04 index, uint04 vector_pos, StringAllocatingView& value) const override { value.allocate(String(&TableColumnBuffer<String>::pullValue(index)[vector_pos])); };
1557
1559 void get(uint04 index, bool& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<bool>(); };
1560 void get(uint04 index, uint01& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<uint01>(); };
1561 void get(uint04 index, uint02& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<uint02>(); };
1562 void get(uint04 index, uint04& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<uint04>(); };
1563 void get(uint04 index, uint08& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<uint08>(); };
1564 void get(uint04 index, sint01& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<sint01>(); };
1565 void get(uint04 index, sint02& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<sint02>(); };
1566 void get(uint04 index, sint04& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<sint04>(); };
1567 void get(uint04 index, sint08& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<sint08>(); };
1568 void get(uint04 index, fltp04& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<fltp04>(); };
1569 void get(uint04 index, fltp08& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<fltp08>(); };
1570 void get(uint04 index, StringAllocatingView& value) const override { value.reference(TableColumnBuffer<String>::pullValue(index)); };
1571 void get(uint04 index, StringView& value) const override { value = TableColumnBuffer<String>::pullValue(index); };
1572 void get(uint04 index, RGBColor& value) const override { value = TableColumnBuffer<String>::pullValue(index).getAs<RGBColor>(); };
1574
1576 TableColumnString* getSelected(const Buffer<bool>& selected_indices) const override { UNUSED(selected_indices); return nullptr; };
1582 virtual void insertIndices(uint04 location, uint04 size) override
1583 {
1584 Bounds<1, uint04> update_range = Constant<Bounds<1, uint04>>::Min;
1585 for (uint04 i = 0; i < m_buffer.size(); i++)
1586 {
1587 uint04 value = m_buffer[i].getAs<uint04>();
1588 if (IsValid(value) && value >= location)
1589 {
1590 m_buffer[i] = String(value + size);
1591 update_range.addToBounds(i);
1592 }
1593 }
1594 if (update_range != Constant<Bounds<1, uint04>>::Min)
1595 {
1596 m_changes.add(TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
1598 }
1599 }
1600
1602 uint08 tableHash() const override
1603 {
1604 uint08 result = 2166136261U;
1605 for (const String& s : m_buffer)
1606 result = (127 * result) ^ s.hash();
1607 return result;
1608 }
1609
1610 virtual void swapIndices(uint04, uint04) override
1611 {
1612 lib_assert(false, "Not implemented");
1613 }
1614
1619 virtual void removeIndices(uint04 location, uint04 size) override
1620 {
1621 if (size == 0)
1622 return;
1623 Bounds<1, uint04> update_range = Constant<Bounds<1, uint04>>::Min;
1624 for (uint04 i = 0; i < m_buffer.size(); i++)
1625 {
1626 uint04 value = m_buffer[i].getAs<uint04>();
1627 if (IsValid(value) && value > location)
1628 {
1629 if (value < location + size)
1630 m_buffer[i] = "NaN";
1631 else
1632 m_buffer[i] = String(value -= size);
1633 update_range.addToBounds(i);
1634 }
1635 }
1636 if (update_range != Constant<Bounds<1, uint04>>::Min)
1637 {
1638 m_changes.add(TableChange(TableChange::e_update, update_range[MIN], update_range.span()));
1640 }
1641 }
1642
1643 virtual void removeIndices(const Buffer<uint04>& offset_lookup_list) override
1644 {
1645 UNUSED(offset_lookup_list);
1646 lib_assert(false, "Not yet implemented");
1647 }
1648
1651 virtual void mapFromFile(BinaryFileTableInfo& file) override
1652 {
1653 if (file.version_number < 1614203273)
1654 {
1656 }
1657 else if (file.version_number < 1614739690)
1658 {
1659 bool allow_multithreading = false;
1660 file.file.readStringBuffer(m_buffer, allow_multithreading);
1661 }
1662 else
1663 {
1665 }
1666 }
1667
1668 void setRowSize(uint04 index, uint04 size) override { m_buffer[index].setSize(size); }
1670 [[nodiscard]] uint04 getRowSize(uint04 index) const override { return m_buffer[index].size(); }
1672 [[nodiscard]] bool isSame(uint04 index, const StringView& value) const override { return value == m_buffer[index];}
1674 [[nodiscard]] bool contains(uint04 index, const StringView& value, bool ignore_case) const final override { return pullValue(index).hasSubString(value, ignore_case); }
1676 [[nodiscard]] bool beginsWith(uint04 index, const StringView& value, bool ignore_case) const final override { return pullValue(index).beginsWith(value, ignore_case); }
1677 };
1678
1685 {
1686 public:
1689 virtual TypeInfo type() const override
1690 {
1691 return GetTypeInfo<RGBColor>();
1692 }
1693
1698
1702 : TableColumnBuffer<RGBColor>(buffer, label)
1703 {}
1704
1706 virtual void setDefaultValue(const StringAllocatingView& value) override
1707 {
1709 }
1710 public:
1713 void set(uint04 index, uint04 vector_pos, bool value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = value ? 255 : 0; TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1714 void set(uint04 index, uint04 vector_pos, uint01 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1715 void set(uint04 index, uint04 vector_pos, uint02 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1716 void set(uint04 index, uint04 vector_pos, uint04 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1717 void set(uint04 index, uint04 vector_pos, uint08 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1718 void set(uint04 index, uint04 vector_pos, sint01 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1719 void set(uint04 index, uint04 vector_pos, sint02 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1720 void set(uint04 index, uint04 vector_pos, sint04 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1721 void set(uint04 index, uint04 vector_pos, sint08 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1722 void set(uint04 index, uint04 vector_pos, fltp04 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value * 255); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1723 void set(uint04 index, uint04 vector_pos, fltp08 value) override { RGBColor color(TableColumnBuffer<RGBColor>::pullValue(index)); color[cast<uint01>(vector_pos)] = cast<uint01>(value * 255); TableColumnBuffer<RGBColor>::pullValue(index) = color; };
1724 void set(uint04 index, uint04 vector_pos, const StringView& value) override { set(index, vector_pos, value.getAs<uint01>()); };
1726
1729 void set(uint04 index, bool value) override { TableColumnBuffer<RGBColor>::pullValue(index) = value ? RGBColor(255, 255, 255) : RGBColor(0, 0, 0); };
1730 void set(uint04 index, uint02 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(value); };
1731 void set(uint04 index, uint01 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(cast<uint04>(value)); };
1732 void set(uint04 index, sint02 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(value); };
1733 void set(uint04 index, sint01 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(cast<uint04>(value)); };
1734 void set(uint04 index, uint04 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(value); };
1735 void set(uint04 index, uint08 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(cast<uint04>(value)); };
1736 void set(uint04 index, sint04 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(cast<uint04>(value)); };
1737 void set(uint04 index, sint08 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(cast<uint04>(value)); };
1738 void set(uint04 index, fltp04 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(value, value, value); };
1739 void set(uint04 index, fltp08 value) override { TableColumnBuffer<RGBColor>::pullValue(index) = RGBColor(value, value, value); };
1740 void set(uint04 index, const StringView& value) override { TableColumnBuffer<RGBColor>::pullValue(index) = value.getAs<RGBColor>(); };
1741 void set(uint04 index, RGBColor value) override { TableColumnBuffer<RGBColor>::pullValue(index) = value; };
1743
1746 void get(uint04 index, uint04 vector_pos, bool& value) const override { value = cast<bool>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1747 void get(uint04 index, uint04 vector_pos, uint01& value) const override { value = cast<uint01>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1748 void get(uint04 index, uint04 vector_pos, uint02& value) const override { value = cast<uint02>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1749 void get(uint04 index, uint04 vector_pos, uint04& value) const override { value = cast<uint04>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1750 void get(uint04 index, uint04 vector_pos, uint08& value) const override { value = cast<uint08>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1751 void get(uint04 index, uint04 vector_pos, sint01& value) const override { value = cast<sint01>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1752 void get(uint04 index, uint04 vector_pos, sint02& value) const override { value = cast<sint02>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1753 void get(uint04 index, uint04 vector_pos, sint04& value) const override { value = cast<sint04>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1754 void get(uint04 index, uint04 vector_pos, sint08& value) const override { value = cast<sint08>(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1755 void get(uint04 index, uint04 vector_pos, fltp04& value) const override { value = TableColumnBuffer<RGBColor>::pullValue(index).getF(cast<uint01>(vector_pos)); };
1756 void get(uint04 index, uint04 vector_pos, fltp08& value) const override { value = TableColumnBuffer<RGBColor>::pullValue(index).getF(cast<uint01>(vector_pos)); };
1757 void get(uint04 index, uint04 vector_pos, StringAllocatingView& value) const override { value.allocate(TableColumnBuffer<RGBColor>::pullValue(index)[cast<uint01>(vector_pos)]); };
1759
1764 void get(uint04 index, bool& value) const override { value = TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor() == 0; };
1765 void get(uint04 index, sint01& value) const override { value = cast<sint01>(TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor()); lib_assert(false, "unexpected conversion"); };
1766 void get(uint04 index, sint02& value) const override { value = cast<sint02>(TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor()); lib_assert(false, "unexpected conversion"); };
1767 void get(uint04 index, uint01& value) const override { value = cast<uint01>(TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor()); lib_assert(false, "unexpected conversion"); };
1768 void get(uint04 index, uint02& value) const override { value = cast<uint02>(TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor()); lib_assert(false, "unexpected conversion"); };
1769 void get(uint04 index, uint04& value) const override { value = TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor(); };
1770 void get(uint04 index, uint08& value) const override { value = TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor(); };
1771 void get(uint04 index, sint04& value) const override { value = rcast<sint04>(TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor()); };
1772 void get(uint04 index, sint08& value) const override { value = cast<sint08>(TableColumnBuffer<RGBColor>::pullValue(index).convertToRGBA32BitColor()); };
1773 void get(uint04 index, fltp04& value) const override { value = TableColumnBuffer<RGBColor>::pullValue(index).luminance(); };
1774 void get(uint04 index, fltp08& value) const override { value = TableColumnBuffer<RGBColor>::pullValue(index).luminance(); };
1775 void get(uint04 index, StringAllocatingView& value) const override { value.allocate(TableColumnBuffer<RGBColor>::pullValue(index)); };
1776 void get(uint04, StringView&) const override { lib_assert(false, "Not implemented"); };
1777 void get(uint04 index, RGBColor& value) const override { value = TableColumnBuffer<RGBColor>::pullValue(index); };
1779
1781 void insertIndices(uint04, uint04) override { lib_assert(false, "Insert indices not implemented for color channel"); }
1783 void removeIndices(uint04, uint04) override { lib_assert(false, "Remove indices not implemented for color channel"); }
1785 void removeIndices(const Buffer<uint04>&) override { lib_assert(false, "Remove indices not implemented for color channel"); }
1787 virtual void swapIndices(uint04, uint04) override { lib_assert(false, "Not implemented for color channel"); }
1792 TableColumnColorType* getSelected(const Buffer<bool>& selected_indices) const override
1793 {
1795 new_vector_array->setSize(selected_indices.count(true));
1796 uint04 current_index = 0;
1797 for (uint04 i = 0; i < selected_indices.size(); i++)
1798 {
1799 if (selected_indices[i])
1800 {
1801 new_vector_array->m_buffer[current_index++] = TableColumnBuffer<RGBColor>::m_buffer[i];
1802 }
1803 }
1804 return new_vector_array;
1805 }
1806 };
1807
1808
1809 template<class T> struct ColumnTBase { using type = TableVectorType<1, T>; };
1810
1811 template<class T> struct ColumnTBase<Buffer<T>> { using type = TableColumnTypeBuffer<T>; };
1812 template<> struct ColumnTBase<Buffer<RGBColor>> { using type = TableColumnTypeBuffer<uint04>; };
1813
1814 template<uint01 t_dims, class T> struct ColumnTBase<Vector<t_dims, T>> { using type = TableVectorType<t_dims, T>; };
1815
1816 template<> struct ColumnTBase<String> { using type = TableColumnString; };
1817 template<> struct ColumnTBase<StringView> { using type = TableColumnString; };
1818 template<> struct ColumnTBase<TranslatedString> { using type = TableColumnString; };
1819
1820 template<> struct ColumnTBase<RGBColor> { using type = TableColumnColorType; };
1821 template<> struct ColumnTBase<Time> { using type = TableVectorType<1, uint08>; };
1822
1823 template<class T, uint01 t_cols, uint01 t_rows>
1824 struct ColumnTBase<Matrix<T, t_cols, t_rows>> { using type = TableMatrixType<T, t_cols, t_rows>; };
1825
1826 template<uint01 t_dims, class T>
1827 struct ColumnTBase<Bounds<t_dims, T>> { using type = TableVectorType<2 * t_dims, T>; };
1828
1829 template<> struct ColumnTBase<Vector<8, bool>> { using type = TableVectorType<1, uint01>; };
1830 template<> struct ColumnTBase<Vector<16, bool>> { using type = TableVectorType<1, uint02>; };
1831 template<> struct ColumnTBase<Vector<32, bool>> { using type = TableVectorType<1, uint04>; };
1832 template<> struct ColumnTBase<Vector<64, bool>> { using type = TableVectorType<1, uint08>; };
1833
1834 template<class T>
1835 using ColumnT = typename ColumnTBase<T>::type;
1836}
1837#if __clang__
1838 #pragma clang diagnostic pop
1839#endif
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:54
constexpr void addToBounds(const t_vertex &vector)
Definition Bounds.hpp:415
constexpr decltype(auto) as(t_new_type extra_fill_value=t_new_type(0)) const
Casts this object into an object of different dimension or precision.
Definition Bounds.hpp:236
constexpr Ray< t_dims, t_type > span() const
The side lengths of these bounds.
Definition Bounds.hpp:113
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
static std::enable_if<!ObjectInfo< t_type >::Buffer >::type Compress(BinaryCompressionObject &object, Buffer< uint01 > &compression_data, const Buffer< t_type, t_memory_manager > &data)
Compresses a buffer of non-buffer (flat) elements into the given compression object.
Definition Compressor.h:200
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:57
This class is like a string view, but may optionally store the data internally Useful if the return t...
Definition String.h:1278
The core String View class for the NDEVR API.
Definition StringView.h:58
t_type getAs() const
Converts a string into an object.
Definition StringView.h:125
The core String class for the NDEVR API.
Definition String.h:95
decltype(auto) getAs() const
Converts a string into an object.
Definition String.h:188
bool hasSubString(const StringView &sub_string, bool ignore_case=false, uint04 start_idx=0) const
Tests if this String contains the specified substring.
bool beginsWith(const StringView &s, bool ignore_case=false) const
Tests if this String starts with the specified prefix.
A base class for a Table column with N-number of rows held in a Buffer object.
TableColumnBuffer(const StringView &label, const t_type &default_value)
Constructs a TableColumnBuffer with the given label and explicit default value.
virtual void setDefaultValue(const StringAllocatingView &value) override
Sets the default value for new rows by parsing a string representation.
virtual void mapToFile(BinaryFileTableInfo &file, int compression) override
Writes the column data to a binary file with the given compression mode.
TableColumnBuffer(const Buffer< t_type > &buffer, const StringView &label)
Constructs a TableColumnBuffer from an existing buffer of data.
void set(uint04 index, const t_type &value)
Sets the value at the given row index.
void insert(uint04 index) override
Inserts a new row at the given index, initialized to the default value.
uint04 size() const override
Returns the number of rows in this column.
bool m_has_been_read
Whether data has been read from file and needs finalization.
void removeRow(uint04 index) override
Removes a single row at the given index.
virtual void addRow() override
Appends a new row initialized with the default value.
decltype(auto) defaultValue() const
Returns a const reference to the default value.
decltype(auto) pullValue(uint04 index) const
Returns a const reference to the value at the given row index.
void * end() override
Returns a pointer past the end of the raw data buffer.
virtual void removeRows(uint04 index, uint04 size) override
Removes a contiguous range of rows starting at the given index.
virtual void finishMapFromFile(BinaryFileTableInfo &file) override
Completes file deserialization by extracting the default value from the buffer.
void * begin() override
Returns a pointer to the beginning of the raw data buffer.
virtual void insertRows(uint04 location, uint04 size) override
Inserts multiple rows at the given location, each initialized to the default value.
virtual void copyRows(uint04 source, uint04 destination, uint04 size) override
Copies a contiguous range of rows from source to destination.
bool contains(uint04 index, const StringView &value, bool ignore_case) const override
Checks whether the string form of the value at the given row contains a substring.
const void * end() const override
Returns a const pointer past the end of the raw data buffer.
Buffer< uint01 > m_compressed_data
Temporary storage for compressed column data.
const void * begin() const override
Returns a const pointer to the beginning of the raw data buffer.
bool beginsWith(uint04 index, const StringView &value, bool ignore_case) const override
Checks whether the string form of the value at the given row begins with a prefix.
decltype(auto) pullValue(uint04 index)
Returns a reference to the value at the given row index.
virtual void swap(uint04 a, uint04 b) override
Swaps the values at two row indices.
void removeRows(uint04 offset, const Buffer< bool > &indices) override
Removes rows using a boolean mask starting at the given offset.
virtual void mapToFile(BinaryFileTableInfo &file, BinaryCompressionObject &object) override
Writes pre-compressed column data to a binary file.
virtual void mapFromFile(BinaryFileTableInfo &file) override
Reads the column data from a binary file, handling multiple version formats.
void setSize(uint04 size) override
Resizes the column to the specified number of rows.
const StringAllocatingView getDefaultValue() const override
Returns the default value as a string representation.
t_type m_default_value
The default value assigned to new rows.
bool isSame(uint04 index, const StringView &value) const override
Checks whether the value at the given row equals the provided string value.
Buffer< t_type > m_buffer
The underlying data buffer storing all row values.
virtual TypeInfo type() const override
Returns TypeInfo describing the stored element type t_type.
virtual void removeRows(const Buffer< uint04 > &sorted_remove_indices) override
Removes rows at the specified sorted indices.
decltype(auto) defaultValue()
Returns a reference to the default value.
TableColumnBuffer(const StringView &label)
Constructs a TableColumnBuffer with the given label and an invalid default value.
virtual void compress(BinaryCompressionObject &object) override
Compresses the column data into a binary compression object.
virtual void resetRow(uint04 row) override
Resets the specified row to the default value.
virtual void setDefaultValueFrom(const TableColumn &column) override
Copies the default value from another column into this one.
virtual void copyRow(uint04 source, uint04 destination) override
Copies the value from the source row to the destination row.
void set(uint04 index, uint04 vector_pos, sint04 value) override
Sets a sint04 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, uint08 value) override
Sets a uint08 value at a specific vector position within a row.
void get(uint04 index, uint08 &value) const override
Retrieves a uint08 value at the given row index.
void set(uint04 index, uint02 value) override
Sets a uint02 value at the given row index.
void set(uint04 index, uint04 vector_pos, sint02 value) override
Sets a sint02 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, sint08 value) override
Sets a sint08 value at a specific vector position within a row.
void set(uint04 index, RGBColor value) override
Sets an RGBColor value at the given row index.
void get(uint04 index, fltp08 &value) const override
Retrieves a fltp08 value at the given row index.
void get(uint04 index, RGBColor &value) const override
Retrieves an RGBColor value at the given row index.
virtual void setDefaultValue(const StringAllocatingView &value) override
Sets the default color value by parsing a string representation.
void set(uint04 index, uint04 vector_pos, bool value) override
Sets a single color channel at the given row and channel position. Float values are scaled from [0,...
void get(uint04 index, uint04 vector_pos, sint04 &value) const override
Retrieves a sint04 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, fltp04 value) override
Sets a fltp04 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, sint01 value) override
Sets a sint01 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, StringAllocatingView &value) const override
Retrieves a string value at a specific vector position within a row.
void get(uint04 index, sint02 &value) const override
Retrieves a sint02 value at the given row index.
void get(uint04 index, bool &value) const override
Gets a scalar value from the color at the given row.
TableColumnColorType * getSelected(const Buffer< bool > &selected_indices) const override
Creates a new column containing only the rows marked true in the selection mask.
void get(uint04 index, uint01 &value) const override
Retrieves a uint01 value at the given row index.
void get(uint04 index, sint08 &value) const override
Retrieves a sint08 value at the given row index.
virtual void swapIndices(uint04, uint04) override
Asserts; swap indices is not implemented for color columns.
void get(uint04 index, uint04 vector_pos, uint04 &value) const override
Retrieves a uint04 value at a specific vector position within a row.
void get(uint04 index, StringAllocatingView &value) const override
Retrieves a string value at the given row index as a StringAllocatingView.
void get(uint04 index, uint04 vector_pos, uint02 &value) const override
Retrieves a uint02 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, fltp08 value) override
Sets a fltp08 value at a specific vector position within a row.
TableColumnColorType(const StringView &label)
Constructs a TableColumnColorType with the given column label.
void get(uint04 index, uint04 vector_pos, uint01 &value) const override
Retrieves a uint01 value at a specific vector position within a row.
void set(uint04 index, sint08 value) override
Sets a sint08 value at the given row index.
void get(uint04 index, sint01 &value) const override
Retrieves a sint01 value at the given row index.
void get(uint04 index, uint04 vector_pos, fltp04 &value) const override
Retrieves a fltp04 value at a specific vector position within a row.
void get(uint04 index, uint04 &value) const override
Retrieves a uint04 value at the given row index.
void set(uint04 index, uint08 value) override
Sets a uint08 value at the given row index.
void set(uint04 index, sint02 value) override
Sets a sint02 value at the given row index.
void get(uint04 index, uint02 &value) const override
Retrieves a uint02 value at the given row index.
void get(uint04 index, uint04 vector_pos, sint02 &value) const override
Retrieves a sint02 value at a specific vector position within a row.
virtual TypeInfo type() const override
Returns TypeInfo describing the RGBColor type.
void removeIndices(uint04, uint04) override
Asserts; remove indices is not implemented for color columns.
void get(uint04 index, fltp04 &value) const override
Retrieves a fltp04 value at the given row index.
void set(uint04 index, uint04 vector_pos, uint01 value) override
Sets a uint01 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, fltp08 &value) const override
Retrieves a fltp08 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, sint01 &value) const override
Retrieves a sint01 value at a specific vector position within a row.
void set(uint04 index, uint04 value) override
Sets a uint04 value at the given row index.
void removeIndices(const Buffer< uint04 > &) override
Asserts; remove indices by lookup is not implemented for color columns.
void set(uint04 index, uint04 vector_pos, uint02 value) override
Sets a uint02 value at a specific vector position within a row.
TableColumnColorType(const Buffer< RGBColor > &buffer, const String &label)
Constructs a TableColumnColorType from a pre-populated buffer of colors.
void get(uint04 index, uint04 vector_pos, sint08 &value) const override
Retrieves a sint08 value at a specific vector position within a row.
void insertIndices(uint04, uint04) override
Asserts; insert indices is not implemented for color columns.
void get(uint04, StringView &) const override
Retrieves a string value at the given row index as a StringView.
void set(uint04 index, uint01 value) override
Sets a uint01 value at the given row index.
void set(uint04 index, sint01 value) override
Sets a sint01 value at the given row index.
void get(uint04 index, uint04 vector_pos, bool &value) const override
Gets a single color channel at the given row and channel position. Float overloads return normalized ...
void set(uint04 index, fltp04 value) override
Sets a fltp04 value at the given row index.
void set(uint04 index, bool value) override
Sets the entire color at the given row from various value types. Integer values are interpreted as pa...
void set(uint04 index, const StringView &value) override
Sets a string value at the given row index.
void get(uint04 index, sint04 &value) const override
Retrieves a sint04 value at the given row index.
void set(uint04 index, uint04 vector_pos, uint04 value) override
Sets a uint04 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, const StringView &value) override
Sets a string value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, uint08 &value) const override
Retrieves a uint08 value at a specific vector position within a row.
void set(uint04 index, sint04 value) override
Sets a sint04 value at the given row index.
void set(uint04 index, fltp08 value) override
Sets a fltp08 value at the given row index.
void set(uint04 index, uint04 vector_pos, sint02 value) override
Sets a sint02 value at a specific vector position within a row.
void get(uint04 index, bool &value) const override
Gets a value by parsing the entire string at the given row.
void get(uint04 index, uint04 vector_pos, uint04 &value) const override
Retrieves a uint04 value at a specific vector position within a row.
void set(uint04 index, uint08 value) override
Sets a uint08 value at the given row index.
void get(uint04 index, uint04 vector_pos, fltp08 &value) const override
Retrieves a fltp08 value at a specific vector position within a row.
virtual void removeIndices(const Buffer< uint04 > &offset_lookup_list) override
Asserts; lookup-table-based index removal is not yet implemented for strings.
void set(uint04 index, uint04 vector_pos, uint02 value) override
Sets a uint02 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, uint01 &value) const override
Retrieves a uint01 value at a specific vector position within a row.
void get(uint04 index, StringView &value) const override
Retrieves a string value at the given row index as a StringView.
void set(uint04 index, uint04 vector_pos, bool value) override
Inserts the string representation of a value at the given character position.
void setRowSize(uint04 index, uint04 size) override
Sets the character count of the string at the given row.
void get(uint04 index, uint08 &value) const override
Retrieves a uint08 value at the given row index.
void set(uint04 index, fltp04 value) override
Sets a fltp04 value at the given row index.
void set(uint04 index, uint04 vector_pos, uint08 value) override
Sets a uint08 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, fltp04 &value) const override
Retrieves a fltp04 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, uint08 &value) const override
Retrieves a uint08 value at a specific vector position within a row.
void get(uint04 index, StringAllocatingView &value) const override
Retrieves a string value at the given row index as a StringAllocatingView.
void get(uint04 index, uint04 &value) const override
Retrieves a uint04 value at the given row index.
bool beginsWith(uint04 index, const StringView &value, bool ignore_case) const final override
Checks if the string at the given row begins with the provided prefix.
uint08 tableHash() const override
Computes a hash of the entire string column using FNV-like hashing.
virtual TypeInfo type() const override
Returns TypeInfo describing the String type.
void get(uint04 index, uint04 vector_pos, sint01 &value) const override
Retrieves a sint01 value at a specific vector position within a row.
void set(uint04 index, sint02 value) override
Sets a sint02 value at the given row index.
void set(uint04 index, uint04 vector_pos, sint01 value) override
Sets a sint01 value at a specific vector position within a row.
bool contains(uint04 index, const StringView &value, bool ignore_case) const final override
Checks if the string at the given row contains the provided substring.
void get(uint04 index, fltp04 &value) const override
Retrieves a fltp04 value at the given row index.
void get(uint04 index, sint01 &value) const override
Retrieves a sint01 value at the given row index.
void set(uint04 index, uint02 value) override
Sets a uint02 value at the given row index.
void get(uint04 index, uint04 vector_pos, sint04 &value) const override
Retrieves a sint04 value at a specific vector position within a row.
void set(uint04 index, sint04 value) override
Sets a sint04 value at the given row index.
void set(uint04 index, uint04 vector_pos, uint04 value) override
Sets a uint04 value at a specific vector position within a row.
void set(uint04 index, RGBColor value) override
Sets an RGBColor value at the given row index.
void set(uint04 index, uint04 vector_pos, fltp04 value) override
Sets a fltp04 value at a specific vector position within a row.
TableColumnString * getSelected(const Buffer< bool > &selected_indices) const override
Creates a filtered copy; currently returns nullptr (unimplemented).
void set(uint04 index, sint01 value) override
Sets a sint01 value at the given row index.
virtual void mapFromFile(BinaryFileTableInfo &file) override
Reads the string column from a binary file, handling multiple version formats.
void set(uint04 index, uint04 value) override
Sets a uint04 value at the given row index.
void get(uint04 index, sint04 &value) const override
Retrieves a sint04 value at the given row index.
void set(uint04 index, bool value) override
Sets the entire string at the given row from a numeric or string value.
void get(uint04 index, fltp08 &value) const override
Retrieves a fltp08 value at the given row index.
void removeRows(uint04 offset, const Buffer< bool > &indices) override
No-op override for boolean-mask row removal (unimplemented for strings).
void set(uint04 index, uint04 vector_pos, sint08 value) override
Sets a sint08 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, sint08 &value) const override
Retrieves a sint08 value at a specific vector position within a row.
virtual void removeIndices(uint04 location, uint04 size) override
Adjusts stored index references (parsed as integers) after removal.
void set(uint04 index, const StringView &value) override
Sets a string value at the given row index.
void get(uint04 index, uint04 vector_pos, uint02 &value) const override
Retrieves a uint02 value at a specific vector position within a row.
void get(uint04 index, sint02 &value) const override
Retrieves a sint02 value at the given row index.
virtual void insertIndices(uint04 location, uint04 size) override
Adjusts stored index references (parsed as integers from strings) after insertion.
bool isSame(uint04 index, const StringView &value) const override
Checks if the string at the given row is equal to the provided value.
uint04 getRowSize(uint04 index) const override
Returns the character count of the string at the given row.
void get(uint04 index, uint01 &value) const override
Retrieves a uint01 value at the given row index.
void get(uint04 index, uint04 vector_pos, sint02 &value) const override
Retrieves a sint02 value at a specific vector position within a row.
void set(uint04, uint04, const StringView &) override
Sets a string value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, uint01 value) override
Sets a uint01 value at a specific vector position within a row.
TableColumnString(const StringView &label)
Constructs a TableColumnString with the given column label.
void set(uint04 index, fltp08 value) override
Sets a fltp08 value at the given row index.
void get(uint04 index, uint02 &value) const override
Retrieves a uint02 value at the given row index.
void get(uint04 index, uint04 vector_pos, StringAllocatingView &value) const override
Retrieves a string value at a specific vector position within a row.
virtual void swapIndices(uint04, uint04) override
Asserts; swap indices is not implemented for string columns.
void get(uint04 index, sint08 &value) const override
Retrieves a sint08 value at the given row index.
void set(uint04 index, uint01 value) override
Sets a uint01 value at the given row index.
void set(uint04 index, sint08 value) override
Sets a sint08 value at the given row index.
void get(uint04 index, RGBColor &value) const override
Retrieves an RGBColor value at the given row index.
void set(uint04 index, uint04 vector_pos, sint04 value) override
Sets a sint04 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, bool &value) const override
Gets a value from a substring starting at the given character position.
void set(uint04 index, uint04 vector_pos, fltp08 value) override
Sets a fltp08 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, uint02 &value) const override
Retrieves a uint02 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, bool &value) const override
Gets a single element from the buffer at the given row and vector position.
void get(uint04 index, StringAllocatingView &value) const override
Retrieves a string value at the given row index as a StringAllocatingView.
void get(uint04 index, uint04 vector_pos, uint08 &value) const override
Retrieves a uint08 value at a specific vector position within a row.
void set(uint04 index, fltp08 value) override
Sets a fltp08 value at the given row index.
void set(uint04 index, uint04 value) override
Sets a uint04 value at the given row index.
TableColumnTypeBuffer< t_type > * getSelected(const Buffer< bool > &selected_indices) const override
Creates a filtered copy; currently returns nullptr (unimplemented).
void set(uint04 index, uint04 vector_pos, uint02 value) override
Sets a uint02 value at a specific vector position within a row.
virtual void swapIndices(uint04 a, uint04 b) override
Swaps all stored references to index a with b and vice versa.
void get(uint04 index, sint02 &value) const override
Retrieves a sint02 value at the given row index.
void get(uint04 index, uint04 vector_pos, uint01 &value) const override
Retrieves a uint01 value at a specific vector position within a row.
uint08 tableHash() const override
Computes a hash of the entire column data using FNV-like hashing.
void get(uint04 index, fltp04 &value) const override
Retrieves a fltp04 value at the given row index.
void get(uint04 index, fltp08 &value) const override
Retrieves a fltp08 value at the given row index.
void set(uint04 index, RGBColor value) override
Sets an RGBColor value at the given row index.
void set(uint04 index, sint08 value) override
Sets a sint08 value at the given row index.
void get(uint04 index, uint04 vector_pos, fltp04 &value) const override
Retrieves a fltp04 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, fltp04 value) override
Sets a fltp04 value at a specific vector position within a row.
void set(uint04 index, sint04 value) override
Sets a sint04 value at the given row index.
void get(uint04 index, uint04 vector_pos, uint04 &value) const override
Retrieves a uint04 value at a specific vector position within a row.
void setRowSize(uint04 index, uint04 size) override
Sets the size of the per-row buffer at the given index.
void set(uint04 index, uint04 vector_pos, fltp08 value) override
Sets a fltp08 value at a specific vector position within a row.
virtual TypeInfo type() const override
Returns TypeInfo describing the stored Buffer<t_type>.
virtual void removeIndices(const Buffer< uint04 > &offset_lookup_list) override
Remaps stored index references using a lookup table after removal.
virtual void removeIndices(uint04 location, uint04 size) override
Adjusts stored index references after indices are removed elsewhere.
TableColumnTypeBuffer(const StringView &label)
Constructs a TableColumnTypeBuffer with the given column label.
void set(uint04 index, uint04 vector_pos, const StringView &value) override
Sets a string value at a specific vector position within a row.
void set(uint04 index, uint02 value) override
Sets a uint02 value at the given row index.
void get(uint04 index, uint01 &value) const override
Retrieves a uint01 value at the given row index.
void set(uint04 index, uint04 vector_pos, uint01 value) override
Sets a uint01 value at a specific vector position within a row.
void get(uint04 index, RGBColor &value) const override
Retrieves an RGBColor value at the given row index.
void set(uint04 index, sint01 value) override
Sets a sint01 value at the given row index.
void get(uint04 index, uint04 vector_pos, sint01 &value) const override
Retrieves a sint01 value at a specific vector position within a row.
void get(uint04 index, uint08 &value) const override
Retrieves a uint08 value at the given row index.
void get(uint04 index, uint04 vector_pos, sint04 &value) const override
Retrieves a sint04 value at a specific vector position within a row.
void get(uint04 index, sint01 &value) const override
Retrieves a sint01 value at the given row index.
void get(uint04 index, StringView &value) const override
Retrieves a string value at the given row index as a StringView.
void get(uint04 index, bool &value) const override
Gets a scalar value from the last element of the buffer at the given row.
void set(uint04 index, bool value) override
Sets all elements in the buffer at the given row to a single broadcast value.
void set(uint04 index, fltp04 value) override
Sets a fltp04 value at the given row index.
void set(uint04 index, uint04 vector_pos, uint04 value) override
Sets a uint04 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, StringAllocatingView &value) const override
Retrieves a string value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, sint01 value) override
Sets a sint01 value at a specific vector position within a row.
uint04 getRowSize(uint04 index) const override
Returns the size of the per-row buffer at the given index.
void set(uint04 index, uint04 vector_pos, sint02 value) override
Sets a sint02 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, sint08 value) override
Sets a sint08 value at a specific vector position within a row.
void get(uint04 index, uint04 vector_pos, sint02 &value) const override
Retrieves a sint02 value at a specific vector position within a row.
void set(uint04 index, uint04 vector_pos, sint04 value) override
Sets a sint04 value at a specific vector position within a row.
void set(uint04 index, uint08 value) override
Sets a uint08 value at the given row index.
void set(uint04 index, const StringView &value) override
Sets a string value at the given row index.
virtual void insertIndices(uint04 location, uint04 size) override
Adjusts stored index references after indices are inserted elsewhere.
void set(uint04 index, uint04 vector_pos, bool value) override
Sets a single element within the buffer at the given row and position.
void get(uint04 index, sint08 &value) const override
Retrieves a sint08 value at the given row index.
void get(uint04 index, uint04 vector_pos, fltp08 &value) const override
Retrieves a fltp08 value at a specific vector position within a row.
void get(uint04 index, sint04 &value) const override
Retrieves a sint04 value at the given row index.
void set(uint04 index, sint02 value) override
Sets a sint02 value at the given row index.
void set(uint04 index, uint01 value) override
Sets a uint01 value at the given row index.
void get(uint04 index, uint04 vector_pos, sint08 &value) const override
Retrieves a sint08 value at a specific vector position within a row.
void get(uint04 index, uint02 &value) const override
Retrieves a uint02 value at the given row index.
void get(uint04 index, uint04 &value) const override
Retrieves a uint04 value at the given row index.
void set(uint04 index, uint04 vector_pos, uint08 value) override
Sets a uint08 value at a specific vector position within a row.
A virtual storage type that is used with Table class to store data where the actual mechanism for sto...
Definition TableColumn.h:86
virtual uint04 size() const =0
Returns the number of rows in this column.
virtual const StringAllocatingView getDefaultValue() const =0
Returns the default value for new rows as a string representation.
Buffer< TableChange > m_changes
The list of recorded changes for change-tracking and synchronization.
CompressionMode m_compression_mode
The compression mode used when serializing this column.
const String & label() const
Returns the label (name) of this column.
virtual void setDefaultValue(const StringAllocatingView &value)=0
Sets the default value for new rows from a string representation.
TableColumn(const StringView &label)
Constructs a TableColumn with the given label.
Time m_modified_time
The timestamp of the most recent modification to this column.
virtual void set(uint04 index, const Matrix< fltp08 > &transform) override
Sets a 4x4 fltp08 matrix value at the given row index.
void get(uint04 index, StringView &value) const override
Asserts; StringView get is not supported for matrix types.
virtual void set(uint04 index, const Matrix< fltp04 > &transform) override
Sets a 4x4 fltp04 matrix value at the given row index.
void set(uint04 index, const StringView &value) override
Sets the matrix value at the given row from a string representation.
virtual void get(uint04 index, Matrix< fltp04 > &transform) const override
Retrieves a 4x4 fltp04 matrix from the given row index.
virtual void get(uint04 index, Matrix< fltp08 > &transform) const override
Gets or sets a Matrix value at the given row with type conversion.
void get(uint04 index, StringAllocatingView &value) const override
Gets the matrix value at the given row as a string.
virtual void setDefaultValue(const StringAllocatingView &value) override
Sets the default matrix value from a string representation.
TableMatrixType(const StringView &label)
Constructs a TableMatrixType with the given column label.
virtual void get(uint04 index, UUID &id) const final override
Gets the UUID value at the given row.
void set(uint04 index, uint01 value) override
Sets a uint01 value at the given row index.
void get(uint04 index, StringAllocatingView &value) const override
Retrieves a string value at the given row index as a StringAllocatingView.
void set(uint04 index, sint04 value) override
Sets a sint04 value at the given row index.
void set(uint04 index, uint04 value) override
Sets a uint04 value at the given row index.
TableVectorType(const StringView &label)
Constructs a UUID column with the given label.
void set(uint04 index, fltp04 value) override
Sets a fltp04 value at the given row index.
virtual void set(uint04 index, const UUID &value) final override
Sets the UUID value at the given row.
void set(uint04 index, fltp08 value) override
Sets a fltp08 value at the given row index.
void set(uint04 index, sint02 value) override
Sets a sint02 value at the given row index.
decltype(auto) pullValue(uint04 index)
Returns a reference to the underlying 16-byte vector at the given row.
void get(uint04, bool &value) const override
Type-converting get/set overrides for UUID column storage. UUIDs are stored as 16-byte vectors intern...
void get(uint04, StringView &) const override
Retrieves a string value at the given row index as a StringView.
void set(uint04 index, const StringView &value) override
Sets a string value at the given row index.
void set(uint04 index, bool value) override
Sets a bool value at the given row index.
void set(uint04 index, sint08 value) override
Sets a sint08 value at the given row index.
void set(uint04 index, uint02 value) override
Sets a uint02 value at the given row index.
void set(uint04 index, RGBColor value) override
Sets an RGBColor value at the given row index.
void set(uint04 index, sint01 value) override
Sets a sint01 value at the given row index.
decltype(auto) pullValue(uint04 index) const
Returns a const reference to the underlying 16-byte vector at the given row.
void set(uint04 index, uint08 value) override
Sets a uint08 value at the given row index.
void set(uint04 index, fltp08 value) override
Sets a fltp08 value at the given row index.
void get(uint04 index, uint04, sint04 &value) const override
Retrieves a sint04 value at a specific vector position within a row.
void set(uint04 index, uint08 value) override
Sets a uint08 value at the given row index.
virtual void swapIndices(uint04 a, uint04 b) override
Swaps all stored references to index a with b and vice versa.
void set(uint04 index, uint04, uint04 value) override
Sets a uint04 value at a specific vector position within a row.
void get(uint04 index, uint04 &value) const override
Retrieves a uint04 value at the given row index.
void set(uint04 index, uint04, fltp08 value) override
Sets a fltp08 value at a specific vector position within a row.
void get(uint04 index, uint02 &value) const override
Retrieves a uint02 value at the given row index.
void get(uint04 index, fltp08 &value) const override
Retrieves a fltp08 value at the given row index.
void get(uint04 index, uint04, uint04 &value) const override
Retrieves a uint04 value at a specific vector position within a row.
void get(uint04 index, uint04, uint01 &value) const override
Retrieves a uint01 value at a specific vector position within a row.
void get(uint04 index, sint04 &value) const override
Retrieves a sint04 value at the given row index.
void set(uint04 index, sint08 value) override
Sets a sint08 value at the given row index.
void get(uint04, RGBColor &) const override
Retrieves an RGBColor value at the given row index.
void get(uint04 index, sint08 &value) const override
Retrieves a sint08 value at the given row index.
void get(uint04 index, uint04, fltp08 &value) const override
Retrieves a fltp08 value at a specific vector position within a row.
void set(uint04 index, uint04, const StringView &value) override
Sets a string value at a specific vector position within a row.
void set(uint04 index, uint04, uint02 value) override
Sets a uint02 value at a specific vector position within a row.
void get(uint04, StringView &) const override
Retrieves a string value at the given row index as a StringView.
void set(uint04 index, bool value) override
Sets the scalar value at the given row from various numeric and string types.
void get(uint04 index, uint01 &value) const override
Retrieves a uint01 value at the given row index.
TableVectorType(const StringView &label)
Constructs a scalar TableVectorType with the given column label.
void get(uint04 index, uint04, sint02 &value) const override
Retrieves a sint02 value at a specific vector position within a row.
void get(uint04 index, sint02 &value) const override
Retrieves a sint02 value at the given row index.
void set(uint04 index, uint04 value) override
Sets a uint04 value at the given row index.
void get(uint04 index, uint08 &value) const override
Retrieves a uint08 value at the given row index.
void get(uint04 index, uint04, sint01 &value) const override
Retrieves a sint01 value at a specific vector position within a row.
void get(uint04 index, StringAllocatingView &value) const override
Retrieves a string value at the given row index as a StringAllocatingView.
void set(uint04 index, uint04, sint08 value) override
Sets a sint08 value at a specific vector position within a row.
void set(uint04 index, uint04, bool value) override
Sets the value at the given row, ignoring the vector_pos parameter for scalar types.
void set(uint04 index, uint04, sint02 value) override
Sets a sint02 value at a specific vector position within a row.
void set(uint04 index, sint04 value) override
Sets a sint04 value at the given row index.
virtual uint04 getRowSize(uint04) const override
Returns 1, since this is a scalar (single-component) column.
void set(uint04 index, uint02 value) override
Sets a uint02 value at the given row index.
virtual void insertIndices(uint04 location, uint04 size) override
Adjusts stored index references after indices are inserted elsewhere.
void set(uint04 index, uint04, sint01 value) override
Sets a sint01 value at a specific vector position within a row.
TableVectorType< 1, t_type > * getSelected(const Buffer< bool > &selected_indices) const override
Creates a new column containing only the rows marked true in the selection mask.
void get(uint04 index, uint04, sint08 &value) const override
Retrieves a sint08 value at a specific vector position within a row.
void set(uint04 index, sint01 value) override
Sets a sint01 value at the given row index.
virtual void removeIndices(const Buffer< uint04 > &offset_lookup_list) override
Remaps stored index references using a lookup table after removal.
void get(uint04 index, uint04, uint02 &value) const override
Retrieves a uint02 value at a specific vector position within a row.
void set(uint04, RGBColor) override
Sets an RGBColor value at the given row index.
void set(uint04 index, uint04, fltp04 value) override
Sets a fltp04 value at a specific vector position within a row.
void get(uint04 index, uint04, uint08 &value) const override
Retrieves a uint08 value at a specific vector position within a row.
void get(uint04 index, sint01 &value) const override
Retrieves a sint01 value at the given row index.
void set(uint04 index, uint04, uint01 value) override
Sets a uint01 value at a specific vector position within a row.
virtual void removeIndices(uint04 location, uint04 size) override
Adjusts stored index references after indices are removed elsewhere.
void get(uint04 index, uint04, StringAllocatingView &value) const override
Retrieves a string value at a specific vector position within a row.
void set(uint04 index, uint04, sint04 value) override
Sets a sint04 value at a specific vector position within a row.
void set(uint04 index, const StringView &value) override
Sets a string value at the given row index.
TableVectorType(const Buffer< bool > &buffer, const StringView &label)
Constructs a scalar TableVectorType from a pre-populated buffer.
void set(uint04 index, sint02 value) override
Sets a sint02 value at the given row index.
void get(uint04 index, fltp04 &value) const override
Retrieves a fltp04 value at the given row index.
void set(uint04 index, uint04, uint08 value) override
Sets a uint08 value at a specific vector position within a row.
void get(uint04 index, uint04, fltp04 &value) const override
Retrieves a fltp04 value at a specific vector position within a row.
void set(uint04 index, fltp04 value) override
Sets a fltp04 value at the given row index.
void get(uint04 index, bool &value) const override
Gets the scalar value at the given row, cast to the requested output type.
void get(uint04 index, uint04, bool &value) const override
Gets the scalar value at the given row, ignoring vector_pos for scalar types.
void set(uint04 index, uint01 value) override
Sets a uint01 value at the given row index.
virtual TypeInfo type() const override
Returns TypeInfo describing the stored scalar type.
virtual void get(uint04 index, Bounds< 3, fltp08 > &b) const override
Gets or sets a 3D Bounds value stored as a 6-component vector at the given row.
virtual void set(uint04 index, uint04 vector_pos, uint04 value) override
Sets a uint04 value at a specific vector position within a row.
virtual void get(uint04 index, uint04 &value) const override
Retrieves a uint04 value at the given row index.
virtual void get(uint04 index, uint04 vector_pos, sint02 &value) const override
Retrieves a sint02 value at a specific vector position within a row.
virtual void set(uint04 index, const Bounds< 3, fltp08 > &b) override
virtual void removeIndices(uint04 location, uint04 size) override
Adjusts index references stored in this column after rows are removed elsewhere.
virtual void get(uint04 index, uint01 &value) const override
Retrieves a uint01 value at the given row index.
virtual void get(uint04 index, fltp08 &value) const override
Retrieves a fltp08 value at the given row index.
virtual void set(uint04 index, uint04 vector_pos, const StringView &value) override
Sets a string value at a specific vector position within a row.
virtual void get(uint04 index, uint04 vector_pos, uint04 &value) const override
Retrieves a uint04 value at a specific vector position within a row.
virtual void set(uint04 index, uint02 value) override
Sets a uint02 value at the given row index.
virtual void set(uint04 index, uint04 vector_pos, fltp04 value) override
Sets a fltp04 value at a specific vector position within a row.
virtual void set(uint04 index, uint04 vector_pos, sint02 value) override
Sets a sint02 value at a specific vector position within a row.
TableVectorType(const Buffer< Vector< t_dims, t_type > > &buffer, const StringView &label)
Constructs a TableVectorType from a pre-populated buffer of vectors.
virtual void get(uint04 index, uint04 vector_pos, uint08 &value) const override
Retrieves a uint08 value at a specific vector position within a row.
virtual void swapIndices(uint04 a, uint04 b) override
Swaps all index references to a with b and vice versa throughout the column.
virtual void get(uint04 index, sint08 &value) const override
Retrieves a sint08 value at the given row index.
virtual void set(uint04 index, uint04 vector_pos, uint01 value) override
Sets a uint01 value at a specific vector position within a row.
virtual void set(uint04 index, RGBColor value) override
Sets an RGBColor value at the given row index.
virtual void get(uint04 index, uint04 vector_pos, uint01 &value) const override
Retrieves a uint01 value at a specific vector position within a row.
virtual void set(uint04 index, sint02 value) override
Sets a sint02 value at the given row index.
virtual void set(uint04 index, uint08 value) override
Sets a uint08 value at the given row index.
virtual void get(uint04 index, sint04 &value) const override
Retrieves a sint04 value at the given row index.
virtual void insertIndices(uint04 location, uint04 size) override
Adjusts index references stored in this column after rows are inserted elsewhere.
virtual void get(uint04 index, uint04 vector_pos, uint02 &value) const override
Retrieves a uint02 value at a specific vector position within a row.
virtual void get(uint04 index, bool &value) const override
Gets a scalar value from the first component of the vector at the given row. Both branches of the if ...
virtual void get(uint04 index, sint02 &value) const override
Retrieves a sint02 value at the given row index.
virtual void get(uint04 index, StringAllocatingView &value) const override
Retrieves a string value at the given row index as a StringAllocatingView.
virtual void get(uint04 index, uint04 vector_pos, sint01 &value) const override
Retrieves a sint01 value at a specific vector position within a row.
void getVector(uint04 index, Vector< 2, uint04 > &vector) const override
Retrieves a 2D uint04 vector from the given row index.
TableVectorType(const StringView &label)
Constructs a TableVectorType with the given column label.
virtual void get(uint04 index, uint02 &value) const override
Retrieves a uint02 value at the given row index.
virtual void set(uint04 index, fltp04 value) override
Sets a fltp04 value at the given row index.
TableVectorType< t_dims, t_type > * getSelected(const Buffer< bool > &selected_indices) const override
Creates a new column containing only the rows marked true in the selection mask.
virtual void set(uint04 index, uint04 value) override
Sets a uint04 value at the given row index.
virtual void get(uint04, StringView &) const override
Asserts; StringView get is not supported for vector types.
virtual void set(uint04 index, uint01 value) override
Sets a uint01 value at the given row index.
virtual void get(uint04 index, uint04 vector_pos, StringAllocatingView &value) const override
Retrieves a string value at a specific vector position within a row.
virtual TypeInfo type() const override
Returns TypeInfo describing the stored Vector type.
virtual void set(uint04 index, uint04 vector_pos, sint04 value) override
Sets a sint04 value at a specific vector position within a row.
virtual void get(uint04 index, uint04 vector_pos, fltp04 &value) const override
Retrieves a fltp04 value at a specific vector position within a row.
void getVector(uint04 index, Vector< 3, uint04 > &vector) const override
Retrieves a 3D uint04 vector from the given row index.
virtual void get(uint04 index, Bounds< 3, fltp04 > &b) const override
Retrieves a 3D fltp04 bounding box from the given row index.
virtual void set(uint04 index, sint01 value) override
Sets a sint01 value at the given row index.
virtual void set(uint04 index, uint04 vector_pos, fltp08 value) override
Sets a fltp08 value at a specific vector position within a row.
virtual void set(uint04 index, uint04 vector_pos, sint08 value) override
Sets a sint08 value at a specific vector position within a row.
virtual void set(uint04 index, bool value) override
Sets the entire vector at the given row by broadcasting a scalar value. Casts the incoming value to t...
uint08 tableHash() const override
Computes a hash of the entire column data using FNV-like hashing.
virtual void set(uint04 index, const StringView &value) override
Sets a string value at the given row index.
virtual void removeIndices(const Buffer< uint04 > &offset_lookup_list) override
Remaps index references using a lookup table after index removal.
virtual void set(uint04 index, uint04 vector_pos, bool value) override
Sets a single component of the vector at the given row and vector position. Casts the incoming value ...
virtual void get(uint04 index, sint01 &value) const override
Retrieves a sint01 value at the given row index.
virtual void get(uint04 index, uint04 vector_pos, sint08 &value) const override
Retrieves a sint08 value at a specific vector position within a row.
virtual void set(uint04 index, sint08 value) override
Sets a sint08 value at the given row index.
virtual void get(uint04 index, uint04 vector_pos, fltp08 &value) const override
Retrieves a fltp08 value at a specific vector position within a row.
virtual void set(uint04 index, sint04 value) override
Sets a sint04 value at the given row index.
void getVector(uint04 index, Vector< 3, fltp04 > &vector) const override
Retrieves the vector at the given row, converting to the requested vector type.
virtual void set(uint04 index, const Bounds< 3, fltp04 > &b) override
virtual void set(uint04 index, uint04 vector_pos, uint08 value) override
Sets a uint08 value at a specific vector position within a row.
virtual void set(uint04 index, uint04 vector_pos, uint02 value) override
Sets a uint02 value at a specific vector position within a row.
void getVector(uint04 index, Vector< 3, fltp08 > &vector) const override
Retrieves a 3D fltp08 vector from the given row index.
virtual void set(uint04 index, fltp08 value) override
Sets a fltp08 value at the given row index.
virtual void set(uint04 index, uint04 vector_pos, sint01 value) override
Sets a sint01 value at a specific vector position within a row.
virtual void get(uint04 index, RGBColor &value) const override
Gets the vector value at the given row as an RGBColor.
virtual void get(uint04 index, uint08 &value) const override
Retrieves a uint08 value at the given row index.
virtual void get(uint04 index, fltp04 &value) const override
Retrieves a fltp04 value at the given row index.
virtual uint04 getRowSize(uint04) const override
Returns the number of components per row (the vector dimension count).
virtual void get(uint04 index, uint04 vector_pos, bool &value) const override
Gets a single component of the vector at the given row and vector position. Casts the stored componen...
virtual void get(uint04 index, uint04 vector_pos, sint04 &value) const override
Retrieves a sint04 value at a specific vector position within a row.
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:62
static Time SystemTime()
Retrieves the current system time which is a combination of std::chrono::steady_clock to ensure smoot...
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Stores information about a type, relevant for certain templated functions.
Definition TypeInfo.h:43
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
UUID appendUUID(const StringView &identifier) const
Appends a string identifier to this UUID, producing a new derived UUID.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
constexpr decltype(auto) as() const
Returns the vector as a new time of vector.
Definition Vector.hpp:301
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
static constexpr bool IsValid(const Angle< t_type > &value)
Checks whether the given Angle holds a valid value.
Definition Angle.h:398
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
constexpr std::enable_if<!ObjectInfo< t_type >::Buffer, TypeInfo >::type GetTypeInfo()
Constructs a TypeInfo for a non-buffer type at compile time using ObjectInfo traits.
Definition TypeInfo.h:125
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
CompressionMode
Forward declaration of the Module struct for module metadata.
Definition Compressor.h:17
@ e_default_compression
Uses a sensible default compression strategy.
Definition Compressor.h:19
int16_t sint02
-Defines an alias representing a 2 byte, signed integer.
int32_t sint04
-Defines an alias representing a 4 byte, signed integer.
constexpr t_to & rcast(t_from &value)
Casts the given value.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
static constexpr bool IsInvalid(const Angle< t_type > &value)
Checks whether the given Angle holds an invalid value.
Definition Angle.h:388
@ file
The source file path associated with this object.
@ transform
A 4x4 transform matrix that maps local coordinates into global space.
int8_t sint01
-Defines an alias representing a 1 byte, signed integer.
constexpr HSLColor Constant< HSLColor >::Min
The minimum HSLColor constant with saturation, brightness, and alpha at zero.
Definition HSLColor.h:266
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.
Definition Angle.h:408
A container for storing compressed data, typically used for File IO operations.
Definition Compressor.h:53
Extended file table information for reading and writing NDV binary files.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
void setDefaultValueFrom(TableColumn &, const TableColumn &)
Copies the default value from column b into column a.
void setDefaultValueFrom(TableColumn &a, const TableColumn &b)
Copies the default value from column b into column a.
Helper struct that copies the default value from one TableColumn to another.
void setDefaultValueFrom(TableColumn &a, const TableColumn &b)
Copies the default value from column b into column a.
Information about the object.
Definition ObjectInfo.h:55
Records changes to a table or column noting the bounds of the data adjusted.
Definition TableColumn.h:54
@ e_update
An existing row range was modified in place.
Definition TableColumn.h:58