Jlm
Public Member Functions | Private Types | Private Attributes | List of all members
jlm::util::Annotation Class Referencefinal

#include <AnnotationMap.hpp>

Public Member Functions

 Annotation (std::string_view label, std::string value)
 
 Annotation (std::string_view label, int64_t value)
 
 Annotation (std::string_view label, uint64_t value)
 
 Annotation (std::string_view label, double value)
 
const std::string_view & Label () const noexcept
 
template<typename TValue >
const TValue & Value () const
 
template<typename TValue >
bool HasValueType () const noexcept
 
bool operator== (const Annotation &other) const noexcept
 
bool operator!= (const Annotation &other) const noexcept
 

Private Types

using AnnotationValue = std::variant< std::string, int64_t, uint64_t, double >
 

Private Attributes

std::string_view Label_ = {}
 
AnnotationValue Value_ = {}
 

Detailed Description

Represents a simple key-value pair with a label and a value of type std::string, int64_t, uint64_t, or double.

Definition at line 25 of file AnnotationMap.hpp.

Member Typedef Documentation

◆ AnnotationValue

using jlm::util::Annotation::AnnotationValue = std::variant<std::string, int64_t, uint64_t, double>
private

Definition at line 27 of file AnnotationMap.hpp.

Constructor & Destructor Documentation

◆ Annotation() [1/4]

jlm::util::Annotation::Annotation ( std::string_view  label,
std::string  value 
)
inline

Definition at line 30 of file AnnotationMap.hpp.

◆ Annotation() [2/4]

jlm::util::Annotation::Annotation ( std::string_view  label,
int64_t  value 
)
inline

Definition at line 35 of file AnnotationMap.hpp.

◆ Annotation() [3/4]

jlm::util::Annotation::Annotation ( std::string_view  label,
uint64_t  value 
)
inline

Definition at line 40 of file AnnotationMap.hpp.

◆ Annotation() [4/4]

jlm::util::Annotation::Annotation ( std::string_view  label,
double  value 
)
inline

Definition at line 45 of file AnnotationMap.hpp.

Member Function Documentation

◆ HasValueType()

template<typename TValue >
bool jlm::util::Annotation::HasValueType ( ) const
inlinenoexcept

Checks if the type of the annotation value is equivalent to TValue.

Returns
True if the value type if equivalent to TValue, otherwise false.

Definition at line 76 of file AnnotationMap.hpp.

◆ Label()

const std::string_view& jlm::util::Annotation::Label ( ) const
inlinenoexcept

Gets the label of the annotation.

Definition at line 54 of file AnnotationMap.hpp.

◆ operator!=()

bool jlm::util::Annotation::operator!= ( const Annotation other) const
inlinenoexcept

Definition at line 88 of file AnnotationMap.hpp.

◆ operator==()

bool jlm::util::Annotation::operator== ( const Annotation other) const
inlinenoexcept

Definition at line 82 of file AnnotationMap.hpp.

◆ Value()

template<typename TValue >
const TValue& jlm::util::Annotation::Value ( ) const
inline

Gets the value of the annotation. Requires the annotation value to be of type TValue.

Definition at line 64 of file AnnotationMap.hpp.

Member Data Documentation

◆ Label_

std::string_view jlm::util::Annotation::Label_ = {}
private

Definition at line 94 of file AnnotationMap.hpp.

◆ Value_

AnnotationValue jlm::util::Annotation::Value_ = {}
private

Definition at line 95 of file AnnotationMap.hpp.


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