diff options
Diffstat (limited to 'core/property_composition.hpp')
-rw-r--r-- | core/property_composition.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/core/property_composition.hpp b/core/property_composition.hpp new file mode 100644 index 0000000..39b6984 --- /dev/null +++ b/core/property_composition.hpp @@ -0,0 +1,35 @@ +#ifndef XDTdAXIBNQWHy4pABnW9tvtXRks +#define XDTdAXIBNQWHy4pABnW9tvtXRks + +#include <boost/mpl/bool.hpp> +#include <boost/utility.hpp> + +#include "pla_get.hpp" +#include "property_list.hpp" + +template <typename PropList> +struct PropertyComposition : boost::noncopyable { + // your endless journey has come to an end. down here lies the + // ACTUAL INSTANCE of the entire simulation! + typedef PropList properties_t; + PL<properties_t> properties; + + /// data access + // call: return value of action is of interest + template<typename Action> + inline typename Action::result_t call(Action &action) { + return properties.call(*this, action); + } + + // cast: fire and forget + template<typename Action> + inline void cast(Action &&action) { + properties.call(*this, action); + } + + void sync() { + properties.sync(); + } +}; + +#endif // XDTdAXIBNQWHy4pABnW9tvtXRks |