29 #ifndef STICHWORT_KEEPER_H_ 30 #define STICHWORT_KEEPER_H_ 37 namespace stichwort_internal
52 policy->copyFromValue(&value, &value_ptr);
62 policy->free(&value_ptr);
67 policy->clone(&(v.
value_ptr), &value_ptr);
72 policy->free(&value_ptr);
85 if (isTypeCorrect<T>())
87 void* vv = policy->getValue(const_cast<void**>(&value_ptr));
88 v =
reinterpret_cast<T*
>(vv);
98 return getPolicy<T>() == policy;
103 return getPolicy<EmptyType>() != policy;
106 template <
template<
class>
class F,
class Q>
109 Q value = getValue<Q>();
113 inline std::string
repr()
const 115 return policy->repr(const_cast<void**>(&value_ptr));
bool isInitialized() const
An exception type that is thrown in case of missed parameter, i.e. when some required parameter is no...
TypePolicyBase * getPolicy()
The namespace that contains implementations for the keywords.
ValueKeeper(const ValueKeeper &v)
ValueKeeper & operator=(const ValueKeeper &v)
ValueKeeper(const T &value)
An exception type that is thrown in case if wrong parameter value is passed.
bool isTypeCorrect() const
bool isCondition(F< Q > cond) const
virtual void clone(void *const *, void **) const =0