MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SimpleSynHandler.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) 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 _SIMPLE_SYN_HANDLER_H
11 #define _SIMPLE_SYN_HANDLER_H
12 
13 #include <queue>
14 
15 /*
16 class SynEvent
17 {
18  public:
19  SynEvent()
20  : time( 0.0 ), weight( 0.0 )
21  {;}
22 
23  SynEvent( double t, double w )
24  : time( t ), weight( w )
25  {;}
26 
27  double time;
28  double weight;
29 };
30 
31 struct CompareSynEvent
32 {
33  bool operator()(const SynEvent& lhs, const SynEvent& rhs) const
34  {
35  // Note that this is backwards. We want the smallest timestamp
36  // on the top of the events priority_queue.
37  return lhs.time > rhs.time;
38  }
39 };
40 */
41 
48 {
49  public:
53 
55  // Inherited virtual functions
57  void vSetNumSynapses( unsigned int num );
58  unsigned int vGetNumSynapses() const;
59  Synapse* vGetSynapse( unsigned int i );
60  void vProcess( const Eref& e, ProcPtr p );
61  void vReinit( const Eref& e, ProcPtr p );
63  unsigned int addSynapse();
64  void dropSynapse( unsigned int droppedSynNumber );
65  void addSpike( unsigned int index, double time, double weight );
66  double getTopSpike( unsigned int index ) const;
68  static const Cinfo* initCinfo();
69  private:
70  vector< Synapse > synapses_;
71  priority_queue< SynEvent, vector< SynEvent >, CompareSynEvent > events_;
72 };
73 
74 #endif // _SIMPLE_SYN_HANDLER_H
void dropSynapse(unsigned int droppedSynNumber)
double getTopSpike(unsigned int index) const
SimpleSynHandler & operator=(const SimpleSynHandler &other)
priority_queue< SynEvent, vector< SynEvent >, CompareSynEvent > events_
void addSpike(unsigned int index, double time, double weight)
vector< Synapse > synapses_
void vProcess(const Eref &e, ProcPtr p)
Definition: Eref.h:26
void vSetNumSynapses(unsigned int num)
void vReinit(const Eref &e, ProcPtr p)
unsigned int vGetNumSynapses() const
unsigned int addSynapse()
Adds a new synapse, returns its index.
static const Cinfo * initCinfo()
Synapse * vGetSynapse(unsigned int i)
Definition: Cinfo.h:18