1 #ifndef GRAIL_OBJECT_PARAMETER_H
2 #define GRAIL_OBJECT_PARAMETER_H
4 #include "../../../GrailCore/consts.h"
5 #include "../../../GrailLogger/LoggerManager.hh"
21 template <
typename ParameterType>
22 const ParameterType& GetValue()
const
24 if(type != std::type_index{
typeid(ParameterType)})
26 GRAIL_LOG(consts::DEFAULT_GRAIL_LOG_GROUP,
28 "Getting value with inappriopriate type\n");
31 return *(
static_cast<const ParameterType*
>(GetUncastValue()));
34 template <
typename ParameterType>
35 void SetValue(
const ParameterType& value)
37 if(type != std::type_index{
typeid(ParameterType)})
39 GRAIL_LOG(consts::DEFAULT_GRAIL_LOG_GROUP,
41 "Setting value with inappriopriate type\n");
44 ParameterType* val =
static_cast<ParameterType*
>(GetUncastValue());
64 virtual const void* GetUncastValue()
const = 0;
65 virtual void* GetUncastValue() = 0;
72 #endif //GRAIL_OBJECT_PARAMETER_H