NEST  2.6.0,not_revisioned_source_dir@0
event_priority.h
Go to the documentation of this file.
1 /*
2  * event_priority.h
3  *
4  * This file is part of NEST.
5  *
6  * Copyright (C) 2004 The NEST Initiative
7  *
8  * NEST is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * NEST is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef EVENT_PRIORITY_H
24 #define EVENT_PRIORITY_H
25 
26 #include "event.h"
27 
28 namespace nest
29 {
30  bool operator<(const Event &, const Event &);
31 
33  {
34  public:
35  typedef Event const * value_type;
36  typedef bool return_type;
37  bool operator()(Event const *e1, Event const*e2) const
38  {
39  return !(*e1 < *e2);
40  }
41  };
42 
43  inline
44  bool operator<(const Event &e1, const Event &e2)
45  {
46  return
47  (e1.get_stamp().get_steps()+e1.get_delay()) < (e2.get_stamp().get_steps()+e2.get_delay());
48  }
49 
50 }
51 #endif
bool return_type
Definition: event_priority.h:36
Encapsulates information which is sent between Nodes.
Definition: event.h:73
delay get_steps() const
Definition: nest_time.h:395
bool operator<(const Event &, const Event &)
Definition: event_priority.h:44
Event const * value_type
Definition: event_priority.h:35
Time const & get_stamp() const
Return time stamp of the event.
Definition: event.h:757
bool operator()(Event const *e1, Event const *e2) const
Definition: event_priority.h:37
Definition: event_priority.h:32
delay get_delay() const
Return transmission delay of the event.
Definition: event.h:769