TraceCategory Class Reference

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

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. More...
 
TRACE_API std::vector< std::string > GetCategories (TraceCategoryId id) const
 Returns all names associated with the id. More...
 

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. More...
 
static TRACE_API TraceCategoryGetInstance ()
 Singleton accessor. More...
 

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])
inlinestatic

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.


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