The Gaudi Framework  master (37c0b60a)
ExtendedProperties2.cpp
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 // ============================================================================
12 // Include files
13 // ============================================================================
14 // STD & STL
15 // ============================================================================
16 #include <map>
17 #include <string>
18 #include <utility>
19 #include <vector>
20 // ============================================================================
21 // GaudiKernel
22 // ============================================================================
28 // ============================================================================
31 // ============================================================================
33 // ============================================================================
34 
41 // ============================================================================
42 namespace Gaudi {
43  // ==========================================================================
44  namespace TestSuite {
45  // ========================================================================
51  class ExtendedProperties2 : public TestAlg {
52  public:
53  // ======================================================================
54  StatusCode execute() override;
55  // ======================================================================
56  public:
57  // ======================================================================
63  setProperty( "PropertiesPrint", true ).ignore();
64  }
65  // ======================================================================
66  private:
67  // ======================================================================
68  Gaudi::Property<Gaudi::XYZPoint> m_point3D{ this, "Point3D", { 0, 1, 2 }, "3D-point" };
69  Gaudi::Property<Gaudi::XYZVector> m_vector3D{ this, "Vector3D", { 1, 2, 3 }, "3D-vector" };
70  Gaudi::Property<Gaudi::LorentzVector> m_vector4D{ this, "Vector4D", { 1, 2, 3, 4 }, "Lorentz-vector" };
71  Gaudi::Property<Gaudi::Vector5> m_vector5{ this, "SVector5", {}, "Generic-vector" };
72  Gaudi::Property<std::vector<Gaudi::XYZPoint>> m_points{ this, "Points3D", {}, "Vector of 3D-points" };
73  Gaudi::Property<std::vector<Gaudi::XYZVector>> m_vectors{ this, "Vectors3D", {}, "Vector of 3D-vectors" };
74  Gaudi::Property<std::vector<Gaudi::LorentzVector>> m_lvs{ this, "Vectors4D", {}, "Vector of 4D-vectors" };
75  // ======================================================================
76  };
77  // ========================================================================
78  } // namespace TestSuite
79  // ==========================================================================
80 } // end of namespace Gaudi
81 // ============================================================================
83  always() << "3D-Point : " << Gaudi::Utils::toString( m_point3D.value() ) << endmsg;
84  always() << "3D-Vector: " << Gaudi::Utils::toString( m_vector3D.value() ) << endmsg;
85  always() << "4D-Vector: " << Gaudi::Utils::toString( m_vector4D.value() ) << endmsg;
86  always() << " 5-Vector: " << Gaudi::Utils::toString( m_vector5.value() ) << endmsg;
87 
88  always() << "Vector of 3D-Points " << Gaudi::Utils::toString( m_points.value() ) << endmsg;
89  always() << "Vector of 3D-Vectors " << Gaudi::Utils::toString( m_vectors.value() ) << endmsg;
90  always() << "Vector of 4D-Vectors " << Gaudi::Utils::toString( m_lvs.value() ) << endmsg;
91 
92  return StatusCode::SUCCESS;
93 }
94 // ============================================================================
95 // the factory
96 // ============================================================================
99 // ============================================================================
100 // The END
101 // ============================================================================
VectorsAsProperty.h
Gaudi::TestSuite::ExtendedProperties2::ExtendedProperties2
ExtendedProperties2(const std::string &name, ISvcLocator *pSvc)
standard constructor
Definition: ExtendedProperties2.cpp:62
std::string
STL class.
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:526
Gaudi::TestSuite::ExtendedProperties2::m_vector5
Gaudi::Property< Gaudi::Vector5 > m_vector5
Definition: ExtendedProperties2.cpp:71
TestSuite
#define TestSuite
Definition: MakeAndConsume.cpp:658
PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Definition: IProperty.h:39
ISvcLocator
Definition: ISvcLocator.h:46
Gaudi::TestSuite::TestAlg
Simple algorithm useful as base class for tests.
Definition: TestAlg.h:19
TestAlg.h
Gaudi::TestSuite::ExtendedProperties2::m_points
Gaudi::Property< std::vector< Gaudi::XYZPoint > > m_points
Definition: ExtendedProperties2.cpp:72
Gaudi::TestSuite::ExtendedProperties2::m_vector3D
Gaudi::Property< Gaudi::XYZVector > m_vector3D
Definition: ExtendedProperties2.cpp:69
Vector3DTypes.h
Gaudi::TestSuite::ExtendedProperties2::m_point3D
Gaudi::Property< Gaudi::XYZPoint > m_point3D
Definition: ExtendedProperties2.cpp:68
Gaudi::TestSuite::ExtendedProperties2::m_vectors
Gaudi::Property< std::vector< Gaudi::XYZVector > > m_vectors
Definition: ExtendedProperties2.cpp:73
StatusCode
Definition: StatusCode.h:65
GenericVectorTypes.h
SVectorAsProperty.h
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:237
Point3DTypes.h
Gaudi::TestSuite::ExtendedProperties2::m_vector4D
Gaudi::Property< Gaudi::LorentzVector > m_vector4D
Definition: ExtendedProperties2.cpp:70
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:353
Gaudi::TestSuite::ExtendedProperties2::execute
StatusCode execute() override
Definition: ExtendedProperties2.cpp:82
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
Gaudi::TestSuite::ExtendedProperties2
Definition: ExtendedProperties2.cpp:51
Vector4DTypes.h
Point4DTypes.h
ExtendedProperties2
Definition: ExtendedProperties2.py:1
Gaudi::Property< Gaudi::XYZPoint >
Gaudi::TestSuite::ExtendedProperties2::m_lvs
Gaudi::Property< std::vector< Gaudi::LorentzVector > > m_lvs
Definition: ExtendedProperties2.cpp:74