summaryrefslogtreecommitdiff
path: root/core/discrete_property.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/discrete_property.hpp')
-rw-r--r--core/discrete_property.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/core/discrete_property.hpp b/core/discrete_property.hpp
new file mode 100644
index 0000000..741049f
--- /dev/null
+++ b/core/discrete_property.hpp
@@ -0,0 +1,39 @@
+#ifndef iNnFGNqFLlBaWFgGGH0sLM3mh40
+#define iNnFGNqFLlBaWFgGGH0sLM3mh40
+
+#include "pointers.hpp"
+#include "string_helpers.hpp"
+#include "template_helpers.hpp"
+
+/// Macros
+
+#define GEN_DP(Quant, nameT, nameS, ValueType) \
+struct nameT { \
+ typedef ValueType type; \
+ typedef Quant quant; \
+ typedef Quant::instance_ptr_t instance_ptr_t; \
+ static const uint32_t size = sizeof(ValueType); \
+ static const char* const name; \
+}; \
+ \
+const char* const nameT::name = nameS;
+
+#define GEN_DP_DELAY(DQuant, CQuant, Rule) \
+template<> \
+struct DiscreteProperty_ComputeDelay<DQuant, CQuant> { \
+ template<typename PC, typename Context, typename Transaction> \
+ inline static Time eval(PC &pc, Context context, \
+ Transaction transaction, Time t) { \
+ return Rule; \
+ } \
+};
+
+/// default impls
+
+template<typename DQuant, typename CQuant>
+struct DiscreteProperty_ComputeDelay {
+ template<typename PC, typename Context, typename Transaction>
+ inline static Time eval(PC &, Context, Transaction, Time) DO_NOT_CALL
+};
+
+#endif // iNnFGNqFLlBaWFgGGH0sLM3mh40
contact: Jan Huwald // Impressum