108 template<
class t_type_a,
class t_type_b>
109 void move(
void* memory,
const t_type_b& value)
const
112 memcpy(memory, &new_value,
sizeof(t_type_a));
115 template<
class t_type_a,
class t_type_b>
116 void move(t_type_b& value,
void* memory)
const
119 memcpy(&new_value, memory,
sizeof(t_type_a));
123 template<
class t_type_a>
126 t_type_a new_value = value.
getAs<t_type_a>();
127 memcpy(memory, &new_value,
sizeof(t_type_a));
130 template<
class t_type_a,
class t_type_b>
131 void get(
void* memory, t_type_b& value)
134 memcpy(&new_value, memory,
sizeof(t_type_a));
138 template<
class t_type_a>
142 memcpy(&new_value, memory,
sizeof(t_type_a));
143 value =
String(new_value);
146 template<
class t_type>
150 void* temp_value =
mapMemory(index *
type().total_size + vector_pos *
type().byte_size,
type().total_size);
155 template<
class t_type>
158 switch (
type().byte_size)
161 if (
type().is_unsigned)
167 if (
type().is_unsigned)
175 else if (
type().is_unsigned)
183 else if (
type().is_unsigned)
193 template<
class t_type>
197 switch (
type().byte_size)
200 if (
type().is_unsigned)
201 _setRawData<uint01, t_type>(data_to_insert, offset,
size);
203 _setRawData<sint01, t_type>(data_to_insert, offset,
size);
206 if (
type().is_unsigned)
207 _setRawData<uint02, t_type>(data_to_insert, offset,
size);
209 _setRawData<sint02, t_type>(data_to_insert, offset,
size);
213 _setRawData<fltp04, t_type>(data_to_insert, offset,
size);
214 else if (
type().is_unsigned)
215 _setRawData<uint04, t_type>(data_to_insert, offset,
size);
217 _setRawData<sint04, t_type>(data_to_insert, offset,
size);
221 _setRawData<fltp08, t_type>(data_to_insert, offset,
size);
222 else if (
type().is_unsigned)
223 _setRawData<uint08, t_type>(data_to_insert, offset,
size);
225 _setRawData<sint08, t_type>(data_to_insert, offset,
size);
229 _setRawData<fltp04, t_type>(data_to_insert, offset,
size);
230 else if (
type().is_unsigned)
231 _setRawData<uint04, t_type>(data_to_insert, offset,
size);
233 _setRawData<sint04, t_type>(data_to_insert, offset,
size);
241 template<
class t_type>
245 void* temp_value =
mapMemory(index *
type().total_size + vector_pos *
type().byte_size,
type().byte_size);
246 switch (
type().byte_size)
249 if (
type().is_unsigned)
255 if (
type().is_unsigned)
263 else if (
type().is_unsigned)
271 else if (
type().is_unsigned)
282 template<
class t_type>
290 template<
class t_type>
295 template<
class t_type>
393 template<
class t_type>
456 _setRawData<t_type, t_type>(
begin, 0,
size);
463 void*
begin() final {
return nullptr; };
464 void*
end() final {
return nullptr; };
466 const void*
begin() const final {
return nullptr; };
467 const void*
end() const final {
return nullptr; };
471 template<
class t_type>
475 memcpy(data_to_get, data,
size *
type().total_size);
485#pragma warning( disable : 4244)
487 template<
class t_convert_type,
class t_type>
491 if constexpr (std::is_same<t_convert_type, t_type>())
499 t_convert_type conversion(*(
begin + i));
500 memcpy((
uint01*)(data)+
type().byte_size * i, &conversion,
sizeof(t_convert_type));
506#pragma warning( default : 4244)
#define UNUSED(expr)
Definition BaseValues.hpp:409
#define lib_assert(expression, message)
Definition LibAssert.h:61
Logic for reading or writing to a binary file including logic for.
Definition BinaryFile.h:59
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A Special abstract TableColumn responsible for interfacing a Buffer of data with the video card....
Definition GraphicsBuffer.h:45
bool beginsWith(uint04 index, const char *value, bool ignore_case) const override
Definition GraphicsBuffer.h:106
virtual TableColumn * getSelected(const Buffer< bool > &) const override
Definition GraphicsBuffer.h:107
void removeRow(uint04 index) override final
Definition GraphicsBuffer.h:385
void get(uint04 index, uint04 vector_pos, fltp08 &value) const final override
Definition GraphicsBuffer.h:339
void removeIndices(const Buffer< uint04 > &offset_lookup_list) override final
Definition GraphicsBuffer.h:381
void get(uint04 index, fltp08 &value) const final override
Definition GraphicsBuffer.h:352
void get(uint04 index, uint04 vector_pos, fltp04 &value) const final override
Definition GraphicsBuffer.h:338
void get(uint04 index, uint02 &value) const final override
Definition GraphicsBuffer.h:344
void get(void *memory, String &value)
Definition GraphicsBuffer.h:139
void setMemory(void *temp_value, const t_type &value)
Definition GraphicsBuffer.h:156
void set(uint04 index, uint04 vector_pos, sint08 value) final override
Definition GraphicsBuffer.h:309
virtual void updateFrom(const TableColumn &column) override
virtual void sendToVideoCard(bool copy_existing)=0
virtual void insertIndices(uint04 location, uint04 size) override
Definition GraphicsBuffer.h:369
void setData(const t_type *begin, const t_type *end, bool set_type)
Definition GraphicsBuffer.h:394
void set(uint04 index, RGBColor value) final override
Definition GraphicsBuffer.h:327
void get(uint04 index, uint04 vector_pos, sint01 &value) const final override
Definition GraphicsBuffer.h:334
bool isAccessable() const
Definition GraphicsBuffer.h:77
Type
Definition GraphicsBuffer.h:48
@ VERTEX
Definition GraphicsBuffer.h:49
@ INDEX
Definition GraphicsBuffer.h:51
@ UNIFORM
Definition GraphicsBuffer.h:50
@ INSTANCE
Definition GraphicsBuffer.h:52
void getData(t_type *data_to_get, uint04 offset, uint04 size)
Definition GraphicsBuffer.h:472
virtual void copyRow(uint04 source, uint04 destination) override
Definition GraphicsBuffer.h:356
void removeRows(const Buffer< uint04 > &indices) override final
Definition GraphicsBuffer.h:387
void get(uint04 index, uint04 vector_pos, uint01 &value) const final override
Definition GraphicsBuffer.h:330
virtual void copyRows(uint04 source, uint04 destination, uint04 size) override
Definition GraphicsBuffer.h:362
virtual void copyData(const TableColumn &reference_data, bool set_type)=0
void set(uint04 index, uint04 vector_pos, sint01 value) final override
Definition GraphicsBuffer.h:306
virtual void getFromVideoCard(bool copy_existing)=0
GraphicsBuffer(GraphicsBuffer &&buffer) noexcept
void set(uint04 index, fltp04 value) final override
Definition GraphicsBuffer.h:324
virtual void compress(BinaryCompressionObject &object) override
Definition GraphicsBuffer.h:82
const void * end() const final
Definition GraphicsBuffer.h:467
void setType(const TypeInfo &type)
void get(uint04 index, String &value) const final override
Definition GraphicsBuffer.h:353
void set(uint04 index, uint04 vector_pos, uint04 value) final override
Definition GraphicsBuffer.h:304
void set(uint04 index, uint04 vector_pos, bool value) final override
Definition GraphicsBuffer.h:301
GraphicsBuffer(const String &label)
void set(uint04 index, sint01 value) final override
Definition GraphicsBuffer.h:320
uint04 m_size
Definition GraphicsBuffer.h:509
void get(void *memory, t_type_b &value)
Definition GraphicsBuffer.h:131
void get(uint04 index, uint04 vector_pos, uint02 &value) const final override
Definition GraphicsBuffer.h:331
void move(t_type_b &value, void *memory) const
Definition GraphicsBuffer.h:116
virtual void updateRegion(const TableColumn &reference_data, uint04 offset, uint04 size)=0
bool contains(uint04 index, const char *value, bool ignore_case) const override
Definition GraphicsBuffer.h:104
void removeRows(uint04 offset, const Buffer< bool > &indices) override
Definition GraphicsBuffer.h:388
void get(uint04 index, uint04 vector_pos, sint04 &value) const final override
Definition GraphicsBuffer.h:336
bool isSame(uint04 index, const char *value) const override
Definition GraphicsBuffer.h:102
void set(uint04 index, uint04 vector_pos, uint08 value) final override
Definition GraphicsBuffer.h:305
uint04 size() const final override
Definition GraphicsBuffer.h:382
void get(uint04 index, sint04 &value) const final override
Definition GraphicsBuffer.h:349
void get(uint04 index, RGBColor &value) const final override
Definition GraphicsBuffer.h:354
virtual void * mapMemory(size_t offset, size_t size) const =0
void get(uint04 index, uint04 vector_pos, bool &value) const final override
Definition GraphicsBuffer.h:329
void set(uint04 index, sint02 value) final override
Definition GraphicsBuffer.h:321
void get(uint04 index, uint04 vector_pos, sint02 &value) const final override
Definition GraphicsBuffer.h:335
virtual void removeIndices(uint04 location, uint04 size) override
Definition GraphicsBuffer.h:375
bool m_is_memory_owner
Definition GraphicsBuffer.h:514
void get(uint04 index, fltp04 &value) const final override
Definition GraphicsBuffer.h:351
void set(uint04 index, uint04 vector_pos, uint01 value) final override
Definition GraphicsBuffer.h:302
void get(uint04 index, uint04 vector_pos, uint08 &value) const final override
Definition GraphicsBuffer.h:333
void move(void *memory, const String &value) const
Definition GraphicsBuffer.h:124
void set(uint04 index, const String &value) final override
Definition GraphicsBuffer.h:326
virtual void mapToFile(BinaryFile &file, int compression) override
Definition GraphicsBuffer.h:91
void setUsage(Type type)
Definition GraphicsBuffer.h:78
virtual void unmapMemory() const =0
virtual void mapFromFile(BinaryFile &file, uint08 version_number) override
Definition GraphicsBuffer.h:96
void get(uint04 index, uint01 &value) const final override
Definition GraphicsBuffer.h:343
void get(uint04 index, bool &value) const final override
Definition GraphicsBuffer.h:342
void set(uint04 index, sint04 value) final override
Definition GraphicsBuffer.h:322
void get(uint04 index, sint02 &value) const final override
Definition GraphicsBuffer.h:348
void get(uint04 index, uint04 vector_pos, String &value) const final override
Definition GraphicsBuffer.h:340
Type m_internal_type
Definition GraphicsBuffer.h:511
void set(uint04 index, uint04 vector_pos, fltp04 value) final override
Definition GraphicsBuffer.h:310
void set(uint04 index, uint04 vector_pos, const String &value) final override
Definition GraphicsBuffer.h:313
void get(uint04 index, uint04 vector_pos, sint08 &value) const final override
Definition GraphicsBuffer.h:337
void get(uint04 index, sint08 &value) const final override
Definition GraphicsBuffer.h:350
void set(uint04 index, uint04 vector_pos, fltp08 value) final override
Definition GraphicsBuffer.h:311
uint04 capacity()
Definition GraphicsBuffer.h:392
bool beginsWith(uint04 index, const String &value, bool ignore_case) const override
Definition GraphicsBuffer.h:105
bool m_is_normalized
Definition GraphicsBuffer.h:513
void insert(uint04 index) override final
Definition GraphicsBuffer.h:389
void get(uint04 index, uint04 &value) const final override
Definition GraphicsBuffer.h:345
void getMemory(uint04 index, uint04 vector_pos, t_type &value) const
Definition GraphicsBuffer.h:242
void getMemory(uint04 index, t_type &value) const
Definition GraphicsBuffer.h:291
const void * begin() const final
Definition GraphicsBuffer.h:466
void set(uint04 index, uint08 value) final override
Definition GraphicsBuffer.h:319
uint04 m_allocated_size
Definition GraphicsBuffer.h:510
void move(void *memory, const t_type_b &value) const
Definition GraphicsBuffer.h:109
void set(uint04 index, uint01 value) final override
Definition GraphicsBuffer.h:316
void setMemory(const t_type *data_to_insert, uint04 offset, uint04 size)
Definition GraphicsBuffer.h:194
virtual void setAccessable(bool is_accessable, bool copy_existing)
Definition GraphicsBuffer.h:61
void set(uint04 index, bool value) final override
Definition GraphicsBuffer.h:315
void setRawMemory(uint04 index, const t_type &value)
Definition GraphicsBuffer.h:283
void set(uint04 index, uint04 vector_pos, sint04 value) final override
Definition GraphicsBuffer.h:308
void get(uint04 index, uint08 &value) const final override
Definition GraphicsBuffer.h:346
bool m_is_accessable
Definition GraphicsBuffer.h:512
void setMemory(uint04 index, const t_type &value)
Definition GraphicsBuffer.h:296
void set(uint04 index, sint08 value) final override
Definition GraphicsBuffer.h:323
void get(uint04 index, sint01 &value) const final override
Definition GraphicsBuffer.h:347
void removeRows(uint04 index, uint04 size) override final
Definition GraphicsBuffer.h:386
void set(uint04 index, uint04 vector_pos, sint02 value) final override
Definition GraphicsBuffer.h:307
bool isSame(uint04 index, const String &value) const override
Definition GraphicsBuffer.h:101
void setMemory(uint04 index, uint04 vector_pos, const t_type &value)
Definition GraphicsBuffer.h:147
void set(uint04 index, uint04 vector_pos, uint02 value) final override
Definition GraphicsBuffer.h:303
void get(uint04 index, uint04 vector_pos, uint04 &value) const final override
Definition GraphicsBuffer.h:332
void set(uint04 index, uint02 value) final override
Definition GraphicsBuffer.h:317
void * end() final
Definition GraphicsBuffer.h:464
void set(uint04 index, fltp08 value) final override
Definition GraphicsBuffer.h:325
virtual void mapToFile(BinaryFile &file, BinaryCompressionObject &object) override
Definition GraphicsBuffer.h:86
void * begin() final
Definition GraphicsBuffer.h:463
bool contains(uint04 index, const String &value, bool ignore_case) const override
Definition GraphicsBuffer.h:103
void set(uint04 index, uint04 value) final override
Definition GraphicsBuffer.h:318
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
The core String class for the NDEVR API.
Definition String.h:69
t_type getAs() const
Converts a string into an object. To use this function an object must have overwritten StringStream<t...
Definition String.h:143
A virtual storage type that is used with Table class to store data where the actual mechanism for sto...
Definition TableColumn.h:76
TypeInfo m_type
Definition TableColumn.h:617
virtual void insertRows(uint04 location, uint04 size)=0
virtual void setSize(uint04 size)=0
const String & label() const
virtual TypeInfo type() const
Definition TableColumn.h:86
Stores information about a type, relevant for certain templated functions. To get information about a...
Definition TypeInfo.h:43
bool is_number
Definition TypeInfo.h:61
bool is_unsigned
Definition TypeInfo.h:62
uint02 byte_size
Definition TypeInfo.h:58
uint02 vector_size
Definition TypeInfo.h:59
bool is_float
Definition TypeInfo.h:63
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:64
constexpr std::enable_if<!ObjectInfo< t_type >::Buffer, TypeInfo >::type GetTypeInfo()
Definition TypeInfo.h:103
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
Definition BaseValues.hpp:71
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
int8_t sint01
-Defines an alias representing a 1 byte, signed integer. -Can represent exact integer values -127 thr...
Definition BaseValues.hpp:50
int16_t sint02
-Defines an alias representing a 2 byte, signed integer. -Can represent exact integer values -32767 t...
Definition BaseValues.hpp:57
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:106
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:88
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
A container for storing compressed data, typically used for File IO operations. Responsible for stori...
Definition Compressor.h:52