The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::statistics::expression::ExpressionNode Class Referenceabstract

Abstract interface class for an item in an expression. Subclasses can contain other ExpressionNodes. More...

#include <ExpressionNode.hpp>

Inheritance diagram for sparta::statistics::expression::ExpressionNode:

Public Member Functions

 ExpressionNode (const ExpressionNode &)=delete
 No copy-constructable.
 
ExpressionNodeclone () 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.
 
virtual void start ()=0
 
virtual void end ()=0
 
virtual bool supportsCompression () const =0
 
virtual void dump (std::ostream &o, bool show_range=true, bool resolve_subexprs=true) const =0
 Dump the content of this expression item.
 
virtual void getClocks (std::vector< const Clock * > &clocks) const =0
 Populates a vector with the clocks found in this subexpression node.
 

Detailed Description

Abstract interface class for an item in an expression. Subclasses can contain other ExpressionNodes.

Typically, these are created by the Expression class and there is no need for a client to directly access this interface or any subclasses

Definition at line 37 of file ExpressionNode.hpp.

Constructor & Destructor Documentation

◆ ExpressionNode()

sparta::statistics::expression::ExpressionNode::ExpressionNode ( )
inline

Definition at line 46 of file ExpressionNode.hpp.

◆ ~ExpressionNode()

virtual sparta::statistics::expression::ExpressionNode::~ExpressionNode ( )
inlinevirtual

Definition at line 50 of file ExpressionNode.hpp.

Member Function Documentation

◆ clone()

ExpressionNode * sparta::statistics::expression::ExpressionNode::clone ( ) const
inline

Definition at line 54 of file ExpressionNode.hpp.

◆ dump()

virtual void sparta::statistics::expression::ExpressionNode::dump ( std::ostream &  o,
bool  show_range = true,
bool  resolve_subexprs = true 
) const
pure virtual

Dump the content of this expression item.

Note
Must not evaluate the expression
Parameters
oOstream to write to
show_rangeShould the range be shown in any subexpression nodes.
resolve_subexprsShould any referenced statistic defs be expanded to their full expressions so that this becomes an expression containing only counters.

Implemented in sparta::statistics::expression::Operation, sparta::statistics::expression::Constant, sparta::statistics::expression::UnaryFunction< RetT, ArgT, fxn_t >, sparta::statistics::expression::BinaryFunction< RetT, ArgT >, sparta::statistics::expression::TernaryFunction< RetT, ArgT >, sparta::statistics::expression::StatVariable, sparta::statistics::expression::SimVariable, and sparta::statistics::expression::ReferenceVariable.

◆ evaluate()

double sparta::statistics::expression::ExpressionNode::evaluate ( )
inline

Compute value of this item in simulation. Must be implemented by subclass.

Definition at line 76 of file ExpressionNode.hpp.

◆ getClocks()

virtual void sparta::statistics::expression::ExpressionNode::getClocks ( std::vector< const Clock * > &  clocks) const
pure virtual

◆ getStats()

uint32_t sparta::statistics::expression::ExpressionNode::getStats ( std::vector< const StatisticInstance * > &  results) const
inline

Gets the statistics present in this expression.

Returns
Number of stats added to results
Parameters
resultsVector of pointers to StatisticInstances. All statistics within this class will be appended to the results vector. These pointers are valid until this item or its children are modified or deleted

Definition at line 68 of file ExpressionNode.hpp.

◆ supportsCompression()


The documentation for this class was generated from the following file: