timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::operation::finalize::ctest_notes_deleter Struct Reference

#include "timemory/operations/types/finalize/ctest_notes.hpp"

+ Collaboration diagram for tim::operation::finalize::ctest_notes_deleter:

Public Types

using strset_t = std::set< std::string >
 

Public Member Functions

 ctest_notes_deleter ()=default
 
 ~ctest_notes_deleter ()=default
 
void operator() (strset_t *data)
 

Detailed Description

Definition at line 50 of file ctest_notes.hpp.

Member Typedef Documentation

◆ strset_t

Definition at line 52 of file ctest_notes.hpp.

Constructor & Destructor Documentation

◆ ctest_notes_deleter()

tim::operation::finalize::ctest_notes_deleter::ctest_notes_deleter ( )
default

◆ ~ctest_notes_deleter()

tim::operation::finalize::ctest_notes_deleter::~ctest_notes_deleter ( )
default

Member Function Documentation

◆ operator()()

void tim::operation::finalize::ctest_notes_deleter::operator() ( strset_t data)
inline

Definition at line 57 of file ctest_notes.hpp.

58 {
60 if(data->empty() || !_settings || !_settings->get_ctest_notes())
61 {
62 delete data;
63 return;
64 }
65
66 std::stringstream ss;
67 // loop over filenames
68 for(auto&& itr : *data)
69 {
70 std::string str = itr;
71 size_t pos = std::string::npos;
72 while((pos = str.find('\\')) != std::string::npos)
73 str = str.replace(pos, 1, "/");
74 while((pos = str.find("//")) != std::string::npos)
75 str = str.replace(pos, 1, "/");
76 ss << "LIST(APPEND CTEST_NOTES_FILES \"" << str << "\")\n";
77 }
78
79 if(!data->empty())
80 ss << "LIST(REMOVE_DUPLICATES CTEST_NOTES_FILES)\n";
81
82 auto fname = settings::compose_output_filename("CTestNotes", "txt", false, -1,
84 std::ofstream ofs{};
85 if(filepath::open(ofs, fname, std::ios::out | std::ios::app))
86 {
88 {
89 std::cout << "[ctest_notes]> Outputting '" << fname << "'..."
90 << std::endl;
91 }
92 ofs << ss.str() << std::endl;
93 }
94 delete data;
95 }
bool open(std::ofstream &_ofs, std::string _fpath, Args &&... _args)
Definition: filepath.hpp:207
output_prefix
Definition: settings.cpp:1662
char argparse::argument_parser tim::settings * _settings
Definition: config.cpp:255
tim::mpl::apply< std::string > string
Definition: macros.hpp:53
size_t pos
Definition: config.cpp:102
static string_t compose_output_filename(string_t _tag, string_t _ext, bool _use_suffix=use_output_suffix(), int32_t _suffix=default_process_suffix(), bool _make_dir=false, std::string _explicit={})
Definition: settings.cpp:322
static settings * instance()
Definition: settings.hpp:536

References tim::_settings, tim::settings::compose_output_filename(), tim::debug, tim::settings::instance(), tim::filepath::open(), tim::output_prefix, tim::pos, and tim::verbose.


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