SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk::ITraceable Class Reference

Traceable object. More...

#include <stk_common.h>

Inheritance diagram for stk::ITraceable:

Public Member Functions

void SetTraceName (const char *name)
 Set name.
const char * GetTraceName () const
 Get name.

Protected Member Functions

 ~ITraceable ()=default
 Destructor.

Detailed Description

Traceable object.

Note
Used for debugging and tracing by tools like SEGGER SystemView. See STK_SYNC_DEBUG_NAMES.

Definition at line 510 of file stk_common.h.

Constructor & Destructor Documentation

◆ ~ITraceable()

stk::ITraceable::~ITraceable ( )
protecteddefault

Destructor.

Note
Protected by design. Prevents unsafe polymorphic delete.

Member Function Documentation

◆ GetTraceName()

const char * stk::ITraceable::GetTraceName ( ) const
inline

Get name.

Returns
Name string, or NULL if not set or if STK_SYNC_DEBUG_NAMES is 0.

Definition at line 534 of file stk_common.h.

535 {
536 #if STK_SYNC_DEBUG_NAMES
537 return m_trace_name;
538 #else
539 return nullptr;
540 #endif
541 }

◆ SetTraceName()

void stk::ITraceable::SetTraceName ( const char * name)
inline

Set name.

Parameters
[in]nameNull-terminated string or NULL.
Note
If STK_SYNC_DEBUG_NAMES is 0 then calling this function has no effect.

Definition at line 522 of file stk_common.h.

523 {
524 #if STK_SYNC_DEBUG_NAMES
525 m_trace_name = name;
526 #else
527 STK_UNUSED(name);
528 #endif
529 }
#define STK_UNUSED(X)
Explicitly marks a variable as unused to suppress compiler warnings.
Definition stk_defs.h:715

References STK_UNUSED.

Referenced by stk::memory::BlockMemoryPool::BlockMemoryPool(), and stk::memory::BlockMemoryPool::BlockMemoryPool().

Here is the caller graph for this function:

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