    

 ## On this page

  

 

 # File kpi\_definition.h

 Last update: 22.04.2026 

![](https://img.shields.io/badge/language-C%2B%2B-blue "C++")

**Location**: `core/kpi/definition/kpi_definition.h`

## Classes

- [simulation\_framework::core::kpi::Datatype](classsimulation__framework_1_1core_1_1kpi_1_1Datatype.md#classsimulation__framework_1_1core_1_1kpi_1_1Datatype)
- [simulation\_framework::core::kpi::KpiContent](structsimulation__framework_1_1core_1_1kpi_1_1KpiContent.md#structsimulation__framework_1_1core_1_1kpi_1_1KpiContent)

## Namespaces

- [simulation\_framework](namespacesimulation__framework.md#namespacesimulation__framework)
- [simulation\_framework::core](namespacesimulation__framework_1_1core.md#namespacesimulation__framework_1_1core)
- [simulation\_framework::core::kpi](namespacesimulation__framework_1_1core_1_1kpi.md#namespacesimulation__framework_1_1core_1_1kpi)

## Includes

- core/export/simfwk\_core\_export.h
- [core/time/i\_clock/i\_clock.h](i__clock_8h.md#i__clock_8h)
- 
- 

## Included by

- [i\_kpi.h](i__kpi_8h.md#i__kpi_8h)
- [i\_kpi\_message\_converter.h](i__kpi__message__converter_8h.md#i__kpi__message__converter_8h)

## Source

```cpp


#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

```