The Gaudi Framework  master (37c0b60a)
PropertyAlg.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 #ifndef GAUDIEXAMPLE_PROPERTYALG_H
12 #define GAUDIEXAMPLE_PROPERTYALG_H
13 
14 // Include files
15 #include <Gaudi/Property.h>
16 #include <GaudiKernel/Algorithm.h>
17 #include <GaudiKernel/MsgStream.h>
18 
19 #include <map>
20 #include <set>
21 #include <string>
22 #include <vector>
23 
29 class PropertyAlg : public Algorithm {
30 public:
32  PropertyAlg( const std::string& name, ISvcLocator* pSvcLocator );
34  StatusCode initialize() override;
35  StatusCode execute() override;
36  StatusCode finalize() override;
37 
41 
42 private:
45 
46  Gaudi::Property<int> m_int{ this, "Int", 100 };
47  Gaudi::Property<long long> m_int64{ this, "Int64", 100 };
49  Gaudi::Property<double> m_double{ this, "Double", 100. };
50  Gaudi::Property<std::string> m_string{ this, "String", "hundred" };
51  Gaudi::Property<bool> m_bool{ this, "Bool", true };
52 
60  Gaudi::Property<std::vector<double>> u_doublearrayunits{ this, "DoubleArrayWithUnits" };
61  Gaudi::Property<std::vector<double>> u_doublearray{ this, "DoubleArrayWithoutUnits" };
62 
65 
69 
71 
72  Gaudi::CheckedProperty<int> p_int{ this, "PInt", 100, "An integer property" };
73  Gaudi::PropertyWithReadHandler<double> p_double{ this, "PDouble", 100. };
74 
75  Gaudi::Property<std::string> p_string{ this, "PString", "hundred" };
76  Gaudi::Property<bool> p_bool{ this, "PBool", false };
77 
82 };
83 
84 #endif // GAUDIEXAMPLE_PROPERTYALG_H
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: PropertyBase.h:35
PropertyAlg::m_doublearray
Gaudi::Property< std::vector< double > > m_doublearray
Definition: PropertyAlg.h:56
PropertyAlg::m_emptyarray
Gaudi::Property< std::vector< double > > m_emptyarray
Definition: PropertyAlg.h:59
PropertyAlg::initialize
StatusCode initialize() override
Three mandatory member functions of any algorithm.
Definition: PropertyAlg.cpp:99
PropertyAlg::m_stringarray
Gaudi::Property< std::vector< std::string > > m_stringarray
Definition: PropertyAlg.h:57
std::string
STL class.
PropertyAlg::p_stringarray
Gaudi::Property< std::vector< std::string > > p_stringarray
Definition: PropertyAlg.h:80
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:526
PropertyAlg::m_strmap
Gaudi::Property< std::map< std::string, std::string > > m_strmap
Definition: PropertyAlg.h:70
PropertyAlg::p_double
Gaudi::PropertyWithReadHandler< double > p_double
Definition: PropertyAlg.h:73
ISvcLocator
Definition: ISvcLocator.h:46
Algorithm
Alias for backward compatibility.
Definition: Algorithm.h:58
PropertyAlg::p_bool
Gaudi::Property< bool > p_bool
Definition: PropertyAlg.h:76
Algorithm.h
PropertyAlg::u_intpairarray
Gaudi::Property< std::vector< std::pair< int, int > > > u_intpairarray
Definition: PropertyAlg.h:63
PropertyAlg::PropertyAlg
PropertyAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor of this form must be provided.
Definition: PropertyAlg.cpp:52
PropertyAlg::readHandler
void readHandler(Gaudi::Details::PropertyBase &)
Callbacks for properties.
Definition: PropertyAlg.cpp:32
PropertyAlg::p_doublearray
Gaudi::Property< std::vector< double > > p_doublearray
Definition: PropertyAlg.h:79
PropertyAlg::m_intset
Gaudi::Property< std::set< int > > m_intset
Definition: PropertyAlg.h:66
PropertyAlg::m_int64array
Gaudi::Property< std::vector< long long > > m_int64array
Definition: PropertyAlg.h:54
PropertyAlg::m_stringset
Gaudi::Property< std::set< std::string > > m_stringset
Definition: PropertyAlg.h:67
PropertyAlg::p_string
Gaudi::Property< std::string > p_string
Definition: PropertyAlg.h:75
PropertyAlg::m_uint64
Gaudi::Property< unsigned long long > m_uint64
Definition: PropertyAlg.h:48
PropertyAlg::p_boolarray
Gaudi::Property< std::vector< bool > > p_boolarray
Definition: PropertyAlg.h:81
StatusCode
Definition: StatusCode.h:65
PropertyAlg::m_intarray
Gaudi::Property< std::vector< int > > m_intarray
Definition: PropertyAlg.h:53
PropertyAlg::u_doublearrayunits
Gaudi::Property< std::vector< double > > u_doublearrayunits
Definition: PropertyAlg.h:60
PropertyAlg::u_doublepairarray
Gaudi::Property< std::vector< std::pair< double, double > > > u_doublepairarray
Definition: PropertyAlg.h:64
PropertyAlg::m_floatuset
Gaudi::Property< std::unordered_set< float > > m_floatuset
Definition: PropertyAlg.h:68
PropertyAlg::m_string
Gaudi::Property< std::string > m_string
Definition: PropertyAlg.h:50
PropertyAlg::p_int
Gaudi::CheckedProperty< int > p_int
Definition: PropertyAlg.h:72
PropertyAlg::m_uint64array
Gaudi::Property< std::vector< unsigned long long > > m_uint64array
Definition: PropertyAlg.h:55
PropertyAlg::execute
StatusCode execute() override
Definition: PropertyAlg.cpp:286
PropertyAlg::m_bool
Gaudi::Property< bool > m_bool
Definition: PropertyAlg.h:51
PropertyAlg::updateHandler
void updateHandler(Gaudi::Details::PropertyBase &)
Definition: PropertyAlg.cpp:42
PropertyAlg::m_boolarray
Gaudi::Property< std::vector< bool > > m_boolarray
Definition: PropertyAlg.h:58
PropertyAlg::m_double
Gaudi::Property< double > m_double
Definition: PropertyAlg.h:49
PropertyAlg::p_intarray
Gaudi::Property< std::vector< int > > p_intarray
Definition: PropertyAlg.h:78
PropertyAlg::finalize
StatusCode finalize() override
Definition: PropertyAlg.cpp:293
PropertyAlg
Definition: PropertyAlg.h:29
PropertyAlg::m_int64
Gaudi::Property< long long > m_int64
Definition: PropertyAlg.h:47
PropertyAlg::m_int
Gaudi::Property< int > m_int
These data members are used in the execution of this algorithm They are set in the initialization pha...
Definition: PropertyAlg.h:46
PropertyAlg::u_doublearray
Gaudi::Property< std::vector< double > > u_doublearray
Definition: PropertyAlg.h:61
Gaudi::Property< int >
Property.h
MsgStream.h