Skip to content
Snippets Groups Projects
Commit d4f5ec22 authored by Scott Snyder's avatar Scott Snyder Committed by Walter Lampl
Browse files

EventBookkeeperMetaData: Fix cppcheck warnings.

EventBookkeeperMetaData: Fix cppcheck warnings.

Prefer initializing members in an initializer list.
Pass strings by const reference.
parent 4037d26e
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,8 @@ class EventBookkeeper
void setChildrenEventBookkeepers(std::vector<EventBookkeeper*>* childrenEB );
void AddChild(EventBookkeeper* eb);
void AddChildren( std::vector<EventBookkeeper*>* children );
EventBookkeeper* AddNewChild(std::string name, std::string description);
EventBookkeeper* AddNewChild(const std::string& name,
const std::string& description);
bool isEqualTo( const EventBookkeeper *eb );
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -26,7 +26,7 @@ class SkimDecision
// get() and set() methods
std::string getName() const { return m_name; }
void setName( std::string name );
void setName( const std::string& name );
bool isAccepted() const { return m_isAccepted; }
void setIsAccepted( bool answer );
......
......@@ -35,16 +35,18 @@ EventBookkeeper::EventBookkeeper(const std::string& name,
}
EventBookkeeper::EventBookkeeper( const EventBookkeeper& rhs )
: m_name (rhs.m_name),
m_description (rhs.m_description),
m_inputstream (rhs.m_inputstream),
m_outputstream (rhs.m_outputstream),
m_logic (rhs.m_logic),
m_nAcceptedEvents (rhs.m_nAcceptedEvents),
m_nWeightedAcceptedEvents (rhs.m_nWeightedAcceptedEvents),
m_cycle (rhs.m_cycle),
m_parentIndex (rhs.m_parentIndex),
m_declaredChildFilter (rhs.m_declaredChildFilter),
m_declaredTopFilter (rhs.m_declaredTopFilter)
{
m_name=rhs.m_name;
m_description=rhs.m_description;
m_inputstream=rhs.m_inputstream;
m_outputstream = rhs.m_outputstream;
m_logic = rhs.m_logic;
m_nAcceptedEvents=rhs.m_nAcceptedEvents;
m_nWeightedAcceptedEvents=rhs.m_nWeightedAcceptedEvents;
m_cycle=rhs.m_cycle;
m_parentIndex=rhs.m_parentIndex;
//Make a new deep copy of the children, as these will be owned by this
m_childrenEB = new std::vector<EventBookkeeper*>;
m_childrenEB->reserve(rhs.m_childrenEB->size());
......@@ -57,8 +59,6 @@ EventBookkeeper::EventBookkeeper( const EventBookkeeper& rhs )
for(unsigned int i=0; i<rhs.m_childrenIndices->size(); i++){
m_childrenIndices->push_back(rhs.m_childrenIndices->at(i));
}
m_declaredChildFilter=rhs.m_declaredChildFilter;
m_declaredTopFilter=rhs.m_declaredTopFilter;
}
EventBookkeeper&
......@@ -268,7 +268,9 @@ void EventBookkeeper::AddChildren( std::vector<EventBookkeeper*>* children ){
return;
}
EventBookkeeper* EventBookkeeper::AddNewChild(std::string name, std::string description){
EventBookkeeper* EventBookkeeper::AddNewChild(const std::string& name,
const std::string& description)
{
EventBookkeeper* eb = new EventBookkeeper(name,description,"Child");
AddChild(eb);
return eb;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -14,16 +14,15 @@
////////////////
SkimDecision::SkimDecision()
: m_isAccepted (true)
{
m_name="";
m_isAccepted=true;
}
SkimDecision::SkimDecision( const SkimDecision& rhs )
: m_name (rhs.m_name),
m_isAccepted (rhs.m_isAccepted)
{
m_name=rhs.m_name;
m_isAccepted=rhs.m_isAccepted;
}
void SkimDecision::setName( std::string name ){ m_name=name; }
void SkimDecision::setName( const std::string& name ){ m_name=name; }
void SkimDecision::setIsAccepted( bool answer ){ m_isAccepted=answer; }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment