![]() |
Blue Brain BioExplorer
|
#include <PropertyMap.h>
Classes | |
struct | MetaData |
Public Types | |
enum class | Type { Int , Double , String , Bool , Vec2i , Vec2d , Vec3i , Vec3d , Vec4d } |
using | ModifiedCallback = std::function< void(const Property &)> |
Public Member Functions | |
template<typename T > | |
void | assertValidType () const |
template<typename T > | |
void | assertValidEnumType () const |
template<typename T > | |
Type | getType () const |
template<typename T > | |
Property (const std::string &name_, const T value, const MetaData &metaData_={}) | |
template<typename T > | |
Property (const std::string &name_, const T value, const T min_, const T max_, const MetaData &metaData_={}) | |
template<typename T > | |
Property (const std::string &name_, const T value, const std::vector< std::string > &enums_, const MetaData &metaData_) | |
Property (Property &&other) | |
Property (const Property &other)=default | |
void | onModified (const ModifiedCallback &callback) |
template<typename T > | |
void | set (const T &v) |
template<typename T > | |
T | get () const |
template<typename T > | |
T | min () const |
template<typename T > | |
T | max () const |
void | markReadOnly () |
bool | readOnly () const |
Static Public Member Functions | |
static Property | makeReadOnly (Property property) |
Public Attributes | |
const std::string | name |
const MetaData | metaData |
user-friendly name and description More... | |
const Type | type |
const std::vector< std::string > | enums |
Friends | |
class | PropertyMap |
Defines a single property which always has a name, a label for e.g. UIs and a typed value. Additionally, a user-defined minimum and maximum value range can be specified, otherwise the types' limits apply.
Definition at line 41 of file PropertyMap.h.
using core::Property::ModifiedCallback = std::function<void(const Property&)> |
Definition at line 167 of file PropertyMap.h.
|
strong |
Enumerator | |
---|---|
Int | |
Double | |
String | |
Bool | |
Vec2i | |
Vec2d | |
Vec3i | |
Vec3d | |
Vec4d |
Definition at line 43 of file PropertyMap.h.
|
inline |
Definition at line 113 of file PropertyMap.h.
|
inline |
Definition at line 125 of file PropertyMap.h.
|
inline |
Specialized for enum properties, the possible enum values are passed in enums_.
Definition at line 141 of file PropertyMap.h.
|
inline |
Definition at line 153 of file PropertyMap.h.
|
default |
|
inline |
Definition at line 81 of file PropertyMap.h.
|
inline |
Definition at line 68 of file PropertyMap.h.
|
inline |
Definition at line 183 of file PropertyMap.h.
|
inline |
Definition at line 87 of file PropertyMap.h.
Definition at line 213 of file PropertyMap.h.
|
inline |
Read-only property shall not be modified from the outside aka web API via JSON.
Definition at line 207 of file PropertyMap.h.
|
inline |
Definition at line 197 of file PropertyMap.h.
|
inline |
Definition at line 190 of file PropertyMap.h.
|
inline |
Set a function that is called after this property has been changed.
Definition at line 172 of file PropertyMap.h.
|
inline |
Definition at line 208 of file PropertyMap.h.
|
inline |
Definition at line 175 of file PropertyMap.h.
|
friend |
Definition at line 226 of file PropertyMap.h.
const std::vector<std::string> core::Property::enums |
Name of enum values that are mapped to the integer value
Definition at line 223 of file PropertyMap.h.
const MetaData core::Property::metaData |
user-friendly name and description
Definition at line 210 of file PropertyMap.h.
const std::string core::Property::name |
Definition at line 209 of file PropertyMap.h.
const Type core::Property::type |
Definition at line 211 of file PropertyMap.h.