Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
DekiProperty.h File Reference

Classes

struct  DekiFieldRef
 Compact field descriptor — the ONE piece of reflection that exists on every platform, embedded included. More...
struct  DekiPropertyInfo
 Property metadata (stored per-component-type, not per-instance). More...
struct  DekiComponentMeta
 Component metadata for runtime reflection. More...

Macros

#define DEKI_EXPORT
#define DEKI_EDITOR_ONLY
#define DEKI_TOOLTIP(text)
#define DEKI_TOGGLE_OBJECT(field)
#define DEKI_VISIBLE_WHEN(prop, ...)
#define DEKI_VISIBLE_WHEN_RANGE(prop, minVal, maxVal)
#define DEKI_RANGE(minVal, maxVal)
#define DEKI_SLIDER(minVal, maxVal)
#define DEKI_GROUP(name)
#define DEKI_OBJECT_NAME(...)
#define DEKI_VALUE_OF(prop)
#define DEKI_UNIT(unit)
#define DEKI_RENAMED_FROM(oldName)
#define DEKI_PROJECT_SETTINGS_SECTION(SectionName)
#define DEKI_SERIALIZABLE
#define DEKI_NO_SERIALIZE
#define DEKI_SERIALIZABLE_NAME(name)
#define DEKI_SERIALIZABLE_DEFAULT_VALUE(val)
#define DEKI_REFLECTION_DECLARATIONS()
#define DEKI_COMPONENT_BASE(BaseTypeName, Category)
#define DEKI_COMPONENT(TypeName, BaseTypeName, Category, TypeGuid, FeatureDefine)
#define DEKI_DISPLAY_NAME(name)
#define DEKI_DESCRIPTION(text)
#define DEKI_NODE_REFLECTION_DECLARATIONS()
#define DEKI_NODE(TypeName, NodeName, Category)
#define DEKI_NODE_INPUTS(...)
#define DEKI_NODE_OUTPUTS(...)
#define DEKI_NODE_DYNAMIC_OUTPUTS(PropName)
#define DEKI_NODE_CHILDREN(Category)
#define DEKI_NODE_SUBGRAPH(ContentCategory, EntryTypeName)
#define DEKI_NODE_TITLE_PROPERTY(PropName)
#define DEKI_NODE_PERMANENT()
#define DEKI_NODE_VARIABLES()

Enumerations

enum class  DekiPhysicalUnit : uint8_t {
  None = 0 , Distance , Velocity , Acceleration ,
  Angle
}
 Physical unit for float/DekiVector2 properties. More...
enum class  DekiPropertyType : uint8_t {
  Int8 , Int16 , Int32 , Int64 ,
  UInt8 , UInt16 , UInt32 , UInt64 ,
  Float , Double , Bool , String ,
  Color , Vector2 , Vector3 , Asset ,
  Enum , ObjectRef , Array , AssetRef ,
  NodeRef , PropertyRef
}
 Property types for runtime reflection. More...

Functions

template<typename T>
T & GetPropertyRef (DekiComponent *comp, const DekiPropertyInfo &prop)
template<typename T>
const T & GetPropertyRef (const DekiComponent *comp, const DekiPropertyInfo &prop)
template<typename T>
GetPropertyValue (const DekiComponent *comp, const DekiPropertyInfo &prop)
template<typename T>
void SetPropertyValue (DekiComponent *comp, const DekiPropertyInfo &prop, const T &value)
template<typename T>
T & GetNodePropertyRef (void *base, const DekiPropertyInfo &prop)
template<typename T>
const T & GetNodePropertyRef (const void *base, const DekiPropertyInfo &prop)

Macro Definition Documentation

◆ DEKI_EXPORT

#define DEKI_EXPORT

◆ DEKI_EDITOR_ONLY

#define DEKI_EDITOR_ONLY

◆ DEKI_TOOLTIP

#define DEKI_TOOLTIP ( text)

◆ DEKI_TOGGLE_OBJECT

#define DEKI_TOGGLE_OBJECT ( field)

◆ DEKI_VISIBLE_WHEN

#define DEKI_VISIBLE_WHEN ( prop,
... )

◆ DEKI_VISIBLE_WHEN_RANGE

