# NV::Rules::INvtxRange

class INvtxRange

  NvtxRange interface.

  Represents a single NVTX Push/Pop or Start/End range.

  Public Types

  enum class PayloadType

    NVTX payload type.

    Type of an NVTX payload. This can be used to choose the appropriate payload_as_* function.

    Values:

    enumerator PAYLOAD_UNKNOWN
    enumerator PAYLOAD_UINT64
    enumerator PAYLOAD_INT64
    enumerator PAYLOAD_DOUBLE
    enumerator PAYLOAD_UINT32
    enumerator PAYLOAD_INT32
    enumerator PAYLOAD_FLOAT
    enumerator PAYLOAD_JSON

  Public Functions

  virtual uint32_t category() const = 0

    Get the category attribute value.

    Get the category attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.

  virtual uint32_t color() const = 0

    Get the color attribute value.

    Get the color attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.

  virtual bool has_attributes() const = 0

    Check if the range has event attributes.

    Check if the range has event attributes, such as INvtxRange::color, INvtxRange::category, or INvtxRange::message.

  virtual std::string message() const = 0

    Get the message attribute value.

    Get the message attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.

  virtual std::string name() const = 0

    Get the range name.

    Get the name of this range

  virtual double payload_as_double() const = 0

    Get the payload attribute value as double (64-bit floating point)

    Get the payload attribute value as a double (64-bit floating point). If the INvtxRange::payload_type cannot be casted to double, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.

  virtual std::string payload_as_string() const = 0

    Get the payload attribute value as a string.

    Get the payload attribute value as a string. If the INvtxRange::payload_type cannot be casted to a string, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.

  virtual uint64_t payload_as_uint64() const = 0

    Get the payload attribute value as uint64.

    Get the payload attribute value as a uint64. If the INvtxRange::payload_type cannot be casted to uint64, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.

  virtual PayloadType payload_type() const = 0

    Get the payload attribute type.

    Get the payload attribute type. If INvtxRange::has_attributes returns false, the returned type is undefined.

  inline virtual ~INvtxRange()