SST/macro
event_calendar.h
Go to the documentation of this file.
1 /*
2  * This file is part of SST/macroscale:
3  * The macroscale architecture simulator from the SST suite.
4  * Copyright (c) 2009 Sandia Corporation.
5  * This software is distributed under the BSD License.
6  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7  * the U.S. Government retains certain rights in this software.
8  * For more information, see the LICENSE file in the top
9  * SST/macroscale directory.
10  */
11 
12 #ifndef EVENT_CALENDAR_H
13 #define EVENT_CALENDAR_H
14 
19 
20 #include <map>
21 
22 namespace sstmac {
23 namespace native {
24 
25 /**
26  * An event manager that relies on the eventcontainer template base class
27  * to manage events with a multimap template parameter.
28  */
30  public event_container
31 {
32 
33  public:
34  virtual void
35  init_factory_params(sprockit::sim_parameters* params);
36 
37  ~event_calendar() throw ();
38 
39  void
40  clear(timestamp zero_time = timestamp(0));
41 
42  void
44 
45  bool
46  empty() const {
47  return num_events_left_ == 0;
48  }
49 
50  protected:
51  event*
53 
54  event*
56 
57  void
59 
60  void
61  add_event(event* ev);
62 
63  void
65 
66  protected:
68 
70 
72 
74 
76 
78 
80 
82 
84 
85  std::vector<uint32_t> search_windows_;
86 
87  std::vector<std::list<event*> > future_epochs_;
88 
89  std::vector<event*> current_epoch_;
90 
91 };
92 
93 }
94 } // end of namespace sstmac
95 
96 #endif // EVENT_CALENDAR_H
std::vector< event * > current_epoch_
An event manager base class using standard containers.
std::vector< uint32_t > search_windows_
A basic container for time (subject to future transplant).
Definition: timestamp.h:29
An event manager that relies on the eventcontainer template base class to manage events with a multim...
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
void clear(timestamp zero_time=timestamp(0))
Clear all events and set time back to a zero of your choice.
std::vector< std::list< event * > > future_epochs_
void cancel_all_messages(event_loc_id mod)
virtual void init_factory_params(sprockit::sim_parameters *params)