diff options
Diffstat (limited to 'core/property_access.hpp')
-rw-r--r-- | core/property_access.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/core/property_access.hpp b/core/property_access.hpp new file mode 100644 index 0000000..19016e9 --- /dev/null +++ b/core/property_access.hpp @@ -0,0 +1,32 @@ +#ifndef VIp1Hrkjsl2bQTTqbsZf9mqNsWY +#define VIp1Hrkjsl2bQTTqbsZf9mqNsWY + +#include "pla_get.hpp" +#include "context.hpp" + +template <typename Prop> +struct Property_Get { + template<typename PropComp, typename Context> + static inline typename Prop::type eval(PropComp &pc, Context context) __attribute__ ((pure)); + + template<typename PropComp, typename Context> + static inline typename Prop::type eval(PropComp &pc, Context context, Time t) __attribute__ ((pure)); +}; + +template <typename Prop> +template<typename PropComp, typename Context> +inline typename Prop::type Property_Get<Prop>::eval(PropComp &pc, Context context) { + PLA_Get<Prop, Context> action(context); + return pc.call(action); +} + +template <typename Prop> +template<typename PropComp, typename Context> +inline typename Prop::type Property_Get<Prop>::eval(PropComp &pc, Context context, Time t) { + PLA_Get<Prop, Context> action(t, context); + return pc.call(action); +} + + + +#endif // VIp1Hrkjsl2bQTTqbsZf9mqNsWY |