NVTX C++ API Reference 1.0
C++ convenience wrappers for NVTX v3 C API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
nvtx3::v1::mv1::schema Class Reference

Represents the registered schema for a payload struct. More...

#include <nvtx3.hpp>

Public Member Functions

 schema (schema const &)=delete
 
schemaoperator= (schema const &)=delete
 
 schema (schema &&)=delete
 
schemaoperator= (schema &&)=delete
 
 schema (uint64_t id)
 Constructs a schema object directly from a schema ID.
 
uint64_t get_handle () const noexcept
 Return the underlying C handle of the schema.
 

Static Public Member Functions

template<typename T >
static schema const & get () noexcept
 Gets the schema instance for a specific payload struct type.
 

Detailed Description

Represents the registered schema for a payload struct.

This class encapsulates the schema ID obtained by registering a payload struct using nvtxPayloadSchemaRegister. The primary mechanism for obtaining an instance is via the static template function get<T>(), which must be specialized for each payload struct type T using the NVTX3_DEFINE_SCHEMA_GET (NVTX3_V1_DEFINE_SCHEMA_GET()) macro.

The schema ID is used internally when constructing payload_data objects.

Definition at line 2035 of file nvtx3.hpp.

Constructor & Destructor Documentation

◆ schema()

nvtx3::v1::mv1::schema::schema ( uint64_t  id)
inlineexplicit

Constructs a schema object directly from a schema ID.

This constructor is primarily for internal use or advanced scenarios where the schema ID is obtained manually.

Parameters
idThe NVTX schema ID.

Definition at line 2061 of file nvtx3.hpp.

Member Function Documentation

◆ get()

template<typename T >
static schema const & nvtx3::v1::mv1::schema::get ( )
inlinestaticnoexcept

Gets the schema instance for a specific payload struct type.

This function relies on template specialization. Users must provide a specialization for each payload struct type T using the NVTX3_DEFINE_SCHEMA_GET (NVTX3_V1_DEFINE_SCHEMA_GET()) macro.

Template Parameters
TThe payload struct type for which to get the schema.
Returns
A constant reference to the schema object for type T.

Definition at line 2076 of file nvtx3.hpp.

◆ get_handle()

uint64_t nvtx3::v1::mv1::schema::get_handle ( ) const
inlinenoexcept

Return the underlying C handle of the schema.

Definition at line 2089 of file nvtx3.hpp.


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