summaryrefslogtreecommitdiff
path: root/core/discrete_property.hpp
blob: 741049f5d2b2be3bb9b441d4160228831000d157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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