NEML2 2.0.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
TraceWriter Struct Reference

#include <TracingInterface.h>

Public Member Functions

 TraceWriter (const std::filesystem::path &file)
 Constructor.
 
 ~TraceWriter ()
 Destructor.
 
 TraceWriter (const TraceWriter &)=delete
 Special methods.
 
 TraceWriter (TraceWriter &&)=delete
 
TraceWriteroperator= (const TraceWriter &)=delete
 
TraceWriteroperator= (TraceWriter &&)=delete
 
void trace_duration_begin (const std::string &name, const std::string &category, const json &args={}, unsigned int pid=0)
 
void trace_duration_end (const std::string &name, const std::string &category, const json &args={}, unsigned int pid=0)
 
void trace_instant (const std::string &name, const std::string &category, const json &args={}, const std::string &scope="t", unsigned int pid=0)
 

Public Attributes

const std::string filename
 File name.
 
std::ofstream out
 Output stream for the trace file.
 

Constructor & Destructor Documentation

◆ TraceWriter() [1/3]

TraceWriter ( const std::filesystem::path & file)

Constructor.

◆ ~TraceWriter()

Destructor.

◆ TraceWriter() [2/3]

TraceWriter ( const TraceWriter & )
delete

Special methods.

◆ TraceWriter() [3/3]

TraceWriter ( TraceWriter && )
delete

Member Function Documentation

◆ operator=() [1/2]

TraceWriter & operator= ( const TraceWriter & )
delete

◆ operator=() [2/2]

TraceWriter & operator= ( TraceWriter && )
delete

◆ trace_duration_begin()

void trace_duration_begin ( const std::string & name,
const std::string & category,
const json & args = {},
unsigned int pid = 0 )

◆ trace_duration_end()

void trace_duration_end ( const std::string & name,
const std::string & category,
const json & args = {},
unsigned int pid = 0 )

◆ trace_instant()

void trace_instant ( const std::string & name,
const std::string & category,
const json & args = {},
const std::string & scope = "t",
unsigned int pid = 0 )

Member Data Documentation

◆ filename

const std::string filename

File name.

◆ out

std::ofstream out

Output stream for the trace file.