Base class to provide array of properties. More...

#include <Array.h>

Inheritance diagram for ConfigDB::Array:
Collaboration diagram for ConfigDB::Array:

Public Member Functions

unsigned getPropertyCount () const
 
Property getProperty (unsigned index)
 
Property addItem ()
 
Property insertItem (unsigned index)
 
PropertyConst getProperty (unsigned index) const
 
const PropertyInfogetItemType () const
 
- Public Member Functions inherited from ConfigDB::ArrayBase
unsigned getItemCount () const
 
bool removeItem (unsigned index)
 
void * getItem (unsigned index)
 
const void * getItem (unsigned index) const
 
void addItem (const void *value)
 
void clear ()
 
void dispose ()
 
 Object ()
 
 Object (const Object &other)
 
 Object (Object &&)=delete
 
 Object (const PropertyInfo &propinfo)
 
 Object (Object &parent, const PropertyInfo &prop, uint16_t dataRef)
 
 Object (const Object &parent, const PropertyInfo &prop, uint16_t dataRef)
 
 Object (Object &parent, unsigned propIndex, uint16_t dataRef=0)
 
 Object (const Object &parent, unsigned propIndex, uint16_t dataRef=0)
 
- Public Member Functions inherited from ConfigDB::Object
 Object ()
 
 Object (const Object &other)
 
 Object (Object &&)=delete
 
Objectoperator= (const Object &other)
 
 Object (const PropertyInfo &propinfo)
 
 Object (Object &parent, const PropertyInfo &prop, uint16_t dataRef)
 
 Object (const Object &parent, const PropertyInfo &prop, uint16_t dataRef)
 
 Object (Object &parent, unsigned propIndex, uint16_t dataRef=0)
 
 Object (const Object &parent, unsigned propIndex, uint16_t dataRef=0)
 
 operator bool () const
 
bool typeIs (ObjectType type) const
 
bool isArray () const
 
bool isStore () const
 Determine if this object is a store (not just a reference to it) More...
 
StoregetStore ()
 
const StoregetStore () const
 
DatabasegetDatabase ()
 
const DatabasegetDatabase () const
 
unsigned getObjectCount () const
 Get number of child objects. More...
 
Object getObject (unsigned index)
 Get child object by index. More...
 
const Object getObject (unsigned index) const
 
Object findObject (const char *name, size_t length)
 Find child object by name. More...
 
unsigned getPropertyCount () const
 Get number of properties. More...
 
Property getProperty (unsigned index)
 Get properties. More...
 
PropertyConst getProperty (unsigned index) const
 
Property findProperty (const char *name, size_t length)
 Find property by name. More...
 
void clear ()
 Reset contents to defaults (except arrays, which are cleared) More...
 
void loadArrayDefaults ()
 Clear and load all contained arrays with defaults from schema. More...
 
void resetToDefaults ()
 Does a 'clear' followed by 'loadArrayDefaults'. More...
 
bool commit ()
 Commit changes to the store. More...
 
void clearDirty ()
 Clear store dirty flag so changes don't get committed. More...
 
String getName () const
 
String getPath () const
 
size_t printTo (Print &p) const
 Support standard streaming output of this object's content in prettified JSON. More...
 
bool exportToStream (const Format &format, Print &output, const ExportOptions &options={}) const
 Export object to an output stream. More...
 
bool exportToFile (const Format &format, const String &filename, const ExportOptions &options={}) const
 Export object to an output stream. More...
 
Status importFromStream (const Format &format, Stream &source)
 Import content to this object. More...
 
Status importFromFile (const Format &format, const String &filename)
 Import content to this object. More...
 
const PropertyInfopropinfo () const
 
const ObjectInfotypeinfo () const
 
PropertyDatagetPropertyData (unsigned index)
 
const PropertyDatagetPropertyData (unsigned index) const
 
void queueUpdate (UpdateCallback callback)
 Called from OuterObjectTemplate::update to queue an update. More...
 

Protected Member Functions

void loadDefaults ()
 
StringId getStringId (const String &value)
 
void addItem (const void *value)
 
void insertItem (unsigned index, const void *value)
 
void setItem (unsigned index, const void *value)
 
int indexOf (const void *value) const
 
- Protected Member Functions inherited from ConfigDB::ArrayBase
ArrayIdgetId ()
 
ArrayId getId () const
 
ArrayDatagetArray ()
 
const ArrayDatagetArray () const
 
- Protected Member Functions inherited from ConfigDB::Object
StoreRef openStore (Database &db, unsigned storeIndex)
 
StoreUpdateRef openStoreForUpdate (Database &db, unsigned storeIndex)
 
void disposeArrays ()
 
void initArrays ()
 
bool isWriteable () const
 
StoreUpdateRef lockStore (StoreRef &store)
 
bool writeCheck () const
 
void * getDataPtr ()
 
const void * getDataPtr () const
 
String getPropertyString (unsigned index, StringId id) const
 
String getPropertyString (unsigned index) const
 
StringId getStringId (const PropertyInfo &prop, const char *value, uint16_t valueLength)
 
StringId getStringId (const PropertyInfo &prop, const String &value)
 
template<typename T >
StringId getStringId (const PropertyInfo &prop, const T &value)
 
int findStringId (const char *value, uint16_t valueLength) const
 
void setPropertyValue (unsigned index, const void *value)
 
void setPropertyValue (unsigned index, const String &value)
 

Friends

class Object
 

Additional Inherited Members

- Public Types inherited from ConfigDB::Object
using UpdateCallback = Delegate< void(Store &store)>
 Callback invoked by asynchronous updater. More...
 
- Public Attributes inherited from ConfigDB::Object
uint16_t streamPos {}
 
- Protected Attributes inherited from ConfigDB::Object
const PropertyInfopropinfoPtr
 
Objectparent {}
 
uint16_t dataRef {}
 

Detailed Description

Base class to provide array of properties.

Member Function Documentation

◆ addItem() [1/2]

Property ConfigDB::Array::addItem ( )
inline

◆ addItem() [2/2]

void ConfigDB::Array::addItem ( const void *  value)
inlineprotected

◆ getItemType()

const PropertyInfo& ConfigDB::Array::getItemType ( ) const
inline

◆ getProperty() [1/2]

Property ConfigDB::Array::getProperty ( unsigned  index)
inline

◆ getProperty() [2/2]

PropertyConst ConfigDB::Array::getProperty ( unsigned  index) const
inline

◆ getPropertyCount()

unsigned ConfigDB::Array::getPropertyCount ( ) const
inline

◆ getStringId()

StringId ConfigDB::Array::getStringId ( const String value)
inlineprotected

◆ indexOf()

int ConfigDB::Array::indexOf ( const void *  value) const
inlineprotected

◆ insertItem() [1/2]

Property ConfigDB::Array::insertItem ( unsigned  index)
inline

◆ insertItem() [2/2]

void ConfigDB::Array::insertItem ( unsigned  index,
const void *  value 
)
inlineprotected

◆ loadDefaults()

void ConfigDB::Array::loadDefaults ( )
protected

◆ setItem()

void ConfigDB::Array::setItem ( unsigned  index,
const void *  value 
)
inlineprotected

Friends And Related Function Documentation

◆ Object

friend class Object
friend

The documentation for this class was generated from the following file: