summaryrefslogtreecommitdiff
path: root/core/pla_sync.hpp
blob: 7114cb49883b5841884eb624fbdff83c92d6cc79 (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
40
41
42
43
44
45
46
47
#ifndef aVCkmoPnFvf2TxOWrvfVb5qPbZM
#define aVCkmoPnFvf2TxOWrvfVb5qPbZM

#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_same.hpp>

#include "property_instance.hpp"
#include "property_list.hpp"
#include "quant_types.hpp"
#include "template_helpers.hpp"

// worker template forward decl 
template<typename Data, bool isWrite /* == false */>
struct PLA_Sync_Impl {
  static void eval(Data &) {}
};

template<typename Data>
struct PLA_Sync_Impl<Data, true> {
  static void eval(Data &data) {
    data.data.sync();
  }
};

// PLA template
struct PLA_Sync {
  // action consts
  typedef Void result_t;
  template<typename ContextProp, bool doWriteResult> struct local_state_t {
    typedef ContextProp prop;
    static const bool write = doWriteResult;
  };

  result_t result;

  // action parameters
  template<typename _PC, typename _ContextData, typename _LocalState>
  inline void pre(_PC &, _ContextData &, _LocalState &) {}


  template<typename _PC, typename ContextData, typename LocalState>
  inline void post(_PC &, ContextData &data, LocalState &) {
    PLA_Sync_Impl<ContextData, LocalState::write>::eval(data);
  }
};

#endif // aVCkmoPnFvf2TxOWrvfVb5qPbZM
contact: Jan Huwald // Impressum