ATLAS Offline Software
Loading...
Searching...
No Matches
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
27template< typename T >
28class TProperty : public Property {
29
30public:
32 TProperty( T& val, Type type );
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
46private:
49
50}; // class TProperty
51
54
56template<>
59
61
64
66Property* createProperty( const bool& rval );
67
69Property* createProperty( const int& rval );
70
72Property* createProperty( const float& rval );
73
75Property* createProperty( const double& rval );
76
78Property* createProperty( const std::string& rval );
79
81Property* createProperty( const std::vector< int >& rval );
82
84Property* createProperty( const std::vector< float >& rval );
85
87Property* createProperty( const std::vector< std::string >& rval );
88
90template< typename T >
91Property* createProperty( const T& rval );
92
94
95// Include the template implementation:
97
98#endif // ASGTOOLS_TPROPERTY_H
Property * createProperty(const bool &rval)
Create a boolean propert.
Support class for PropertyMgr.
Definition Property.h:23
Type type() const
Return the type index.
Definition Property.cxx:58
Type
Property type enumeration.
Definition Property.h:27
Property()
Default constructor.
Definition Property.cxx:43
virtual StatusCode setString(const std::string &value)
set the property from a string
virtual StatusCode getString(std::string &result) const
get the property as a string
T * m_ptr
The address of the wrapped variable.
Definition TProperty.h:48
virtual StatusCode getCastString(std::string &result) const
get the property as a string I can pas to setString
const T * pointer() const
Return the address of the property variable.
TProperty(T &val, Type type)
Constructor from a reference and a type.
virtual int setFrom(const Property &rhs)
Set value using that from another property.