VulkanRaytracingCycles 0.0.0
Cycles Render Engine With VulkanRaytracingShaderModules. ( Experiment , in progress)
Harness::internal::Tracer Class Reference

#include <harness_defs.h>

Public Types

enum  { prefix = 1 , need_lf = 2 }
 

Public Member Functions

 Tracer ()
 
Tracerset_trace_info (int flags, const char *file, size_t line, const char *func)
 
void trace (const char *fmt,...)
 

Detailed Description

Definition at line 312 of file harness_defs.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
prefix 
need_lf 

Definition at line 321 of file harness_defs.h.

Constructor & Destructor Documentation

◆ Tracer()

Harness::internal::Tracer::Tracer ( )
inline

Definition at line 326 of file harness_defs.h.

326: m_flags(0), m_file(NULL), m_func(NULL), m_line(0) {}

Member Function Documentation

◆ set_trace_info()

Tracer * Harness::internal::Tracer::set_trace_info ( int  flags,
const char *  file,
size_t  line,
const char *  func 
)
inline

Definition at line 328 of file harness_defs.h.

328 {
329 m_flags = flags;
330 m_line = line;
331 m_file = file;
332 m_func = func;
333 return this;
334 }

◆ trace()

void Harness::internal::Tracer::trace ( const char *  fmt,
  ... 
)
inline

Definition at line 336 of file harness_defs.h.

336 {
337 char msg[MAX_TRACE_SIZE];
338 char msg_fmt_buf[MAX_TRACE_SIZE];
339 const char* msg_fmt = fmt;
340 if (m_flags & prefix) {
341 snprintf(msg_fmt_buf, MAX_TRACE_SIZE, "[%s] %s", m_func, fmt);
342 msg_fmt = msg_fmt_buf;
343 }
344 std::va_list argptr;
345 va_start(argptr, fmt);
346 int len = vsnprintf(msg, MAX_TRACE_SIZE, msg_fmt, argptr);
347 va_end(argptr);
348 if (m_flags & need_lf &&
349 len < MAX_TRACE_SIZE - 1 && msg_fmt[len - 1] != '\n')
350 {
351 msg[len] = '\n';
352 msg[len + 1] = 0;
353 }
354 m_reporter.Report(msg);
355 }
#define MAX_TRACE_SIZE
Definition: harness_defs.h:268

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