summaryrefslogtreecommitdiff
path: root/code/core/spike.cpp
blob: 7b12c182bc9afb11d1d964e3ae2d51cc1c137eb5 (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
#include "spike.h"

static SpikeMUX * SpikeMUX::singleton(id_type num) {
  staticSpikeMUX.dst = num;
  return &staticSpikeMUX;  
}

// special case for reading a spike from a file
template<>
bool SpikeMUX::reflect<ActionRead>(ActionRead &a) {
  bool res = reflect(dst, "dst")
    && reflect(time, "time")
    && reflect(current, "current")
    && (time > s.currentTime);

  if (res)
    s.addEvent(new ExternalSpike(time, dst, current));

  return res;
}

// general reflection case
template<class Action>
bool SpikeMUX::reflect<Action>(Action &a) {
  return reflect(dst, "dst")
    && reflect(time, "time")
    && reflect(current, "current");
}
contact: Jan Huwald // Impressum