5 #ifndef _HEBench_TimingReport_H_0596d40a3cce4b108a81595c50eb286d
6 #define _HEBench_TimingReport_H_0596d40a3cce4b108a81595c50eb286d
13 #include <unordered_map>
35 void newEventType(std::uint32_t set_id,
const std::string &set_header,
bool is_main_event =
false);
36 const std::unordered_map<std::uint32_t, std::string> &
getEventTypes()
const {
return m_event_headers; }
37 const std::vector<std::uint32_t> &
getEventTypeIDs()
const {
return m_event_types; }
41 void newEvent(std::shared_ptr<TimingReportEventC> p_event,
const std::string &set_header = std::string());
42 const std::vector<std::shared_ptr<TimingReportEventC>> &
getEvents()
const {
return m_events; }
46 const std::string &
getHeader()
const {
return m_header; }
47 void setHeader(
const std::string &header) { m_header = header; }
48 void appendHeader(
const std::string &header,
bool new_line);
51 const std::string &
getFooter()
const {
return m_footer; }
52 void setFooter(
const std::string &footer) { m_footer = footer; }
53 void appendFooter(
const std::string &footer,
bool new_line);
77 static std::string_view findNextValueCSV(std::size_t &out_start_idx,
78 std::size_t &out_count,
90 static void parseHeadingValue(std::string &s_out_heading, std::uint64_t &out_value,
91 const std::string &s_line);
102 static void parseHeadingValue(std::string &s_out_heading,
double &out_value,
103 const std::string &s_line);
113 static std::istream &getTrimmedLine(std::istream &is, std::string &s_out,
114 const std::string &extra_trim = std::string());
126 static std::istream &getTrimmedLine(std::istream &is, std::string &s_out,
127 const std::string &extra_ltrim,
const std::string &extra_rtrim);
136 static std::string readTextBlock(std::istream &is, std::string &s_block,
137 const std::vector<std::string> tags);
138 static void parseTimingEvent(std::string &s_out_event_header,
139 std::shared_ptr<TimingReportEventC> &p_out_event,
140 const std::string &s_line);
142 std::string m_header;
143 std::string m_footer;
144 std::uint32_t m_main_event;
145 std::unordered_map<std::uint32_t, std::string> m_event_headers;
146 std::vector<std::uint32_t> m_event_types;
147 std::vector<std::shared_ptr<TimingReportEventC>> m_events;
static constexpr const char * TagReportFooter
void appendHeader(const std::string &header, bool new_line)
void prependHeader(const std::string &header, bool new_line)
std::ostream & convert2CSV(std::ostream &os) const
static void setTimingPrefix(TimingPrefixedSeconds &prefix, double seconds, char ch_prefix)
void setHeader(const std::string &header)
void setFooter(const std::string &footer)
const std::vector< std::uint32_t > & getEventTypeIDs() const
const std::unordered_map< std::uint32_t, std::string > & getEventTypes() const
void prependFooter(const std::string &footer, bool new_line)
const std::vector< std::shared_ptr< TimingReportEventC > > & getEvents() const
void appendFooter(const std::string &footer, bool new_line)
static constexpr const char * TagVersion
const std::string & getHeader() const
void newEventType(std::uint32_t set_id, const std::string &set_header, bool is_main_event=false)
static constexpr const char * TagReportEnd
void reserveCapacityForEvents(std::size_t new_capacity)
static constexpr const char * TagReportData
static constexpr const char * TagFailedTest
static constexpr const char * TagReportHeader
static void computeTimingPrefix(TimingPrefixedSeconds &prefix, double seconds)
const std::string & getFooter() const
std::uint32_t getMainEventID() const
static TimingReportImpl loadCSV(std::istream &is)
void newEvent(std::shared_ptr< TimingReportEventC > p_event, const std::string &set_header=std::string())