31 #define CONFIGDB_PROPERTY_TYPE_MAP(XX) \
42 XX(String, sizeof(StringId)) \
43 XX(Object, sizeof(ObjectInfo*)) \
51 #define XX(name, ...) name,
66 #define XX(tag, size) \
67 case PropertyType::tag: \
102 template <
typename T> T
getValue(uint8_t index)
const
104 return getArray<T>()[index];
119 return T(range.random());
158 explicit operator bool()
const
160 return this != &
empty;
165 if(
type == PropertyType::String) {
#define CONFIGDB_PROPERTY_TYPE_MAP(XX)
Property types with storage size.
Definition: PropertyInfo.h:31
String toString(ConfigDB::PropertyType type)
Support random() for ranges of enumerated types.
Definition: PropertyInfo.h:112
T random() const
Definition: PropertyInfo.h:116
Class to access an array of integral values stored in flash.
Definition: Array.hpp:124
Used when defining data structures.
Definition: ObjectBase.hpp:33
constexpr const ObjectType & as() const
Cast to a different object type.
Definition: ObjectBase.hpp:60
constexpr size_t length() const
Get the length of the object data in bytes.
Definition: ObjectBase.hpp:38
describes a counted string stored in flash memory
Definition: String.hpp:174
Class to access a Vector of objects stored in flash.
Definition: Vector.hpp:110
The String class.
Definition: WString.h:133
#define DEFINE_FSTR_LOCAL(name, str)
Like DEFINE_FSTR except reference is declared static constexpr.
Definition: String.hpp:84
XX(name, extensionStart, mime)
PropertyType
Definition: PropertyInfo.h:50
uint8_t getPropertySize(PropertyType type)
Definition: PropertyInfo.h:63
uint16_t StringId
Defines contained string data using index into string pool.
Definition: PropertyInfo.h:59
Definition: PropertyInfo.h:75
const FSTR::Array< T > & getArray() const
Definition: PropertyInfo.h:92
const FSTR::Vector< FSTR::String > & getStrings() const
Definition: PropertyInfo.h:97
unsigned length() const
Definition: PropertyInfo.h:84
PropertyType type
The actual store type for this enum (String, etc.)
Definition: PropertyInfo.h:76
int find(const char *value, unsigned length) const
T getValue(uint8_t index) const
Definition: PropertyInfo.h:102
String getString(uint8_t index) const
FSTR::ObjectBase values
Definition: PropertyInfo.h:77
uint8_t getItemSize() const
Definition: PropertyInfo.h:79
Definition: ObjectInfo.h:38
Property metadata.
Definition: PropertyInfo.h:126
static const PropertyInfo empty
Definition: PropertyInfo.h:156
int findObject(const char *name, unsigned length) const
Find named object information.
bool isStringType() const
Definition: PropertyInfo.h:163
int findProperty(const char *name, unsigned length) const
Find named object information.
uint32_t offset
Location of property data in parent object, OR Alias property index.
Definition: PropertyInfo.h:153
const PropertyInfo & getObject(unsigned index) const
Get child object by index.
uint8_t getSize() const
Get number of bytes required to store this property value within a structure.
Definition: PropertyInfo.h:177
Variant variant
Definition: PropertyInfo.h:154
PropertyType type
Definition: PropertyInfo.h:151
const FlashString & name
Definition: PropertyInfo.h:152
Manage a range of numbers between specified limits.
Definition: Range.h:22
T min
Definition: Range.h:23
T max
Definition: Range.h:24
Definition: PropertyInfo.h:137
const RangeNumber * number
Definition: PropertyInfo.h:141
const RangeUInt16 * uint16
Definition: PropertyInfo.h:147
const ObjectInfo * object
Definition: PropertyInfo.h:139
const EnumInfo * enuminfo
Definition: PropertyInfo.h:140
const RangeInt8 * int8
Definition: PropertyInfo.h:142
const RangeInt16 * int16
Definition: PropertyInfo.h:143
const RangeInt64 * int64
Definition: PropertyInfo.h:145
const RangeInt32 * int32
Definition: PropertyInfo.h:144
const FlashString * defaultString
Definition: PropertyInfo.h:138
const RangeUInt8 * uint8
Definition: PropertyInfo.h:146
const RangeUInt32 * uint32
Definition: PropertyInfo.h:148