3#include "../Reflection/Attributes.h"
7 namespace ComponentModel
24 Reflection::Attribute::get<T>(0) = value;
28 T
getValue()
const {
return Reflection::Attribute::get<T>(0); }
47 Reflection::Attribute::get<T>(0) = min;
48 Reflection::Attribute::get<T>(1) = max;
52 T
getMin()
const {
return Reflection::Attribute::get<T>(0); }
55 T
getMax()
const {
return Reflection::Attribute::get<T>(1); }
73 Reflection::Attribute::get<T>(0) = value;
77 T
getStepValue()
const {
return Reflection::Attribute::get<T>(0); }
99#if !defined( EMSCRIPTEN )
103 Attribute::get<StringView>(0) = text;
128template<>
inline Cogs::StringView getName<Cogs::ComponentModel::StepSizeAttribute<float>>() {
return "StepSizeAttribute"; }
129template<>
inline Cogs::StringView getName<Cogs::ComponentModel::RangeAttribute<float>>() {
return "RangeAttribute"; }
130template<>
inline Cogs::StringView getName<Cogs::ComponentModel::RangeAttribute<int>>() {
return "RangeAttribute"; }
131template<>
inline Cogs::StringView getName<Cogs::ComponentModel::RangeAttribute<uint32_t>>() {
return "RangeAttribute"; }
132template<>
inline Cogs::StringView getName<Cogs::ComponentModel::DefaultValueAttribute<float>>() {
return "DefaultValueAttribute"; }
133template<>
inline Cogs::StringView getName<Cogs::ComponentModel::DefaultValueAttribute<uint32_t>>() {
return "DefaultValueAttribute"; }
134template<>
inline Cogs::StringView getName<Cogs::ComponentModel::DefaultValueAttribute<int32_t>>() {
return "DefaultValueAttribute"; }
135template<>
inline Cogs::StringView getName<Cogs::ComponentModel::DefaultValueAttribute<double>>() {
return "DefaultValueAttribute"; }
136template<>
inline Cogs::StringView getName<Cogs::ComponentModel::DescriptionAttribute>() {
return "DescriptionAttribute"; }
137template<>
inline Cogs::StringView getName<Cogs::ComponentModel::ColorAttribute>() {
return "ColorAttribute"; }
138template<>
inline Cogs::StringView getName<Cogs::ComponentModel::SerializableAttribute>() {
return "SerializableAttribute"; }
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.
Tags an object as being able to represent a color.
Adds default value information to an object.
DefaultValueAttribute(T value)
Constructs a default value attribute from the given value.
T getValue() const
Get the default value.
Adds a description to an object.
DescriptionAttribute(StringView text)
Constructs a description from the given text string.
const StringView & getValue() const
Get the description text string.
Adds range information to an object.
RangeAttribute(T min, T max)
Constructs a range attribute with the given bounds.
T getMax() const
Get the maximum value of the range.
T getMin() const
Get the minimum value of the range.
Tags an object as being possible to serialize.
Adds step size information to an object.
T getStepValue() const
Get the Step value.
StepSizeAttribute(T value)
Constructs a step value attribute from the given value.
Base attribute type for generic attributes.
Base attribute type for regular attributes.
RegularAttribute(bool runtime=true)
Construct a regular attribute. True if runtime attribute.