From bd3a6dfb649468e3e3bd13a2edec69baec916fa1 Mon Sep 17 00:00:00 2001 From: Zhen Wei Date: Thu, 11 May 2023 10:24:03 +0800 Subject: [PATCH] Let user define strings in pevent collector (#427) --- sparta/sparta/pevents/PeventCollector.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sparta/sparta/pevents/PeventCollector.hpp b/sparta/sparta/pevents/PeventCollector.hpp index 5474645f35..54ebbdc807 100644 --- a/sparta/sparta/pevents/PeventCollector.hpp +++ b/sparta/sparta/pevents/PeventCollector.hpp @@ -32,6 +32,7 @@ namespace pevents{ class PeventCollector : public PairCollector, public PeventCollectorTreeNode { + protected: using PairCollector::getPEventLogVector; using PairCollector::turnOn_; using PairCollector::turnOff_; @@ -180,14 +181,14 @@ namespace pevents{ * \brief Override the generateCollectionString_() of the bases PairCollector, * In this method, we use the pair_cache owned by PairCache. */ - virtual void generateCollectionString_() override final + virtual void generateCollectionString_() override { // Write the pevent to the log. std::stringstream ss; // Write the event name. ss << "ev=" << "\"" << event_name_ << "\" "; - // Now write the chached key values. + // Now write the cached key values. for(const auto & pair : getPEventLogVector()) { ss << pair.first << "=" << "\"" << pair.second << "\" "; @@ -199,7 +200,7 @@ namespace pevents{ ss << ";"; message_src_ << ss.str(); } - private: + const std::string event_name_; // We are going to use sparta's logger to output our pevents for ease. log::MessageSource message_src_;