ATLAS Offline Software
Property.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_PROPERTY_H
6 #define ASGTOOLS_PROPERTY_H
7 
8 // System include(s):
9 #include <string>
10 #include <vector>
11 
12 class StatusCode;
13 
23 class Property {
24 
25 public:
27  enum Type {
30  INT,
39  }; // enum Type
40 
42  typedef std::vector< int > IntVector;
44  typedef std::vector< float > FloatVector;
46  typedef std::vector< std::string > StringVector;
47 
49  static const std::string& name( Type type );
50 
52  Property();
54  Property( Type type );
56  virtual ~Property() {}
57 
60  bool isValid() const;
61 
63  Type type() const;
64 
66  const std::string& typeName() const;
67 
68  // Set the value from another property.
69  // Returns 0 for success.
70  // The implementation here fails with error -1.
71  virtual int setFrom( const Property& rhs );
72 
73 
79  virtual StatusCode getString (std::string& result) const;
80 
93  virtual StatusCode getCastString (std::string& result) const;
94 
101  virtual StatusCode setString (const std::string& value);
102 
103 
104 private:
107 
108 }; // class Property
109 
110 #endif // ASGTOOLS_PROPERTY_H
Property::StringVector
std::vector< std::string > StringVector
Convenience type declaration for a string vector.
Definition: Property.h:46
Property::BOOL
@ BOOL
Definition: Property.h:29
get_generator_info.result
result
Definition: get_generator_info.py:21
Property::getCastString
virtual StatusCode getCastString(std::string &result) const
get the property as a string I can pas to setString
Definition: Property.cxx:81
Property::STRING
@ STRING
Definition: Property.h:33
Property::Property
Property()
Default constructor.
Definition: Property.cxx:43
Property::FloatVector
std::vector< float > FloatVector
Convenience type declaration for a float vector.
Definition: Property.h:44
Property::INTVECTOR
@ INTVECTOR
Definition: Property.h:34
Property::STRINGVECTOR
@ STRINGVECTOR
Definition: Property.h:36
athena.value
value
Definition: athena.py:124
Property::~Property
virtual ~Property()
Destructor.
Definition: Property.h:56
Property::setFrom
virtual int setFrom(const Property &rhs)
Definition: Property.cxx:68
Property::getString
virtual StatusCode getString(std::string &result) const
get the property as a string
Definition: Property.cxx:76
Property
Support class for PropertyMgr.
Definition: Property.h:23
Property::typeName
const std::string & typeName() const
Return the type name.
Definition: Property.cxx:63
Property::DOUBLE
@ DOUBLE
Definition: Property.h:32
Property::UNKNOWNTYPE
@ UNKNOWNTYPE
Definition: Property.h:28
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAODType
Definition: ObjectType.h:13
Property::TOOLHANDLE
@ TOOLHANDLE
Definition: Property.h:37
Property::INT
@ INT
Definition: Property.h:30
Property::IntVector
std::vector< int > IntVector
Convenience type declaration for an integer vector.
Definition: Property.h:42
Property::FLOAT
@ FLOAT
Definition: Property.h:31
Property::isValid
bool isValid() const
Return if this is a valid property.
Definition: Property.cxx:53
Property::FLOATVECTOR
@ FLOATVECTOR
Definition: Property.h:35
Property::type
Type type() const
Return the type index.
Definition: Property.cxx:58
Property::setString
virtual StatusCode setString(const std::string &value)
set the property from a string
Definition: Property.cxx:86
Property::name
static const std::string & name(Type type)
Function returning a user-readable name for a property type.
Definition: Property.cxx:21
Property::TOOLHANDLEARRAY
@ TOOLHANDLEARRAY
Definition: Property.h:38
Property::m_type
Type m_type
The type of the property.
Definition: Property.h:106