SST  6.0.0
StructuralSimulationToolkit
timeVortex.h
1 // Copyright 2009-2016 Sandia Corporation. Under the terms
2 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2016, Sandia Corporation
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SST_CORE_TIMEVORTEX_H
13 #define SST_CORE_TIMEVORTEX_H
14 
15 #include <functional>
16 #include <queue>
17 #include <vector>
18 
19 #include <sst/core/activityQueue.h>
20 
21 namespace SST {
22 
23 class Output;
24 
25 /**
26  * Primary Event Queue
27  */
28 class TimeVortex : public ActivityQueue {
29 public:
30  TimeVortex();
31  ~TimeVortex();
32 
33  bool empty();
34  int size();
35  void insert(Activity* activity);
36  Activity* pop();
37  Activity* front();
38 
39  /** Print the state of the TimeVortex */
40  void print(Output &out) const;
41 
42  uint64_t getCurrentDepth() const { return current_depth; }
43  uint64_t getMaxDepth() const { return max_depth; }
44 
45 private:
46 #ifdef SST_ENFORCE_EVENT_ORDERING
47  typedef std::priority_queue<Activity*, std::vector<Activity*>, Activity::pq_less_time_priority_order> dataType_t;
48 #else
49  typedef std::priority_queue<Activity*, std::vector<Activity*>, Activity::pq_less_time_priority> dataType_t;
50 #endif
51  dataType_t data;
52  uint64_t insertOrder;
53 
54  uint64_t current_depth;
55  uint64_t max_depth;
56 
57 };
58 
59 } //namespace SST
60 
61 #endif // SST_CORE_TIMEVORTEX_H
Output object provides consistant method for outputing data to stdout, stderr and/or sst debug file...
Definition: output.h:54
Base class for all Activities in the SST Event Queue.
Definition: activity.h:53
Primary Event Queue.
Definition: timeVortex.h:28
int size()
Returns the number of activities in the queue.
Definition: timeVortex.cc:45
Definition: action.cc:17
void print(Output &out) const
Print the state of the TimeVortex.
Definition: timeVortex.cc:75
void insert(Activity *activity)
Insert a new activity into the queue.
Definition: timeVortex.cc:50
bool empty()
Returns true if the queue is empty.
Definition: timeVortex.cc:40
Activity * front()
Returns the next activity.
Definition: timeVortex.cc:70
To use with STL priority queues, that order in reverse.
Definition: activity.h:96
To use with STL priority queues, that order in reverse.
Definition: activity.h:155
Base Class for a queue of Activities.
Definition: activityQueue.h:22
Activity * pop()
Remove and return the next activity.
Definition: timeVortex.cc:60