#define DEKI_VISIBLE_WHEN_RANGE ( prop,
minVal,
maxVal )

◆ DEKI_RANGE

#define DEKI_RANGE ( minVal,
maxVal )

◆ DEKI_SLIDER

#define DEKI_SLIDER ( minVal,
maxVal )

◆ DEKI_GROUP

#define DEKI_GROUP ( name)

◆ DEKI_OBJECT_NAME

#define DEKI_OBJECT_NAME ( ...)

◆ DEKI_VALUE_OF

#define DEKI_VALUE_OF ( prop)

◆ DEKI_UNIT

#define DEKI_UNIT ( unit)

◆ DEKI_RENAMED_FROM

#define DEKI_RENAMED_FROM ( oldName)

◆ DEKI_PROJECT_SETTINGS_SECTION

#define DEKI_PROJECT_SETTINGS_SECTION ( SectionName)
Value:
public: static constexpr const char* StaticSettingsSection = SectionName;

◆ DEKI_SERIALIZABLE

#define DEKI_SERIALIZABLE

◆ DEKI_NO_SERIALIZE

#define DEKI_NO_SERIALIZE

◆ DEKI_SERIALIZABLE_NAME

#define DEKI_SERIALIZABLE_NAME ( name)

◆ DEKI_SERIALIZABLE_DEFAULT_VALUE

#define DEKI_SERIALIZABLE_DEFAULT_VALUE ( val)

◆ DEKI_REFLECTION_DECLARATIONS

#define DEKI_REFLECTION_DECLARATIONS ( )
Value:
static const DekiPropertyInfo* GetProperties(); \
static int GetPropertyCount(); \
static const DekiComponentMeta& GetComponentMeta();
Component metadata for runtime reflection.
Definition DekiProperty.h:336
Property metadata (stored per-component-type, not per-instance).
Definition DekiProperty.h:266

◆ DEKI_COMPONENT_BASE

#define DEKI_COMPONENT_BASE ( BaseTypeName,
Category )
Value:
static constexpr ComponentType BaseStaticType = BaseTypeName::StaticType; \
static constexpr const char* ComponentCategory = Category; \
ComponentType GetType() const override { return StaticType; } \
ComponentType GetBaseType() const override { return BaseStaticType; } \
bool Deserialize(SceneFormat::SceneMsgPackParser& parser, uint32_t mapSize) override; \
void ResolveObjectRefs(class Scene* scene) override; \
void RemapObjectRefs(const std::unordered_map<uint32_t, uint32_t>& idRemap) override; \
bool DeclaresUpdate() const override; \
static const DekiFieldRef* GetFields(); \
static int GetFieldCount(); \
DEKI_REFLECTION_DECLARATIONS()
uint32_t ComponentType
Type alias for component type identification.
Definition DekiComponent.h:9
T Deserialize(const nlohmann::json &j)

◆ DEKI_COMPONENT

#define DEKI_COMPONENT ( TypeName,
BaseTypeName,
Category,
TypeGuid,
FeatureDefine )
Value:
public: \
static constexpr ComponentType StaticType = DekiHashString(TypeGuid); \
static constexpr const char* StaticGuid = TypeGuid; \
static constexpr const char* StaticFeatureDefine = FeatureDefine; \
DEKI_COMPONENT_BASE(BaseTypeName, Category)
constexpr uint32_t DekiHashString(const char *str, uint32_t hash=2166136261u)
Compile-time string hash for consistent type IDs across translation units.
Definition DekiComponent.h:22

◆ DEKI_DISPLAY_NAME

#define DEKI_DISPLAY_NAME ( name)
Value:
public: \
static constexpr const char* StaticDisplayName = name;

◆ DEKI_DESCRIPTION

#define DEKI_DESCRIPTION ( text)
Value:
public: \
static constexpr const char* StaticDescription = text;

◆ DEKI_NODE_REFLECTION_DECLARATIONS

#define DEKI_NODE_REFLECTION_DECLARATIONS ( )
Value:
static const DekiPropertyInfo* GetProperties(); \
static int GetPropertyCount(); \
static const DekiNodeMeta& GetNodeMeta();

◆ DEKI_NODE

