The Sparta Modeling Framework
|
Expression node for a simulation variable. Anything that cannot actually vary within a simulation can be handled as a Constant. If it can vary, however, it should be handled through this. More...
#include <ExpressionNodeVariables.hpp>
Public Types | |
typedef double(* | getter_t) () |
Typedef of getter function used to retrieve a variable. | |
Public Member Functions | |
SimVariable (const SimVariable &rhp) | |
SimVariable (const std::string &which, const getter_t getter) | |
Construct with a getter function. | |
virtual SimVariable * | clone_ () const override |
Deep copy of the content of this item. | |
virtual double | evaluate_ () const override |
Compute value of this item in simulation. | |
virtual bool | supportsCompression () const override |
virtual void | start () override |
virtual void | end () override |
virtual void | dump (std::ostream &o, bool show_range=true, bool resolve_subexprs=true) const override |
Dump the content of this expression item. | |
virtual void | getClocks (std::vector< const Clock * > &clocks) const override |
Populates a vector with the clocks found in this subexpression node. | |
Public Member Functions inherited from sparta::statistics::expression::ExpressionNode | |
ExpressionNode (const ExpressionNode &)=delete | |
No copy-constructable. | |
ExpressionNode * | clone () const |
uint32_t | getStats (std::vector< const StatisticInstance * > &results) const |
Gets the statistics present in this expression. | |
double | evaluate () |
Compute value of this item in simulation. Must be implemented by subclass. | |
Public Attributes | |
std::string | which_ |
Name of this variable. | |
getter_t | getter_ |
Function for retrieving the value of this variable. | |
Expression node for a simulation variable. Anything that cannot actually vary within a simulation can be handled as a Constant. If it can vary, however, it should be handled through this.
Definition at line 125 of file ExpressionNodeVariables.hpp.
typedef double(* sparta::statistics::expression::SimVariable::getter_t) () |
Typedef of getter function used to retrieve a variable.
Definition at line 130 of file ExpressionNodeVariables.hpp.
|
inline |
Definition at line 144 of file ExpressionNodeVariables.hpp.
|
inline |
Construct with a getter function.
which | Name of the variable |
getter | Pointer to function for getting the variable as a double |
Definition at line 155 of file ExpressionNodeVariables.hpp.
|
inlineoverridevirtual |
Deep copy of the content of this item.
To be overridden by subclasses
Implements sparta::statistics::expression::ExpressionNode.
Definition at line 160 of file ExpressionNodeVariables.hpp.
|
inlineoverridevirtual |
Dump the content of this expression item.
o | Ostream to write to |
show_range | Should the range be shown in any subexpression nodes. |
resolve_subexprs | Should any referenced statistic defs be expanded to their full expressions so that this becomes an expression containing only counters. |
Implements sparta::statistics::expression::ExpressionNode.
Definition at line 185 of file ExpressionNodeVariables.hpp.
|
inlineoverridevirtual |
Implements sparta::statistics::expression::ExpressionNode.
Definition at line 181 of file ExpressionNodeVariables.hpp.
|
inlineoverridevirtual |
Compute value of this item in simulation.
Implements sparta::statistics::expression::ExpressionNode.
Definition at line 164 of file ExpressionNodeVariables.hpp.
|
inlineoverridevirtual |
Populates a vector with the clocks found in this subexpression node.
clocks | Vector of clocks to which any found clocks will be appended. This vector is not cleared. |
Implements sparta::statistics::expression::ExpressionNode.
Definition at line 193 of file ExpressionNodeVariables.hpp.
|
inlineoverridevirtual |
Implements sparta::statistics::expression::ExpressionNode.
Definition at line 177 of file ExpressionNodeVariables.hpp.
|
inlineoverridevirtual |
The SimVariable is a wrapper around a function pointer which returns a double. It might as well be generating random floating-point numbers. Let's not try to compress it.
Implements sparta::statistics::expression::ExpressionNode.
Definition at line 173 of file ExpressionNodeVariables.hpp.
getter_t sparta::statistics::expression::SimVariable::getter_ |
Function for retrieving the value of this variable.
Definition at line 140 of file ExpressionNodeVariables.hpp.
std::string sparta::statistics::expression::SimVariable::which_ |
Name of this variable.
Definition at line 135 of file ExpressionNodeVariables.hpp.