Skip to main content

AVxcelerate Simulation Framework 2026 R1 SP01

File kpi_definition.h

Last update: 22.04.2026

Location: core/kpi/definition/kpi_definition.h

Classes

Namespaces

Includes

Included by

Source



#ifndef SIMFWK_CORE_KPI_DEFINITION_KPIDEFINITION_H
#define SIMFWK_CORE_KPI_DEFINITION_KPIDEFINITION_H

#include "core/export/simfwk_core_export.h"
#include "core/time/i_clock/i_clock.h"
#include <string>
#include <vector>

namespace simulation_framework
{
namespace core
{
namespace kpi
{

enum class Type : uint8_t
{
    kScalar = 0,  
    kTimeSeries,  
    kLog,         
    kOther        
};

class SIMFWK_CORE_API Datatype
{
  public:
    enum class Value : uint8_t
    {
        kDouble = 0,
        kInteger,
        kString,
        kBoolean,
        kJson,
        kOther
    };

    Datatype();
    Datatype(Value value);
    Datatype(const std::string& value_string);

    ~Datatype() = default;

    operator Value() const;

    std::string ToString() const noexcept;
    void FromString(const std::string& value_string) noexcept;

    bool operator==(Datatype other) const;

  private:
    Value value_;
};


struct SIMFWK_CORE_API KpiContent
{
    core::time::Timestamp timestamp;
    std::string name;
    Datatype data_type;
    std::string value;
    std::string unit;
    Type type;
};

inline bool operator==(const core::kpi::KpiContent& lhs, const core::kpi::KpiContent& rhs)
{
    return (lhs.timestamp == rhs.timestamp) && (lhs.name == rhs.name) && (lhs.data_type == rhs.data_type) &&
           (lhs.value == rhs.value) && (lhs.unit == rhs.unit) && (lhs.type == rhs.type);
}

using KpiMessage = std::vector<KpiContent>;

}  // namespace kpi
}  // namespace core
}  // namespace simulation_framework

#endif  // SIMFWK_CORE_KPI_DEFINITION_KPIDEFINITION_H

Connect with Ansys