automotive-dlt
dlt_cpp_extension.hpp File Reference
#include <string>
#include <vector>
#include <list>
#include <map>
#include "dlt.h"
Include dependency graph for dlt_cpp_extension.hpp:

Go to the source code of this file.

Macros

#define DLT_LOG_CXX(CONTEXT, LOGLEVEL, ...)
 macro to write a log message with variable number of arguments and without the need to specify the type of log data More...
 
#define DLT_LOG_FCN_CXX(CONTEXT, LOGLEVEL, ...)
 macro to write a log message with variable number of arguments and without the need to specify the type of log data. More...
 

Functions

template<typename T >
int32_t logToDlt (DltContextData &log, T const &value)=delete
 
template<>
int32_t logToDlt (DltContextData &log, int8_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, int16_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, int32_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, int64_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, uint8_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, uint16_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, uint32_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, uint64_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, float32_t const &value)
 
template<>
int32_t logToDlt (DltContextData &log, double const &value)
 
template<>
int32_t logToDlt (DltContextData &log, bool const &value)
 
static int32_t logToDlt (DltContextData &log, char const *const value)
 
static int32_t logToDlt (DltContextData &log, char *const value)
 
template<>
int32_t logToDlt (DltContextData &log, std::string const &value)
 
template<typename _Tp , typename _Alloc = std::allocator<_Tp>>
static int32_t logToDlt (DltContextData &log, std::vector< _Tp, _Alloc > const &value)
 
template<typename _Tp , typename _Alloc = std::allocator<_Tp>>
static int32_t logToDlt (DltContextData &log, std::list< _Tp, _Alloc > const &value)
 
template<typename _Key , typename _Tp , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<std::pair<const _Key, _Tp>>>
static int32_t logToDlt (DltContextData &log, std::map< _Key, _Tp, _Compare, _Alloc > const &value)
 
template<typename First >
static int32_t logToDltVariadic (DltContextData &log, First const &valueA)
 
template<typename First , typename... Rest>
static int32_t logToDltVariadic (DltContextData &log, First const &valueA, const Rest &...valueB)
 

Detailed Description

Author
Stefan Vacek stefa.nosp@m.n.va.nosp@m.cek@i.nosp@m.ntel.nosp@m..com Intel Corporation

Definition in file dlt_cpp_extension.hpp.

Macro Definition Documentation

