1 #ifndef GRAIL_OBJECT_PARAMETER_H
2 #define GRAIL_OBJECT_PARAMETER_H
4 #include "../../../GrailCore/consts.h"
5 #include "../../../GrailCore/Logger/LoggerManager.hh"
20 template<
typename ParameterType>
21 const ParameterType& GetValue()
const
23 if (type != std::type_index{
typeid(ParameterType) })
24 GRAIL_LOG(consts::DEFAULT_GRAIL_LOG_GROUP, Severity::CRITICAL,
"Getting value with inappriopriate type\n");
26 return *(
static_cast<const ParameterType*
>(GetUncastValue()));
29 template<
typename ParameterType>
30 void SetValue(
const ParameterType& value)
32 if (type != std::type_index{
typeid(ParameterType) })
33 GRAIL_LOG(consts::DEFAULT_GRAIL_LOG_GROUP, Severity::CRITICAL,
"Setting value with inappriopriate type\n");
35 ParameterType* val =
static_cast<ParameterType*
>(GetUncastValue());
55 virtual const void* GetUncastValue()
const = 0;
56 virtual void* GetUncastValue() = 0;
The MemoryPool class - preallocated memory container for optimization issues.
Definition: MemoryPool.hh:74
Definition: ObjectParameter.h:18