µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
os::rtos::internal::object_named Class Reference

Base class for named objects. More...

#include <cmsis-plus/rtos/os.h>

Inherited by os::rtos::clock, os::rtos::internal::object_named_system, and os::rtos::memory::memory_resource.

Public Member Functions

Constructors & Destructor
 object_named ()
 Construct a named object instance. More...
 
 object_named (const char *name)
 Construct a named object instance. More...
 
 ~object_named ()=default
 Destruct the named object instance. More...
 
Public Member Functions
const char * name (void) const
 Get object name. More...
 

Detailed Description

Base class for named objects.

This class serves as a base class for all objects that have a name (most of the RTOS classes do have a name).

Attributes use a separate constexpr object.

Definition at line 350 of file os-decls.h.

Constructor & Destructor Documentation

◆ object_named() [1/2]

os::rtos::internal::object_named::object_named ( )

Construct a named object instance.

Definition at line 600 of file os-core.cpp.

◆ object_named() [2/2]

os::rtos::internal::object_named::object_named ( const char *  name)

Construct a named object instance.

Parameters
[in]nameNull terminated name. If nullptr, "-" is assigned.

Prefer the given name, otherwise default to '-'.

To save space, instead of copying the null terminated string locally, the pointer to the string is copied, so the caller must ensure that the pointer life cycle is at least as long as the object life cycle. A constant string (stored in flash) is preferred.

Definition at line 616 of file os-core.cpp.

◆ ~object_named()

os::rtos::internal::object_named::~object_named ( )
default

Destruct the named object instance.

Member Function Documentation

◆ name()

const char * os::rtos::internal::object_named::name ( void  ) const
inline

Get object name.

Parameters
None.
Returns
A null terminated string.

All objects return a non-null string; anonymous objects return "-".

Note
Can be invoked from Interrupt Service Routines.

Definition at line 760 of file os-decls.h.


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