MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SynEvent.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 _SYN_EVENT_H
11 #define _SYN_EVENT_H
12 
13 class SynEvent
14 {
15  public:
17  : time( 0.0 ), weight( 0.0 )
18  {;}
19 
20  SynEvent( double t, double w )
21  : time( t ), weight( w )
22  {;}
23 
24  double time;
25  double weight;
26 };
27 
29 {
30  bool operator()(const SynEvent& lhs, const SynEvent& rhs) const
31  {
32  // Note that this is backwards. We want the smallest timestamp
33  // on the top of the events priority_queue.
34  return lhs.time > rhs.time;
35  }
36 };
37 
38 class PreSynEvent: public SynEvent
39 {
40  public:
42  : SynEvent(), // call the parent constructor with default args
43  // by default calls without args, so no need really
44  synIndex( 0 )
45  {}
46 
47  PreSynEvent( unsigned int i, double t, double w )
48  : SynEvent(t,w),// call the parent constructor with given args
49  synIndex( i )
50  {;}
51 
52  unsigned int synIndex;
53 };
54 
56 {
57  public:
59  : time( 0.0 )
60  {;}
61 
62  PostSynEvent( double t )
63  : time( t )
64  {;}
65 
66  double time;
67 };
68 
70 {
71  bool operator()(const PostSynEvent& lhs, const PostSynEvent& rhs) const
72  {
73  // Note that this is backwards. We want the smallest timestamp
74  // on the top of the events priority_queue.
75  return lhs.time > rhs.time;
76  }
77 };
78 
79 #endif // _SYN_EVENT_H
PreSynEvent(unsigned int i, double t, double w)
Definition: SynEvent.h:47
double time
Definition: SynEvent.h:66
SynEvent(double t, double w)
Definition: SynEvent.h:20
PreSynEvent()
Definition: SynEvent.h:41
double weight
Definition: SynEvent.h:25
PostSynEvent(double t)
Definition: SynEvent.h:62
bool operator()(const PostSynEvent &lhs, const PostSynEvent &rhs) const
Definition: SynEvent.h:71
bool operator()(const SynEvent &lhs, const SynEvent &rhs) const
Definition: SynEvent.h:30
unsigned int synIndex
Definition: SynEvent.h:52
PostSynEvent()
Definition: SynEvent.h:58
double time
Definition: SynEvent.h:24
SynEvent()
Definition: SynEvent.h:16