The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::StatisticDef::ValueSemanticDetailed Class Reference

Wrapper class to add meta information to a statistic definition. More...

#include <StatisticDef.hpp>

Public Member Functions

 ValueSemanticDetailed (ValueSemantic semantic)
 Construct a ValueSemanticDetailed without meta data.
 
 ValueSemanticDetailed (ValueSemantic semantic, const InstrumentationNode::MetadataPairs &meta_data)
 Construct a ValueSemanticDetailed without meta data.
 
 operator ValueSemantic () const
 Casting operator to obtain the original semantic.
 
const InstrumentationNode::MetadataPairs & getMetadata () const
 Get the meta data provided by the user.
 

Detailed Description

Wrapper class to add meta information to a statistic definition.

When defining the ValueSemantic of a StatisticDef, this class enables the modeler to extend that semantic with meta information. During report generation to data serialization formats (like json, yaml, or SimDB) this information is included with the statistic.

Usage:

new sparta::StatisticDef(getContainer(),
"my_stat_def_name",
"my_stat_def_group_name,
0, // group idx
"This is my fancy statistic definition", // desc
getContainer(), // context
"(counter1-counter2)/counter2 * 100", // expression
// ValueSemanticDetailed
{
sparta::StatisticDef::ValueSemantic::VS_PERCENTAGE,
{
{"lowest_value" : "0" },
{"highest_value" : "100" },
{"polarity" : "positive" } // Positive polarity, higher is better
}
});
Contains a statistic definition (some useful information which can be computed)

The modeler is not required to provide any meta data information. As an example, the following works as well:

new sparta::StatisticDef(getContainer(),
"my_stat_def_name",
"my_stat_def_group_name,
0, // group idx
"This is my simple statistic definition", // desc
getContainer(), // context
"(counter1-counter2)/counter2 * 100", // expression
sparta::StatisticDef::ValueSemantic::VS_PERCENTAGE); // semantic

Definition at line 161 of file StatisticDef.hpp.

Constructor & Destructor Documentation

◆ ValueSemanticDetailed() [1/2]

sparta::StatisticDef::ValueSemanticDetailed::ValueSemanticDetailed ( ValueSemantic semantic)
inline

Construct a ValueSemanticDetailed without meta data.

Parameters
semanticThe ValueSemantic
Note
Do not make this explicit

Definition at line 169 of file StatisticDef.hpp.

◆ ValueSemanticDetailed() [2/2]

sparta::StatisticDef::ValueSemanticDetailed::ValueSemanticDetailed ( ValueSemantic semantic,
const InstrumentationNode::MetadataPairs & meta_data )
inline

Construct a ValueSemanticDetailed without meta data.

Parameters
semanticThe ValueSemantic
meta_dataMetadataPairs to assign {("name", "value"}}

Definition at line 178 of file StatisticDef.hpp.

Member Function Documentation

◆ getMetadata()

const InstrumentationNode::MetadataPairs & sparta::StatisticDef::ValueSemanticDetailed::getMetadata ( ) const
inline

Get the meta data provided by the user.

Definition at line 188 of file StatisticDef.hpp.

◆ operator ValueSemantic()

sparta::StatisticDef::ValueSemanticDetailed::operator ValueSemantic ( ) const
inline

Casting operator to obtain the original semantic.

Definition at line 185 of file StatisticDef.hpp.


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