Cogs.Core
|
#include <PropertiesManager.h>
Classes | |
struct | PropertyAlloc |
Public Member Functions | |
PropertyStore (MemBlockType memType=MemBlockType::PropertyStore) | |
PropertyStore (const PropertyStore &) | |
PropertyStore (PropertyStore &&) noexcept | |
PropertyStore & | operator= (const PropertyStore &) |
PropertyStore & | operator= (PropertyStore &&) noexcept |
bool | getProperty (StringView key, bool defaultValue) |
float | getProperty (StringView key, float defaultValue) |
int | getProperty (StringView key, int defaultValue) |
uint32_t | getProperty (StringView key, uint32_t defaultValue) |
StringView | getProperty (StringView key, const char *defaultValue) |
StringView | getProperty (StringView key, StringView defaultValue) |
std::span< const float > | getProperty (StringView key, std::span< const float > defaultValue) |
glm::vec3 | getProperty (StringView key, glm::vec3 defaultValue) |
uint32_t | addProperty (StringView key, bool value) |
uint32_t | addProperty (StringView key, int32_t value) |
uint32_t | addProperty (StringView key, uint32_t value) |
uint32_t | addProperty (StringView key, float value) |
uint32_t | addProperty (StringView key, double value) |
uint32_t | addProperty (StringView key, const char *value) |
uint32_t | addProperty (StringView key, StringRef value) |
uint32_t | addProperty (StringView key, StringView value) |
uint32_t | addProperty (StringView key, std::span< const float > values) |
uint32_t | addProperty (StringView key, std::span< const double > values) |
uint32_t | addProperty (StringView key, std::span< const int32_t > values) |
uint32_t | addProperty (StringView key, std::span< const uint32_t > values) |
uint32_t | addProperty (StringView key, const glm::vec3 &values) |
uint32_t | addProperty (const PropertyStore &other, uint32_t otherIndex) |
PropertyInfo & | getProperty (StringView key) |
PropertyInfo & | getProperty (StringRef key) |
PropertyInfo & | getPropertyByIndex (uint32_t index) |
const PropertyInfo & | getPropertyByIndex (uint32_t index) const |
uint32_t | findProperty (StringView key) const |
uint32_t | findProperty (uint32_t first, uint32_t count, StringRef key) const |
bool | hasProperty (StringView key) const |
uint32_t | size () const |
StringView | getKey (const PropertyInfo &p) const |
StringView | getString (const PropertyInfo &p) const |
StringView | getString (uint32_t index) const |
std::span< float > | getFloatArray (uint32_t index) |
std::span< const float > | getFloatArray (const PropertyInfo &p) const |
std::span< const float > | getFloatArray (uint32_t index) const |
std::span< const double > | getDoubleArray (const PropertyInfo &p) const |
std::span< const double > | getDoubleArray (uint32_t index) const |
std::span< const int32_t > | getIntArray (const PropertyInfo &p) const |
std::span< const int32_t > | getIntArray (uint32_t index) const |
std::span< const uint32_t > | getUIntArray (const PropertyInfo &p) const |
std::span< const uint32_t > | getUIntArray (uint32_t index) const |
std::span< const PropertyInfo > | getHeaders () const |
const uint8_t * | getData () const |
void | copyProperties (const PropertyStore &other, uint32_t offset, uint32_t count) |
size_t | currentByteSize () const |
size_t | allocatedByteSize () const |
Static Public Attributes | |
static constexpr uint32_t | NoProperty = static_cast<uint32_t>(-1) |
Return from findProperty if key not found. | |
Private Member Functions | |
PropertyInfo & | addProperty (StringView key, PropertyType type) |
void | addPropertyData (PropertyInfo &p, const void *data, size_t size) |
uint8_t * | getPropertyData (const PropertyInfo &p) |
const uint8_t * | getPropertyData (const PropertyInfo &p) const |
PropertyAlloc | allocate (size_t propertySize) |
Private Attributes | |
Memory::TypedBuffer< PropertyInfo > | headers |
Memory::MemoryBuffer | data |
size_t | dataSize = 0 |
Container for Key-property values.
Note that there is no build-in thread safety. Note that there is not type casting getting values. Get will silently return default if type mismatch.
Definition at line 74 of file PropertiesManager.h.
Cogs::Core::PropertyStore::PropertyStore | ( | MemBlockType | memType = MemBlockType::PropertyStore | ) |
Definition at line 3 of file PropertiesManager.cpp.
Cogs::Core::PropertyStore::PropertyStore | ( | const PropertyStore & | other | ) |
Definition at line 10 of file PropertiesManager.cpp.
|
noexcept |
Definition at line 17 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | const PropertyStore & | other, |
uint32_t | otherIndex | ||
) |
Definition at line 494 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
bool | value | ||
) |
Definition at line 40 of file PropertiesManager.cpp.
|
inline |
Definition at line 99 of file PropertiesManager.h.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
const glm::vec3 & | values | ||
) |
Definition at line 180 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
double | value | ||
) |
Definition at line 54 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
float | value | ||
) |
Definition at line 47 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
int32_t | value | ||
) |
Definition at line 61 of file PropertiesManager.cpp.
|
private |
Definition at line 464 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
std::span< const double > | values | ||
) |
Definition at line 103 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
std::span< const float > | values | ||
) |
Definition at line 75 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
std::span< const int32_t > | values | ||
) |
Definition at line 124 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
std::span< const uint32_t > | values | ||
) |
Definition at line 152 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
StringRef | value | ||
) |
Definition at line 223 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
StringView | value | ||
) |
Definition at line 230 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::addProperty | ( | StringView | key, |
uint32_t | value | ||
) |
Definition at line 68 of file PropertiesManager.cpp.
|
private |
Definition at line 476 of file PropertiesManager.cpp.
|
private |
Definition at line 551 of file PropertiesManager.cpp.
|
inline |
Definition at line 143 of file PropertiesManager.h.
void Cogs::Core::PropertyStore::copyProperties | ( | const PropertyStore & | other, |
uint32_t | offset, | ||
uint32_t | count | ||
) |
Definition at line 515 of file PropertiesManager.cpp.
|
inline |
Definition at line 142 of file PropertiesManager.h.
uint32_t Cogs::Core::PropertyStore::findProperty | ( | StringView | key | ) | const |
Definition at line 309 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::findProperty | ( | uint32_t | first, |
uint32_t | count, | ||
StringRef | key | ||
) | const |
Definition at line 314 of file PropertiesManager.cpp.
|
inline |
Definition at line 138 of file PropertiesManager.h.
std::span< const double > Cogs::Core::PropertyStore::getDoubleArray | ( | const PropertyInfo & | p | ) | const |
Definition at line 379 of file PropertiesManager.cpp.
std::span< const double > Cogs::Core::PropertyStore::getDoubleArray | ( | uint32_t | index | ) | const |
Definition at line 392 of file PropertiesManager.cpp.
std::span< const float > Cogs::Core::PropertyStore::getFloatArray | ( | const PropertyInfo & | p | ) | const |
Definition at line 400 of file PropertiesManager.cpp.
std::span< float > Cogs::Core::PropertyStore::getFloatArray | ( | uint32_t | index | ) |
Definition at line 354 of file PropertiesManager.cpp.
std::span< const float > Cogs::Core::PropertyStore::getFloatArray | ( | uint32_t | index | ) | const |
Definition at line 371 of file PropertiesManager.cpp.
|
inline |
Definition at line 137 of file PropertiesManager.h.
std::span< const int32_t > Cogs::Core::PropertyStore::getIntArray | ( | const PropertyInfo & | p | ) | const |
Definition at line 416 of file PropertiesManager.cpp.
std::span< const int32_t > Cogs::Core::PropertyStore::getIntArray | ( | uint32_t | index | ) | const |
Definition at line 432 of file PropertiesManager.cpp.
Cogs::StringView Cogs::Core::PropertyStore::getKey | ( | const PropertyInfo & | p | ) | const |
Definition at line 325 of file PropertiesManager.cpp.
Cogs::Core::PropertyInfo & Cogs::Core::PropertyStore::getProperty | ( | StringRef | key | ) |
Definition at line 286 of file PropertiesManager.cpp.
Cogs::Core::PropertyInfo & Cogs::Core::PropertyStore::getProperty | ( | StringView | key | ) |
Definition at line 281 of file PropertiesManager.cpp.
bool Cogs::Core::PropertyStore::getProperty | ( | StringView | key, |
bool | defaultValue | ||
) |
Definition at line 185 of file PropertiesManager.cpp.
|
inline |
Definition at line 89 of file PropertiesManager.h.
float Cogs::Core::PropertyStore::getProperty | ( | StringView | key, |
float | defaultValue | ||
) |
Definition at line 194 of file PropertiesManager.cpp.
glm::vec3 Cogs::Core::PropertyStore::getProperty | ( | StringView | key, |
glm::vec3 | defaultValue | ||
) |
Definition at line 266 of file PropertiesManager.cpp.
int Cogs::Core::PropertyStore::getProperty | ( | StringView | key, |
int | defaultValue | ||
) |
Definition at line 204 of file PropertiesManager.cpp.
std::span< const float > Cogs::Core::PropertyStore::getProperty | ( | StringView | key, |
std::span< const float > | defaultValue | ||
) |
Definition at line 253 of file PropertiesManager.cpp.
Cogs::StringView Cogs::Core::PropertyStore::getProperty | ( | StringView | key, |
StringView | defaultValue | ||
) |
Definition at line 247 of file PropertiesManager.cpp.
uint32_t Cogs::Core::PropertyStore::getProperty | ( | StringView | key, |
uint32_t | defaultValue | ||
) |
Definition at line 214 of file PropertiesManager.cpp.
Cogs::Core::PropertyInfo & Cogs::Core::PropertyStore::getPropertyByIndex | ( | uint32_t | index | ) |
Definition at line 299 of file PropertiesManager.cpp.
const Cogs::Core::PropertyInfo & Cogs::Core::PropertyStore::getPropertyByIndex | ( | uint32_t | index | ) | const |
Definition at line 304 of file PropertiesManager.cpp.
|
private |
Definition at line 484 of file PropertiesManager.cpp.
|
private |
Definition at line 489 of file PropertiesManager.cpp.
Cogs::StringView Cogs::Core::PropertyStore::getString | ( | const PropertyInfo & | p | ) | const |
Definition at line 330 of file PropertiesManager.cpp.
Cogs::StringView Cogs::Core::PropertyStore::getString | ( | uint32_t | index | ) | const |
Definition at line 349 of file PropertiesManager.cpp.
std::span< const uint32_t > Cogs::Core::PropertyStore::getUIntArray | ( | const PropertyInfo & | p | ) | const |
Definition at line 440 of file PropertiesManager.cpp.
std::span< const uint32_t > Cogs::Core::PropertyStore::getUIntArray | ( | uint32_t | index | ) | const |
Definition at line 456 of file PropertiesManager.cpp.
|
inline |
Definition at line 116 of file PropertiesManager.h.
Cogs::Core::PropertyStore & Cogs::Core::PropertyStore::operator= | ( | const PropertyStore & | other | ) |
Definition at line 24 of file PropertiesManager.cpp.
|
noexcept |
Definition at line 32 of file PropertiesManager.cpp.
|
inline |
Definition at line 118 of file PropertiesManager.h.
|
private |
Definition at line 162 of file PropertiesManager.h.
|
private |
Definition at line 163 of file PropertiesManager.h.
|
private |
Definition at line 161 of file PropertiesManager.h.
|
staticconstexpr |
Return from findProperty if key not found.
Definition at line 77 of file PropertiesManager.h.