tracetools  master
Tracing tools and instrumentation for ROS 2
Macros | Functions
utils.hpp File Reference
#include <stddef.h>
#include <functional>
#include "tracetools/visibility_control.hpp"
Include dependency graph for utils.hpp:

Go to the source code of this file.

Macros

#define SYMBOL_UNKNOWN   "UNKNOWN"
 Default symbol, used when address resolution fails. More...
 

Functions

template<typename T , typename ... U>
const char * get_symbol (std::function< T(U...)> f)
 Get symbol from an std::function object. More...
 
template<typename L >
const char * get_symbol (L &&l)
 Get symbol from a function-related object. More...
 

Macro Definition Documentation

◆ SYMBOL_UNKNOWN

#define SYMBOL_UNKNOWN   "UNKNOWN"

Default symbol, used when address resolution fails.

Function Documentation

◆ get_symbol() [1/2]

template<typename T , typename ... U>
const char* get_symbol ( std::function< T(U...)>  f)

Get symbol from an std::function object.

If function address resolution or symbol demangling fails, this will return a string that starts with SYMBOL_UNKNOWN.

Parameters
[in]fthe std::function object
Returns
the symbol, or a placeholder

◆ get_symbol() [2/2]

template<typename L >
const char* get_symbol ( L &&  l)

Get symbol from a function-related object.

Fallback meant for lambdas with captures.

Parameters
[in]la generic object
Returns
the symbol