ATLAS Offline Software
Loading...
Searching...
No Matches
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
12class StatusCode;
13
23class Property {
24
25public:
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();
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
104private:
107
108}; // class Property
109
110#endif // ASGTOOLS_PROPERTY_H
Support class for PropertyMgr.
Definition Property.h:23
static const std::string & name(Type type)
Function returning a user-readable name for a property type.
Definition Property.cxx:21
Type type() const
Return the type index.
Definition Property.cxx:58
std::vector< std::string > StringVector
Convenience type declaration for a string vector.
Definition Property.h:46
bool isValid() const
Return if this is a valid property.
Definition Property.cxx:53
virtual StatusCode getString(std::string &result) const
get the property as a string
Definition Property.cxx:76
Type m_type
The type of the property.
Definition Property.h:106
const std::string & typeName() const
Return the type name.
Definition Property.cxx:63
virtual int setFrom(const Property &rhs)
Definition Property.cxx:68
std::vector< int > IntVector
Convenience type declaration for an integer vector.
Definition Property.h:42
Type
Property type enumeration.
Definition Property.h:27
@ FLOATVECTOR
Definition Property.h:35
@ INTVECTOR
Definition Property.h:34
@ TOOLHANDLEARRAY
Definition Property.h:38
@ UNKNOWNTYPE
Definition Property.h:28
@ TOOLHANDLE
Definition Property.h:37
@ STRINGVECTOR
Definition Property.h:36
virtual ~Property()
Destructor.
Definition Property.h:56
virtual StatusCode setString(const std::string &value)
set the property from a string
Definition Property.cxx:86
Property()
Default constructor.
Definition Property.cxx:43
virtual StatusCode getCastString(std::string &result) const
get the property as a string I can pas to setString
Definition Property.cxx:81
std::vector< float > FloatVector
Convenience type declaration for a float vector.
Definition Property.h:44