#define DEKI_NODE ( TypeName,
NodeName,
Category )
Value:
public: \
static constexpr const char* StaticNodeName = NodeName; \
static constexpr const char* StaticNodeCategory = Category; \
DEKI_NODE_REFLECTION_DECLARATIONS()

◆ DEKI_NODE_INPUTS

#define DEKI_NODE_INPUTS ( ...)
Value:
public: \
static constexpr const char* StaticInputPins[] = { __VA_ARGS__ }; \
static constexpr int StaticInputPinCount = \
(int)(sizeof(StaticInputPins) / sizeof(StaticInputPins[0]));

◆ DEKI_NODE_OUTPUTS

#define DEKI_NODE_OUTPUTS ( ...)
Value:
public: \
static constexpr const char* StaticOutputPins[] = { __VA_ARGS__ }; \
static constexpr int StaticOutputPinCount = \
(int)(sizeof(StaticOutputPins) / sizeof(StaticOutputPins[0]));

◆ DEKI_NODE_DYNAMIC_OUTPUTS

#define DEKI_NODE_DYNAMIC_OUTPUTS ( PropName)
Value:
public: \
static constexpr const char* StaticDynamicOutputsProperty = PropName;

◆ DEKI_NODE_CHILDREN

#define DEKI_NODE_CHILDREN ( Category)
Value:
public: \
static constexpr const char* StaticNodeChildCategory = Category;

◆ DEKI_NODE_SUBGRAPH

#define DEKI_NODE_SUBGRAPH ( ContentCategory,
EntryTypeName )
Value:
public: \
static constexpr const char* StaticNodeSubgraphCategory = ContentCategory; \
static constexpr const char* StaticNodeSubgraphEntry = EntryTypeName;

◆ DEKI_NODE_TITLE_PROPERTY

#define DEKI_NODE_TITLE_PROPERTY ( PropName)
Value:
public: \
static constexpr const char* StaticNodeTitleProperty = PropName;

◆ DEKI_NODE_PERMANENT

#define DEKI_NODE_PERMANENT ( )
Value:
public: \
static constexpr bool StaticNodePermanent = true;

◆ DEKI_NODE_VARIABLES

#define DEKI_NODE_VARIABLES ( )
Value:
public: \
static constexpr bool StaticNodeVariables = true;

Enumeration Type Documentation

◆ DekiPhysicalUnit

enum class DekiPhysicalUnit : uint8_t
strong

Physical unit for float/DekiVector2 properties.

Internal storage is always meters. Inspector applies a display conversion based on the project's inspectorUnit setting:

  • inspectorUnit == Meters: display value == stored value (suffix m / m/s / m/s²).
  • inspectorUnit == Pixels: displayed value = stored * pixelsPerMeter (suffix px / px/s / px/s²).

Only meaningful on Float and DekiVector2 property types.

Enumerator
None 
Distance 
Velocity 
Acceleration 
Angle 

◆ DekiPropertyType

enum class DekiPropertyType : uint8_t
strong

Property types for runtime reflection.

Enumerator
Int8 
Int16 
Int32 
Int64 
UInt8 
UInt16 
UInt32 
UInt64 
Float 
Double 
Bool 
String 
Color 
Vector2 
Vector3 
Asset 
Enum 
ObjectRef 
Array 
AssetRef 
NodeRef 
PropertyRef 

Function Documentation

◆ GetPropertyRef() [1/2]

template<typename T>
T & GetPropertyRef ( DekiComponent * comp,
const DekiPropertyInfo & prop )
inline

◆ GetPropertyRef() [2/2]

template<typename T>
const T & GetPropertyRef ( const DekiComponent * comp,
const DekiPropertyInfo & prop )
inline

◆ GetPropertyValue()

template<typename T>
T GetPropertyValue ( const DekiComponent * comp,
const DekiPropertyInfo & prop )
inline

◆ SetPropertyValue()

template<typename T>
void SetPropertyValue ( DekiComponent * comp,
const DekiPropertyInfo & prop,
const T & value )
inline

◆ GetNodePropertyRef() [1/2]

template<typename T>
T & GetNodePropertyRef ( void * base,
const DekiPropertyInfo & prop )
inline

◆ GetNodePropertyRef() [2/2]

template<typename T>
const T & GetNodePropertyRef ( const void * base,
const DekiPropertyInfo & prop )
inline