Skip to content
Snippets Groups Projects
Commit c5d21f23 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'declareConstant.CaloRec-20200302' into 'master'

CaloRec: Remove StatusCode return from declareConstant.

Closes ATLASRECTS-5355

See merge request atlas/athena!30803
parents 1cac085a f46d7f62
No related branches found
No related tags found
No related merge requests found
// This file's extension implies that it's C, but it's really -*- C++ -*-. // This file's extension implies that it's C, but it's really -*- C++ -*-.
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
// $Id: ToolWithConstantsMixin.h,v 1.10 2009-04-18 02:56:16 ssnyder Exp $
/** /**
* @file ToolWithConstantsMixin.h * @file ToolWithConstantsMixin.h
* @author scott snyder <snyder@bnl.gov> * @author scott snyder <snyder@bnl.gov>
...@@ -196,9 +195,9 @@ public: ...@@ -196,9 +195,9 @@ public:
* be an instance of one of the @c Array<N> classes. * be an instance of one of the @c Array<N> classes.
*/ */
template <class T> template <class T>
StatusCode declareConstant (const std::string& name, void declareConstant (const std::string& name,
T& c, T& c,
bool deflt = false); bool deflt = false);
/** /**
...@@ -461,7 +460,7 @@ private: ...@@ -461,7 +460,7 @@ private:
* @brief Add a new constant to our store. * @brief Add a new constant to our store.
* @param pi The @c Propinfo instance describing this constant. * @param pi The @c Propinfo instance describing this constant.
*/ */
StatusCode add_constant (Propinfo_Base* pi); void add_constant (Propinfo_Base* pi);
/** /**
......
// This file's extension implies that it's C, but it's really -*- C++ -*-. // This file's extension implies that it's C, but it's really -*- C++ -*-.
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
// $Id: ToolWithConstantsMixin.icc,v 1.6 2009-04-18 02:56:16 ssnyder Exp $
/** /**
* @file ToolWithConstantsMixin.icc * @file ToolWithConstantsMixin.icc
* @author scott snyder <snyder@bnl.gov> * @author scott snyder <snyder@bnl.gov>
...@@ -76,14 +75,13 @@ StatusCode do_declare (ToolWithConstantsMixin* self, ...@@ -76,14 +75,13 @@ StatusCode do_declare (ToolWithConstantsMixin* self,
* be an instance of one of the @c Array<N> classes. * be an instance of one of the @c Array<N> classes.
*/ */
template <class T> template <class T>
StatusCode void
ToolWithConstantsMixin::declareConstant (const std::string& name, ToolWithConstantsMixin::declareConstant (const std::string& name,
T& c, T& c,
bool deflt /*= false*/) bool deflt /*= false*/)
{ {
c = T(); c = T();
CHECK( add_constant (makeinfo (name, c, deflt)) ); add_constant (makeinfo (name, c, deflt));
return StatusCode (StatusCode::SUCCESS, true);
} }
......
// This file's extension implies that it's C, but it's really -*- C++ -*-. // This file's extension implies that it's C, but it's really -*- C++ -*-.
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
// $Id: ToolWithConstantsMixin.cxx,v 1.12 2009-04-18 02:56:18 ssnyder Exp $
/** /**
* @file ToolWithConstantsMixin.cxx * @file ToolWithConstantsMixin.cxx
* @author scott snyder <snyder@bnl.gov> * @author scott snyder <snyder@bnl.gov>
...@@ -386,10 +385,10 @@ ToolWithConstantsMixin::setProperty (const Property& p) ...@@ -386,10 +385,10 @@ ToolWithConstantsMixin::setProperty (const Property& p)
* @brief Add a new constant to our store. * @brief Add a new constant to our store.
* @param pi The @c Propinfo instance describing this constant. * @param pi The @c Propinfo instance describing this constant.
*/ */
StatusCode ToolWithConstantsMixin::add_constant (Propinfo_Base* pi) void ToolWithConstantsMixin::add_constant (Propinfo_Base* pi)
{ {
if (!pi) if (!pi)
return StatusCode::FAILURE; return;
// Make sure that a name isn't duplicated. // Make sure that a name isn't duplicated.
for (unsigned int i=0; i < m_infos.size(); i++) for (unsigned int i=0; i < m_infos.size(); i++)
...@@ -397,14 +396,13 @@ StatusCode ToolWithConstantsMixin::add_constant (Propinfo_Base* pi) ...@@ -397,14 +396,13 @@ StatusCode ToolWithConstantsMixin::add_constant (Propinfo_Base* pi)
REPORT_ERROR(StatusCode::FAILURE) REPORT_ERROR(StatusCode::FAILURE)
<< "Duplicate constant: " << pi->m_name; << "Duplicate constant: " << pi->m_name;
delete pi; delete pi;
return StatusCode::FAILURE; return;
} }
// Record this declaration in @c m_infos. // Record this declaration in @c m_infos.
// @c makeinfo is one of an overloaded family of functions that // @c makeinfo is one of an overloaded family of functions that
// creates the @c Propinfo_* structure for the type of @a c. // creates the @c Propinfo_* structure for the type of @a c.
m_infos.push_back (pi); m_infos.push_back (pi);
return StatusCode::SUCCESS;
} }
......
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