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/pla_debug_name.hpp |
Diffstat (limited to 'core/pla_debug_name.hpp')
-rw-r--r-- | core/pla_debug_name.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/core/pla_debug_name.hpp b/core/pla_debug_name.hpp new file mode 100644 index 0000000..1b1f89e --- /dev/null +++ b/core/pla_debug_name.hpp @@ -0,0 +1,39 @@ +#ifndef lULoAciwLXvtwzfgpfl9LrvpNj0 +#define lULoAciwLXvtwzfgpfl9LrvpNj0 + +#include <string> + +#include <boost/type_traits/is_same.hpp> + +#include "property_instance.hpp" +#include "template_helpers.hpp" + +// PLA template +struct PLA_Debug_Name { + // action types & consts + typedef std::string result_t; + template<typename _ContextProp, bool doWriteResults> struct local_state_t { + typedef _ContextProp prop; + static const bool write = doWriteResults; + }; + + // action state + result_t result; + + PLA_Debug_Name() : result("Property List Content:") { } + + // action methods + template<typename _PropList, typename _ContextData, typename LocalState> + inline void pre(_PropList &pc, _ContextData &data, LocalState &state) { + result = result + "\n" + + LocalState::prop::quant::name + "::" + + LocalState::prop::name + + " (" + LocalState::prop::quant::class_t::name + "): " + + (LocalState::write ? "writing" : "reading"); + } + + template<typename _PropComp, typename _Data, typename _LocalState> + inline void post(_PropComp &pc, _Data &data, _LocalState &state) { } +}; + +#endif // lULoAciwLXvtwzfgpfl9LrvpNj0 |