summaryrefslogtreecommitdiff
path: root/core/evolve.hpp
blob: 628c170cd4c9443ad7c357d67b23b6d3f018bb8a (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
#ifndef X66AJaG3Qy6m9CIBTEKhiCYWag0
#define X66AJaG3Qy6m9CIBTEKhiCYWag0

#include "pla_evolve.hpp"



namespace EvolveImpl {

  template<typename Quant>
  struct Evolve {
    template<class PC>
    void operator() (PC &pc, const Time ct, const Ptr<Quant> id) {
      typedef typename QuantChild<Quant>::type Child;
      // first evolve childs
      for (Ptr<Child> i : id.childs())
	Evolve<Child>()(pc, ct, i);
      // then self
      pc.cast(PLA_Evolve<Quant>{ContinuousContext<Quant>{id}, ct});
    }
  };

  template<>
  struct Evolve<Synapse> {
    template<class PC>
    void operator() (PC &pc, const Time ct, const Ptr<Synapse> id) {
      // no childs -> evolve only self
      pc.cast(PLA_Evolve<Synapse>{ContinuousContext<Synapse>{id}, ct});
    }
  };
}

using EvolveImpl::Evolve;

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