ATLAS Offline Software
TProperty.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ASGTOOLS_TPROPERTY_H
6 #define ASGTOOLS_TPROPERTY_H
7 
8 // System include(s):
9 #include <string>
10 #include <vector>
11 
12 // Local include(s):
13 #include "AsgTools/ToolHandle.h"
15 #include "AsgTools/Property.h"
16 
27 template< typename T >
28 class TProperty : public Property {
29 
30 public:
33 
35  const T* pointer() const;
36 
38  virtual int setFrom( const Property& rhs );
39 
40  virtual StatusCode getString (std::string& result) const;
41 
42  virtual StatusCode getCastString (std::string& result) const;
43 
44  virtual StatusCode setString (const std::string& value);
45 
46 private:
48  T* m_ptr;
49 
50 }; // class TProperty
51 
54 
56 template<>
59 
61 
64 
66 Property* createProperty( const bool& rval );
67 
69 Property* createProperty( const int& rval );
70 
72 Property* createProperty( const float& rval );
73 
75 Property* createProperty( const double& rval );
76 
78 Property* createProperty( const std::string& rval );
79 
81 Property* createProperty( const std::vector< int >& rval );
82 
84 Property* createProperty( const std::vector< float >& rval );
85 
87 Property* createProperty( const std::vector< std::string >& rval );
88 
90 template< typename T >
91 Property* createProperty( const T& rval );
92 
94 
95 // Include the template implementation:
96 #include "AsgTools/TProperty.icc"
97 
98 #endif // ASGTOOLS_TPROPERTY_H
TProperty::TProperty
TProperty(T &val, Type type)
Constructor from a reference and a type.
get_generator_info.result
result
Definition: get_generator_info.py:21
athena.value
value
Definition: athena.py:122
Property
Support class for PropertyMgr.
Definition: Property.h:23
TProperty::setString
virtual StatusCode setString(const std::string &value)
set the property from a string
createProperty
Property * createProperty(const bool &rval)
Create a boolean propert.
Definition: TProperty.cxx:589
ToolHandleArray.h
Property.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TProperty
Templated wrapper around user properties.
Definition: TProperty.h:28
xAODType
Definition: ObjectType.h:13
TProperty::getString
virtual StatusCode getString(std::string &result) const
get the property as a string
TProperty::pointer
const T * pointer() const
Return the address of the property variable.
TProperty::m_ptr
T * m_ptr
The address of the wrapped variable.
Definition: TProperty.h:48
TProperty.icc
TProperty::setFrom
virtual int setFrom(const Property &rhs)
Set value using that from another property.
Property::type
Type type() const
Return the type index.
Definition: Property.cxx:58
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
TProperty::getCastString
virtual StatusCode getCastString(std::string &result) const
get the property as a string I can pas to setString
ToolHandle.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35