diff options
author | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
commit | 420d2ef464d4a741028e132e662d5626806a41f5 (patch) | |
tree | 1aca6eb512e4ed0fb5f3c10c528cb998b6ffd695 /core/property_access.hpp |
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 |