#define DLT_LOG_CXX (   CONTEXT,
  LOGLEVEL,
  ... 
)
Value:
do\
{\
DltContextData log;\
if (dlt_user_log_write_start(&CONTEXT,&log,LOGLEVEL)>0)\
{\
logToDltVariadic(log, ##__VA_ARGS__);\
}\
}\
while(0)
static int32_t logToDltVariadic(DltContextData &log, First const &valueA)
DltReturnValue dlt_user_log_write_finish(DltContextData *log)
Definition: dlt_user.c:1482
DltReturnValue dlt_user_log_write_start(DltContext *handle, DltContextData *log, DltLogLevelType loglevel)
Definition: dlt_user.c:1428

macro to write a log message with variable number of arguments and without the need to specify the type of log data

The macro can be used with any type that provides a logToDlt function.

Example: DLT_LOG_CXX(dltContext, DLT_LV_X, "text", valueA, valueB, ...)

Definition at line 198 of file dlt_cpp_extension.hpp.

#define DLT_LOG_FCN_CXX (   CONTEXT,
  LOGLEVEL,
  ... 
)
Value:
do\
{\
DltContextData log;\
if (dlt_user_log_write_start(&CONTEXT, &log, LOGLEVEL) > 0)\
{\
dlt_user_log_write_string(&log, __PRETTY_FUNCTION__);\
logToDltVariadic(log, ##__VA_ARGS__);\
}\
}\
while(0)
DltReturnValue dlt_user_log_write_string(DltContextData *log, const char *text)
Definition: dlt_user.c:2280
static int32_t logToDltVariadic(DltContextData &log, First const &valueA)
DltReturnValue dlt_user_log_write_finish(DltContextData *log)
Definition: dlt_user.c:1482
DltReturnValue dlt_user_log_write_start(DltContext *handle, DltContextData *log, DltLogLevelType loglevel)
Definition: dlt_user.c:1428

macro to write a log message with variable number of arguments and without the need to specify the type of log data.

The macro can be used with any type that provides a logToDlt function. This includes all the types that are code generated.

This macro is similar to DLT_LOG_CXX. However, it adds the current function name as the first log argument.

Example: DLT_LOG_FCN_CXX(dltContext, DLT_LV_X, "text", valueA, valueB, ...)

Definition at line 221 of file dlt_cpp_extension.hpp.

Function Documentation

template<typename T >
int32_t logToDlt ( DltContextData log,
T const &  value 
)
delete

Referenced by logToDlt(), and logToDltVariadic().

template<>
int32_t logToDlt ( DltContextData log,
int8_t const &  value 
)
inline

Definition at line 41 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_int8().

template<>
int32_t logToDlt ( DltContextData log,
int16_t const &  value 
)
inline

Definition at line 47 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_int16().

template<>
int32_t logToDlt ( DltContextData log,
int32_t const &  value 
)
inline

Definition at line 53 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_int32().

template<>
int32_t logToDlt ( DltContextData log,
int64_t const &  value 
)
inline

Definition at line 59 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_int64().

template<>
int32_t logToDlt ( DltContextData log,
uint8_t const &  value 
)
inline

Definition at line 65 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_uint8().

template<>
int32_t logToDlt ( DltContextData log,
uint16_t const &  value 
)
inline

Definition at line 71 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_uint16().

template<>
int32_t logToDlt ( DltContextData log,
uint32_t const &  value 
)
inline

Definition at line 77 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_uint32().

template<>
int32_t logToDlt ( DltContextData log,
uint64_t const &  value 
)
inline

Definition at line 83 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_uint64().

template<>
int32_t logToDlt ( DltContextData log,
float32_t const &  value 
)
inline

Definition at line 89 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_float32().

template<>
int32_t logToDlt ( DltContextData log,
double const &  value 
)
inline

Definition at line 95 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_float64().

template<>
int32_t logToDlt ( DltContextData log,
bool const &  value 
)
inline

Definition at line 101 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_bool().

static int32_t logToDlt ( DltContextData log,
char const *const  value 
)
inlinestatic

Definition at line 106 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_utf8_string().

static int32_t logToDlt ( DltContextData log,
char *const  value 
)
inlinestatic

Definition at line 111 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_utf8_string().

template<>
int32_t logToDlt ( DltContextData log,
std::string const &  value 
)
inline

Definition at line 117 of file dlt_cpp_extension.hpp.

References dlt_user_log_write_utf8_string(), and logToDlt().

template<typename _Tp , typename _Alloc = std::allocator<_Tp>>
static int32_t logToDlt ( DltContextData log,
std::vector< _Tp, _Alloc > const &  value 
)
inlinestatic

Definition at line 127 of file dlt_cpp_extension.hpp.

References logToDlt().

template<typename _Tp , typename _Alloc = std::allocator<_Tp>>
static int32_t logToDlt ( DltContextData log,
std::list< _Tp, _Alloc > const &  value 
)
inlinestatic

Definition at line 141 of file dlt_cpp_extension.hpp.

References logToDlt().

template<typename _Key , typename _Tp , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<std::pair<const _Key, _Tp>>>
static int32_t logToDlt ( DltContextData log,
std::map< _Key, _Tp, _Compare, _Alloc > const &  value 
)
inlinestatic

Definition at line 156 of file dlt_cpp_extension.hpp.

References logToDlt().

template<typename First >
static int32_t logToDltVariadic ( DltContextData log,
First const &  valueA 
)
inlinestatic

Definition at line 174 of file dlt_cpp_extension.hpp.

References logToDlt().

Referenced by logToDltVariadic().

template<typename First , typename... Rest>
static int32_t logToDltVariadic ( DltContextData log,
First const &  valueA,
const Rest &...  valueB 
)
inlinestatic

Definition at line 180 of file dlt_cpp_extension.hpp.

References logToDlt(), and logToDltVariadic().