Loading...
Searching...
No Matches
TraceCategory Class Reference

This singleton class provides a way to mark TraceEvent instances with category Ids which can be used to filter them. More...

#include <category.h>

Public Types

enum  : TraceCategoryId { Default = 0 }
 Default category if none are explicitly specified when creating a TraceEvent. More...
 

Public Member Functions

TRACE_API void RegisterCategory (TraceCategoryId id, const std::string &name)
 Associates the id with name.
 
TRACE_API std::vector< std::string > GetCategories (TraceCategoryId id) const
 Returns all names associated with the id.
 

Static Public Member Functions

template<int N>
static constexpr TraceCategoryId CreateTraceCategoryId (const char(&str)[N])
 Computes an id for the given a string literal str.
 
static TRACE_API TraceCategoryGetInstance ()
 Singleton accessor.
 

Friends

class TfSingleton< TraceCategory >
 

Detailed Description

This singleton class provides a way to mark TraceEvent instances with category Ids which can be used to filter them.

This class also provides a way to associate TraceCategoryId values with human readable names.

Definition at line 54 of file category.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : TraceCategoryId

Default category if none are explicitly specified when creating a TraceEvent.

Definition at line 65 of file category.h.

Member Function Documentation

◆ CreateTraceCategoryId()

static constexpr TraceCategoryId CreateTraceCategoryId ( const char(&)  str[N])
inlinestaticconstexpr

Computes an id for the given a string literal str.

Definition at line 58 of file category.h.

◆ GetCategories()

TRACE_API std::vector< std::string > GetCategories ( TraceCategoryId  id) const

Returns all names associated with the id.

◆ GetInstance()

static TRACE_API TraceCategory & GetInstance ( )
static

Singleton accessor.

◆ RegisterCategory()

TRACE_API void RegisterCategory ( TraceCategoryId  id,
const std::string &  name 
)

Associates the id with name.

These associates are not necessarily unique.

Friends And Related Function Documentation

◆ TfSingleton< TraceCategory >

friend class TfSingleton< TraceCategory >
friend

Definition at line 75 of file category.h.


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