The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
PropertyAlg.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 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#pragma once
12
13// Include files
14#include <Gaudi/Property.h>
17
18#include <map>
19#include <set>
20#include <string>
21#include <vector>
22
28class PropertyAlg : public Algorithm {
29public:
31 PropertyAlg( const std::string& name, ISvcLocator* pSvcLocator );
33 StatusCode initialize() override;
34 StatusCode execute() override;
35 StatusCode finalize() override;
36
40
41private:
44
45 Gaudi::Property<int> m_int{ this, "Int", 100 };
46 Gaudi::Property<long long> m_int64{ this, "Int64", 100 };
48 Gaudi::Property<double> m_double{ this, "Double", 100. };
49 Gaudi::Property<std::string> m_string{ this, "String", "hundred" };
50 Gaudi::Property<bool> m_bool{ this, "Bool", true };
51
60 Gaudi::Property<std::vector<double>> u_doublearray{ this, "DoubleArrayWithoutUnits" };
61
64
68
70
71 Gaudi::CheckedProperty<int> p_int{ this, "PInt", 100, "An integer property" };
72 Gaudi::PropertyWithReadHandler<double> p_double{ this, "PDouble", 100. };
73
74 Gaudi::Property<std::string> p_string{ this, "PString", "hundred" };
75 Gaudi::Property<bool> p_bool{ this, "PBool", false };
76
81};
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
Definition Algorithm.h:98
const std::string & name() const override
The identifying name of the algorithm object.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition ISvcLocator.h:42
void readHandler(Gaudi::Details::PropertyBase &)
Callbacks for properties.
Gaudi::Property< double > m_double
Definition PropertyAlg.h:48
Gaudi::Property< std::map< std::string, std::string > > m_strmap
Definition PropertyAlg.h:69
Gaudi::Property< unsigned long long > m_uint64
Definition PropertyAlg.h:47
Gaudi::Property< std::vector< std::pair< double, double > > > u_doublepairarray
Definition PropertyAlg.h:63
Gaudi::Property< std::vector< std::pair< int, int > > > u_intpairarray
Definition PropertyAlg.h:62
Gaudi::Property< std::vector< int > > p_intarray
Definition PropertyAlg.h:77
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:45
Gaudi::Property< std::vector< std::string > > p_stringarray
Definition PropertyAlg.h:79
Gaudi::Property< std::string > p_string
Definition PropertyAlg.h:74
StatusCode finalize() override
Gaudi::Property< bool > m_bool
Definition PropertyAlg.h:50
Gaudi::Property< std::vector< double > > u_doublearrayunits
Definition PropertyAlg.h:59
Gaudi::Property< bool > p_bool
Definition PropertyAlg.h:75
StatusCode initialize() override
Three mandatory member functions of any algorithm.
Gaudi::Property< std::vector< long long > > m_int64array
Definition PropertyAlg.h:53
Gaudi::Property< std::vector< bool > > p_boolarray
Definition PropertyAlg.h:80
Gaudi::Property< long long > m_int64
Definition PropertyAlg.h:46
Gaudi::Property< std::vector< bool > > m_boolarray
Definition PropertyAlg.h:57
Gaudi::PropertyWithReadHandler< double > p_double
Definition PropertyAlg.h:72
Gaudi::Property< std::set< std::string > > m_stringset
Definition PropertyAlg.h:66
Gaudi::Property< std::vector< int > > m_intarray
Definition PropertyAlg.h:52
Gaudi::Property< std::vector< unsigned long long > > m_uint64array
Definition PropertyAlg.h:54
Gaudi::CheckedProperty< int > p_int
Definition PropertyAlg.h:71
Gaudi::Property< std::string > m_string
Definition PropertyAlg.h:49
Gaudi::Property< std::vector< std::string > > m_stringarray
Definition PropertyAlg.h:56
Gaudi::Property< std::unordered_set< float > > m_floatuset
Definition PropertyAlg.h:67
Gaudi::Property< std::vector< double > > p_doublearray
Definition PropertyAlg.h:78
PropertyAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor of this form must be provided.
StatusCode execute() override
void updateHandler(Gaudi::Details::PropertyBase &)
Gaudi::Property< std::vector< double > > m_emptyarray
Definition PropertyAlg.h:58
Gaudi::Property< std::vector< double > > m_doublearray
Definition PropertyAlg.h:55
Gaudi::Property< std::vector< double > > u_doublearray
Definition PropertyAlg.h:60
Gaudi::Property< std::set< int > > m_intset
Definition PropertyAlg.h:65
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64