> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File kpi_definition.h

![][C++]

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

## Classes

* [simulation\_framework::core::kpi::Datatype](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/classsimulation__framework_1_1core_1_1kpi_1_1Datatype.md)
* [simulation\_framework::core::kpi::KpiContent](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/structsimulation__framework_1_1core_1_1kpi_1_1KpiContent.md)

## Namespaces

* [simulation\_framework](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/namespacesimulation__framework.md)
* [simulation\_framework::core](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/namespacesimulation__framework_1_1core.md)
* [simulation\_framework::core::kpi](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/namespacesimulation__framework_1_1core_1_1kpi.md)

## Includes

* core/export/simfwk\_core\_export.h
* [core/time/i\_clock/i\_clock.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/i__clock_8h.md)
* \<string>
* \<vector>

## Included by

* [i\_kpi.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/i__kpi_8h.md)
* [i\_kpi\_message\_converter.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/i__kpi__message__converter_8h.md)

## Source

```cpp theme={null}


#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
```

[private]: https://img.shields.io/badge/-private-red "private"

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[const]: https://img.shields.io/badge/-const-lightblue "const"

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

[protected]: https://img.shields.io/badge/-protected-yellow "protected"

[static]: https://img.shields.io/badge/-static-lightgrey "static"
