34 #ifndef _Wolframe_TYPES_CUSTOM_DATA_NORMALIZER_HPP_INCLUDED
35 #define _Wolframe_TYPES_CUSTOM_DATA_NORMALIZER_HPP_INCLUDED
61 ,
m_initializer(type_->hasInitializer()?type_->createInitializer(arg):0)
65 throw std::runtime_error(
"arguments passed to custom data type without initializer defined");
76 virtual const char*
name()
const
129 virtual const char*
name()
const
139 if (!method)
throw std::logic_error(
"internal: calling undefined method");
140 return method( *cv,
m_arg);
const Data & data() const
Get the internal representation of the data of this.
Definition: variant.hpp:193
virtual ~CustomDataMethodCallNormalizer()
Definition: customDataNormalizer.hpp:126
Initializer for a custom data value.
Definition: customDataType.hpp:94
Normalize function definition.
std::vector< types::Variant > m_arg
Definition: customDataNormalizer.hpp:150
Custom data type interface for variant.
types::Variant execute(const types::Variant &i) const
Implementation of types::NormalizeFunction::execute(const types::Variant&)const.
Definition: customDataNormalizer.hpp:88
types::Variant(* CustomDataValueMethod)(const CustomDataValue &val, const std::vector< types::Variant > &arg)
Definition: customDataType.hpp:144
CustomDataValueMethod getMethod(const std::string &methodname) const
types::CustomDataInitializer * m_initializer
Definition: customDataNormalizer.hpp:107
Custom data value.
Definition: customDataType.hpp:65
const types::CustomDataType * m_type
Definition: customDataNormalizer.hpp:106
const CustomDataType * type() const
Definition: customDataType.hpp:74
CustomDataMethodCallNormalizer(const CustomDataMethodCallNormalizer &o)
Definition: customDataNormalizer.hpp:117
CustomDataValue * Custom
custom data type reference
Definition: variant.hpp:118
Basic normalization function for atomic values (variant type)
Definition: normalizeFunction.hpp:52
Forward declaration.
Definition: variant.hpp:65
bool hasInitializer() const
Definition: customDataType.hpp:180
virtual const char * name() const
Implementation of types::NormalizeFunction::name()const.
Definition: customDataNormalizer.hpp:76
const CustomDataValue * customref() const
Get the pointer to the custom data object (throws for non custom data type)
Definition: variant.hpp:201
Custom Data Type Definition.
Definition: customDataType.hpp:105
Normalizer function created from a custom data type initializer.
Definition: customDataNormalizer.hpp:47
virtual types::NormalizeFunction * copy() const
Definition: customDataNormalizer.hpp:143
CustomDataNormalizer(const std::string &name_, const std::vector< types::Variant > &arg, const types::CustomDataType *type_)
Constructor.
Definition: customDataNormalizer.hpp:58
CustomDataMethodCallNormalizer(const std::string &name_, const std::vector< types::Variant > &arg_)
Definition: customDataNormalizer.hpp:121
union _Wolframe::types::Variant::Data::@17 value
value of the variant
virtual types::NormalizeFunction * copy() const
Implementation of types::NormalizeFunction::copy()const.
Definition: customDataNormalizer.hpp:99
virtual const char * name() const
Definition: customDataNormalizer.hpp:129
virtual void assign(const Variant &o)=0
Normalizer function created from a custom data method call.
Definition: customDataNormalizer.hpp:113
bool defined() const
Test if this value is defined (not null)
Definition: variant.hpp:238
types::Variant execute(const types::Variant &i) const
Definition: customDataNormalizer.hpp:134
CustomDataNormalizer(const CustomDataNormalizer &o)
Copy constructor.
Definition: customDataNormalizer.hpp:52
const types::CustomDataType * type() const
Get the custom data type.
Definition: customDataNormalizer.hpp:82
std::string m_name
Definition: customDataNormalizer.hpp:105
virtual ~CustomDataNormalizer()
Destructor.
Definition: customDataNormalizer.hpp:70
std::string m_name
Definition: customDataNormalizer.hpp:149