SST  9.1.0
StructuralSimulationToolkit
action.h
1 // Copyright 2009-2019 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2019, NTESS
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 
13 #ifndef SST_CORE_ACTION_H
14 #define SST_CORE_ACTION_H
15 
16 #include <sst/core/serialization/serializer.h>
17 
18 #include <cinttypes>
19 
20 #include <sst/core/activity.h>
21 #include <sst/core/output.h>
22 
23 
24 
25 namespace SST {
26 
27 /**
28  * An Action is a schedulable Activity which is not an Event.
29  */
30 class Action : public Activity {
31 public:
32  Action() {
33 #ifdef SST_ENFORCE_EVENT_ORDERING
34  enforce_link_order = 0;
35 #endif
36  }
37  ~Action() {}
38 
39  void print(const std::string& header, Output &out) const override {
40  out.output("%s Generic Action to be delivered at %" PRIu64 " with priority %d\n",
41  header.c_str(), getDeliveryTime(), getPriority());
42  }
43 
44 
45 protected:
46  /** Called to signal to the Simulation object to end the simulation */
47  void endSimulation();
48  void endSimulation(SimTime_t end);
49 
50 private:
51  NotSerializable(Action)
52 };
53 
54 } //namespace SST
55 
56 #endif // SST_CORE_ACTION_H
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:54
An Action is a schedulable Activity which is not an Event.
Definition: action.h:30
Base class for all Activities in the SST Event Queue.
Definition: activity.h:54
SimTime_t getDeliveryTime() const
Return the time at which this Activity will be delivered.
Definition: activity.h:207
void print(const std::string &header, Output &out) const override
Generic print-print function for this Activity.
Definition: action.h:39
void output(uint32_t line, const char *file, const char *func, const char *format,...) const
Output the message with formatting as specified by the format parameter.
Definition: output.h:186
int getPriority() const
Return the Priority of this Activity.
Definition: activity.h:212
void endSimulation()
Called to signal to the Simulation object to end the simulation.
Definition: action.cc:19