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::python_class_name< void > Struct Reference

#include "timemory/operations/types/python_class_name.hpp"

+ Collaboration diagram for tim::operation::python_class_name< void >:

Public Member Functions

std::string operator() (std::string id) const
 

Detailed Description

Definition at line 57 of file python_class_name.hpp.

Member Function Documentation

◆ operator()()

std::string tim::operation::python_class_name< void >::operator() ( std::string  id) const
inline

Definition at line 82 of file python_class_name.hpp.

83{
84 if(id.empty())
85 return std::string{};
86
87 for(auto& itr : id)
88 itr = ::tolower(itr);
89
90 // capitalize after every delimiter
91 for(size_t i = 0; i < id.size(); ++i)
92 {
93 if(i == 0)
94 id.at(i) = ::toupper(id.at(i));
95 else
96 {
97 if((id.at(i) == '_' || id.at(i) == '-') && i + 1 < id.length())
98 {
99 id.at(i + 1) = ::toupper(id.at(i + 1));
100 ++i;
101 }
102 }
103 }
104 // remove all delimiters
105 for(auto ditr : { '_', '-' })
106 {
107 size_t _pos = 0;
108 while((_pos = id.find(ditr)) != std::string::npos)
109 id = id.erase(_pos, 1);
110 }
111
112 return id;
113}
tim::mpl::apply< std::string > string
Definition: macros.hpp:53
_args at(0)

References tim::at().

Referenced by tim::operation::python_class_name< Tp >::operator()().


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