NVTX C++ API Reference 1.0
C++ convenience wrappers for NVTX v3 C API
|
A category
with an associated name string.
More...
#include <nvtx3.hpp>
Public Member Functions | |
named_category_in (id_type id, char const *name) noexcept | |
Construct a named_category_in with the specified id and name . | |
named_category_in (id_type id, wchar_t const *name) noexcept | |
Construct a named_category_in with the specified id and name . | |
![]() | |
constexpr | category (id_type id) noexcept |
Construct a category with the specified id . | |
constexpr id_type | get_id () const noexcept |
Returns the id of the category. | |
category (category const &)=default | |
category & | operator= (category const &)=default |
category (category &&)=default | |
category & | operator= (category &&)=default |
Static Public Member Functions | |
template<typename C , typename std::enable_if< detail::is_c_string< decltype(C::name)>::value &&detail::is_uint32< decltype(C::id)>::value, int >::type = 0> | |
static named_category_in const & | get () noexcept |
Returns a global instance of a named_category_in as a function-local static. | |
template<typename C , typename std::enable_if< !detail::is_c_string< decltype(C::name)>::value||!detail::is_uint32< decltype(C::id)>::value, int >::type = 0> | |
static named_category_in const & | get () noexcept |
Overload of named_category_in::get to provide a clear compile error when C has the required name and id members, but they are not the required types. name must be directly convertible to char const* or wchar_t const* , and id must be uint32_t . | |
template<typename C , typename std::enable_if< !detail::has_name< C >::value||!detail::has_id< C >::value, int >::type = 0> | |
static named_category_in const & | get () noexcept |
Overload of named_category_in::get to provide a clear compile error when C does not have the required name and id members. | |
Additional Inherited Members | |
![]() | |
using | id_type = uint32_t |
Type used for category s integer id. | |
A category
with an associated name string.
Associates a name
string with a category id
to help differentiate among categories.
For any given category id Id
, a named_category(Id, "name")
should only be constructed once and reused throughout an application. This can be done by either explicitly creating static named_category
objects, or using the named_category::get
construct on first use helper (recommended).
Creating two or more named_category
objects with the same value for id
in the same domain results in undefined behavior.
Similarly, behavior is undefined when a named_category
and category
share the same value of id
.
Example:
named_category_in<D>
's association of a name to a category id is local to the domain specified by the type D
. An id may have a different name in another domain.
D | Type containing name member used to identify the domain to which the named_category_in belongs. Else, domain::global to indicate that the global NVTX domain should be used. |
|
inlinenoexcept |
Construct a named_category_in
with the specified id
and name
.
The name name
will be registered with id
.
Every unique value of id
should only be named once.
[in] | id | The category id to name |
[in] | name | The name to associated with id |
|
inlinenoexcept |
Construct a named_category_in
with the specified id
and name
.
The name name
will be registered with id
.
Every unique value of id
should only be named once.
[in] | id | The category id to name |
[in] | name | The name to associated with id |
|
inlinestaticnoexcept |
Returns a global instance of a named_category_in
as a function-local static.
Creates a named_category_in<D>
with name and id specified by the contents of a type C
. C::name
determines the name and C::id
determines the category id.
This function is useful for constructing a named category
exactly once and reusing the same instance throughout an application.
Example:
Uses the "construct on first use" idiom to safely ensure the category
object is initialized exactly once. See https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
C | Type containing a member C::name that resolves to either a char const* or wchar_t const* and C::id . |
|
inlinestaticnoexcept |
Overload of named_category_in::get
to provide a clear compile error when C
has the required name
and id
members, but they are not the required types. name
must be directly convertible to char const*
or wchar_t const*
, and id
must be uint32_t
.
|
inlinestaticnoexcept |
Overload of named_category_in::get
to provide a clear compile error when C
does not have the required name
and id
members.