The Gaudi Framework  v36r7 (7f57a304)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ArrayProperties.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // ============================================================================
12 // Include files
13 // ============================================================================
14 // GaudiAlg
15 // ============================================================================
17 // ============================================================================
18 // GaudiKernel
19 // ============================================================================
20 #define NO_C_ARRAY_AS_PROPERTY_WARNING
22 // ============================================================================
28 // ============================================================================
29 namespace Gaudi {
30  // ==========================================================================
31  namespace Examples {
32  // ========================================================================
34  public:
35  // ======================================================================
37  StatusCode execute() override;
38  // ======================================================================
39  public:
40  // ======================================================================
44  ArrayProperties( const std::string& name, // algorithm instance name
45  ISvcLocator* pSvc ) // service locator
46  : GaudiAlgorithm( name, pSvc ) {
47  //
49  std::fill( std::begin( m_strings ), std::end( m_strings ), "blah-blah-blah" );
50  //
51  declareProperty( "Doubles", m_doubles, "C-array of doubles" );
52  declareProperty( "Strings", m_strings, "C-array of strings" );
53  }
54  // ======================================================================
56  ArrayProperties( const ArrayProperties& ) = delete; // no copy constructor
58  ArrayProperties& operator=( const ArrayProperties& ) = delete; // no assignment
59  // ======================================================================
60  private:
61  // ======================================================================
63  double m_doubles[5]; // array of doubles
65  std::string m_strings[4]; // array of strings
66  // ======================================================================
67  };
68  // ========================================================================
69  } // namespace Examples
70  // ==========================================================================
71 } // end of namespace Gaudi
72 // ============================================================================
73 // execute it!
74 // ============================================================================
76  //
77  info() << " Doubles : " << Gaudi::Utils::toString( m_doubles ) << endmsg;
78  info() << " Strings : " << Gaudi::Utils::toString( m_strings ) << endmsg;
79  //
80  return StatusCode::SUCCESS;
81 }
82 // ============================================================================
84 // ============================================================================
87 // ============================================================================
88 // The END
89 // ============================================================================
std::string
STL class.
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:542
ISvcLocator
Definition: ISvcLocator.h:46
Gaudi::Algorithm::declareProperty
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
Definition: Algorithm.h:302
Gaudi::Examples::ArrayProperties::m_strings
std::string m_strings[4]
array of strings
Definition: ArrayProperties.cpp:65
ArrayProperties
Definition: ArrayProperties.py:1
Gaudi::Examples::ArrayProperties::ArrayProperties
ArrayProperties(const std::string &name, ISvcLocator *pSvc)
Standard constructor.
Definition: ArrayProperties.cpp:44
Gaudi::Examples::ArrayProperties::operator=
ArrayProperties & operator=(const ArrayProperties &)=delete
assignment operator is disabled
std::fill
T fill(T... args)
StatusCode
Definition: StatusCode.h:65
GaudiAlgorithm
Definition: GaudiAlgorithm.h:104
Gaudi::Examples::ArrayProperties::ArrayProperties
ArrayProperties(const ArrayProperties &)=delete
copy constructor is disabled
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
CArrayAsProperty.h
Gaudi::Examples::ArrayProperties::execute
StatusCode execute() override
execute it!
Definition: ArrayProperties.cpp:75
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:353
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::begin
T begin(T... args)
GaudiAlgorithm.h
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
Gaudi::Examples::ArrayProperties::m_doubles
double m_doubles[5]
array of doubles
Definition: ArrayProperties.cpp:63
std::end
T end(T... args)
Gaudi::Examples::ArrayProperties
Definition: ArrayProperties.cpp:33