MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SpikeRingBuffer.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2013 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _SPIKE_RING_BUFFER
11 #define _SPIKE_RING_BUFFER
12 
20 {
21  public:
23 
25  void reinit( double dt, double bufferTime );
26 
28  void addSpike( double timestamp, double weight );
30  double pop( double currTime );
31  private:
32  static const unsigned int MAXBIN;
33  double dt_;
34  double currTime_;
35  unsigned int currentBin_;
36  vector< double > weightSum_;
37 };
38 #endif // _SPIKE_RING_BUFFER
unsigned int currentBin_
double pop(double currTime)
Advances the buffer one step, returns the current weight.
vector< double > weightSum_
void addSpike(double timestamp, double weight)
Adds spike into the buffer.
static const unsigned int MAXBIN
void reinit(double dt, double bufferTime)
Sets up buffer parameters.