1010#include < TSystem.h>
1111#include < TClass.h>
1212// O2
13- #include " Common/Exceptions.h"
13+ #include < Common/Exceptions.h>
1414#include < Configuration/ConfigurationFactory.h>
1515// QC
1616#include " QualityControl/DatabaseFactory.h"
@@ -57,7 +57,7 @@ Checker::Checker(std::string checkerName, std::string configurationSource)
5757
5858 // monitoring
5959 try {
60- mCollector = std::shared_ptr <AliceO2::Monitoring::Collector>(new AliceO2::Monitoring::Collector ( configurationSource) );
60+ mCollector = std::make_shared <AliceO2::Monitoring::Collector>(configurationSource);
6161 mCollector ->addDerivedMetric (" objects" , AliceO2::Monitoring::DerivedMetricMode::RATE);
6262 } catch (...) {
6363 string diagnostic = boost::current_exception_diagnostic_information ();
@@ -131,7 +131,7 @@ Checker::~Checker()
131131int size_t2int (size_t val)
132132{
133133 if (val > INT_MAX) {
134- throw new out_of_range (" Conversion from size_t to int failed." );
134+ throw out_of_range (" Conversion from size_t to int failed." );
135135 }
136136 return (int ) val;
137137}
@@ -147,7 +147,7 @@ bool Checker::HandleData(FairMQMessagePtr &msg, int index)
147147
148148 // Deserialize the object and process it
149149 HistoMessage tm (msg->GetData (), size_t2int (msg->GetSize ()));
150- MonitorObject *mo = dynamic_cast <MonitorObject *>(tm.ReadObject (tm.GetClass ()));
150+ auto *mo = dynamic_cast <MonitorObject *>(tm.ReadObject (tm.GetClass ()));
151151 if (mo) {
152152 mo->setIsOwner (true );
153153 check (mo);
@@ -162,7 +162,6 @@ bool Checker::HandleData(FairMQMessagePtr &msg, int index)
162162 endLastObject = system_clock::now ();
163163 // if 10 seconds elapsed publish stats
164164 if (timer.isTimeout ()) {
165- double current = timer.getTime ();
166165 timer.reset (1000000 ); // 10 s.
167166 mCollector ->send (mTotalNumberHistosReceived , " objects" );
168167 }
@@ -228,7 +227,7 @@ void Checker::send(MonitorObject *mo)
228227// / \param libraryName The name of the library to load.
229228void Checker::loadLibrary (const string libraryName)
230229{
231- if (boost::algorithm::trim_copy (libraryName) == " " ) {
230+ if (boost::algorithm::trim_copy (libraryName). empty () ) {
232231 mLogger << " no library name specified" << AliceO2::InfoLogger::InfoLogger::endm;
233232 return ;
234233 }
@@ -255,9 +254,9 @@ CheckInterface *Checker::instantiateCheck(string checkName, string className)
255254 mLogger << " Loading class " << className << AliceO2::InfoLogger::InfoLogger::endm;
256255 cl = TClass::GetClass (className.c_str ());
257256 if (!cl) {
258- tempString += " because no dictionary for class named \" " ;
257+ tempString += R"( because no dictionary for class named " ) " ;
259258 tempString += className;
260- tempString += " \ " could be retrieved" ;
259+ tempString += R"( " could be retrieved) " ;
261260 cerr << tempString << endl;
262261 BOOST_THROW_EXCEPTION (FatalException () << errinfo_details (tempString));
263262 }
@@ -270,9 +269,9 @@ CheckInterface *Checker::instantiateCheck(string checkName, string className)
270269 mLogger << " Instantiating class " << className << " (" << cl << " )" << AliceO2::InfoLogger::InfoLogger::endm;
271270 result = static_cast <CheckInterface *>(cl->New ());
272271 if (!result) {
273- tempString += " because the class named \" " ;
272+ tempString += R"( because the class named " ) " ;
274273 tempString += className;
275- tempString += " \" does not follow the TaskInterface interface " ;
274+ tempString += R"( because the class named " ) " ;
276275 BOOST_THROW_EXCEPTION (FatalException () << errinfo_details (tempString));
277276 }
278277 result->configure (checkName);
0 commit comments