SST  7.2.0
StructuralSimulationToolkit
timeVortex.h
1 // Copyright 2009-2017 Sandia Corporation. Under the terms
2 // of Contract DE-NA0003525 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2017, 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() override;
34  int size() override;
35  void insert(Activity* activity) override;
36  Activity* pop() override;
37  Activity* front() override;
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
void print(Output &out) const
Print the state of the TimeVortex.
Definition: timeVortex.cc:75
Output object provides consistant method for outputing data to stdout, stderr and/or sst debug file...
Definition: output.h:54
Activity * pop() override
Remove and return the next activity.
Definition: timeVortex.cc:60
int size() override
Returns the number of activities in the queue.
Definition: timeVortex.cc:45
Base class for all Activities in the SST Event Queue.
Definition: activity.h:54
void insert(Activity *activity) override
Insert a new activity into the queue.
Definition: timeVortex.cc:50
Primary Event Queue.
Definition: timeVortex.h:28
Definition: action.cc:17
Activity * front() override
Returns the next activity.
Definition: timeVortex.cc:70
To use with STL priority queues, that order in reverse.
Definition: activity.h:97
To use with STL priority queues, that order in reverse.
Definition: activity.h:156
Base Class for a queue of Activities.
Definition: activityQueue.h:22
bool empty() override
Returns true if the queue is empty.
Definition: timeVortex.cc:40