| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Property.h
Go to the documentation of this file.
1 #ifndef JOBOPTIONSVC_PROPERTY_H_
2 #define JOBOPTIONSVC_PROPERTY_H_
3 // ============================================================================
4 // Includes:
5 // ============================================================================
6 // STD & STL:
7 // ============================================================================
8 #include <string>
9 // ============================================================================
10 #include "Position.h"
11 #include "PropertyName.h"
12 #include "PropertyValue.h"
13 // ============================================================================
14 namespace Gaudi
15 {
16 namespace Parsers
17 {
18 // ============================================================================
19 class Property final
20 {
21 // ----------------------------------------------------------------------------
22 public:
23 // ----------------------------------------------------------------------------
24 struct LessThen {
25 bool operator()( const Property& first, const Property& second ) const
26 {
27 return first.FullName() < second.FullName();
28 }
29 };
30
31 class Equal
32 {
33 public:
34 Equal( const std::string& short_name ) : short_name_( short_name ) {}
35 bool operator()( const Property& property ) const { return short_name_ == property.NameInClient(); }
36
37 private:
38 std::string short_name_;
39 };
40 // ----------------------------------------------------------------------------
41 Property( PropertyName property_name, PropertyValue property_value )
42 : property_name_( std::move( property_name ) ), property_value_( std::move( property_value ) )
43 {
44 }
45 // ----------------------------------------------------------------------------
46 const PropertyName& property_name() const { return property_name_; }
47 PropertyValue& property_value() { return property_value_; }
48 // ----------------------------------------------------------------------------
49 Property& operator+=( const PropertyValue& value )
50 {
51 property_value_ += value;
52 return *this;
53 }
54 Property& operator-=( const PropertyValue& value )
55 {
56 property_value_ -= value;
57 return *this;
58 }
59 // ----------------------------------------------------------------------------
60 const Position& DefinedPosition() const;
61 bool HasDefinedPosition() const { return DefinedPosition().Exists(); }
62 // ----------------------------------------------------------------------------
63 const Position& ValuePosition() const;
64 bool HasValuePosition() const { return ValuePosition().Exists(); }
65 // ----------------------------------------------------------------------------
66 const std::string& ClientName() const;
67 const std::string& NameInClient() const;
68 std::string FullName() const;
69 std::string ValueAsString() const;
70 std::string ToString() const;
71 bool IsSimple() const;
72 bool IsVector() const;
73 bool IsMap() const;
74 bool IsReference() const { return property_value_.IsReference(); }
75 // ----------------------------------------------------------------------------
76 private:
77 // ----------------------------------------------------------------------------
78 PropertyName property_name_;
79 PropertyValue property_value_;
80 };
81 // ============================================================================
82 } /* Gaudi */
83 } /* Parsers */
84 // ============================================================================
85 #endif // JOBOPTIONSVC_PROPERTY_H_
Gaudi::Parsers::Property::property_name_
PropertyName property_name_
Definition: Property.h:78
Gaudi::Parsers::Property::property_value_
PropertyValue property_value_
Definition: Property.h:79
Gaudi::Parsers::Property::operator+=
Property & operator+=(const PropertyValue &value)
Definition: Property.h:49
Gaudi::Parsers::PropertyValue::IsReference
bool IsReference() const
Definition: PropertyValue.h:56
Gaudi::Parsers::Property::operator-=
Property & operator-=(const PropertyValue &value)
Definition: Property.h:54
Gaudi::Parsers::Property::HasValuePosition
bool HasValuePosition() const
Definition: Property.h:64
Gaudi::Parsers::Property
Definition: Property.h:19
property
Gaudi::Details::PropertyBase * property(const std::string &name) const
std
STL namespace.
Gaudi::Parsers::Property::IsReference
bool IsReference() const
Definition: Property.h:74
Gaudi::Units::second
constexpr double second
Definition: SystemOfUnits.h:123
std::string
STL class.
Gaudi::Parsers::Property::LessThen
Definition: Property.h:24
Gaudi::Parsers::PropertyValue
Definition: PropertyValue.h:22
Gaudi::Parsers::Property::IsSimple
bool IsSimple() const
Definition: Property.cpp:33
Gaudi::Parsers::Property::FullName
std::string FullName() const
Definition: Property.cpp:27
Gaudi::Parsers::Property::ValueAsString
std::string ValueAsString() const
Definition: Property.cpp:29
Gaudi::Parsers::Property::Equal::operator()
bool operator()(const Property &property) const
Definition: Property.h:35
Gaudi::Parsers::Property::property_value
PropertyValue & property_value()
Definition: Property.h:47
Gaudi::Parsers::Property::NameInClient
const std::string & NameInClient() const
Definition: Property.cpp:25
Gaudi::Parsers::Position
Definition: Position.h:15
Gaudi::Parsers::PropertyName
Definition: PropertyName.h:18
Gaudi::Parsers::Property::property_name
const PropertyName & property_name() const
Definition: Property.h:46
Gaudi::Parsers::Property::HasDefinedPosition
bool HasDefinedPosition() const
Definition: Property.h:61
PropertyName.h
Gaudi::Parsers::Property::DefinedPosition
const Position & DefinedPosition() const
Definition: Property.cpp:19
Gaudi::Parsers::Property::IsVector
bool IsVector() const
Definition: Property.cpp:35
Gaudi::Parsers::Position::Exists
bool Exists() const
Definition: Position.h:28
Gaudi::Parsers::Property::ToString
std::string ToString() const
Definition: Property.cpp:31
Position.h
Gaudi::Parsers::Property::IsMap
bool IsMap() const
Definition: Property.cpp:37
Gaudi::Parsers::Property::Equal::short_name_
std::string short_name_
Definition: Property.h:38
Gaudi::Parsers::Property::Equal::Equal
Equal(const std::string &short_name)
Definition: Property.h:34
Gaudi::Parsers::Property::ClientName
const std::string & ClientName() const
Definition: Property.cpp:23
Gaudi::Parsers::Property::Property
Property(PropertyName property_name, PropertyValue property_value)
Definition: Property.h:41
Gaudi::Parsers::Property::Equal
Definition: Property.h:31
PropertyValue.h
Gaudi::Parsers::Property::LessThen::operator()
bool operator()(const Property &first, const Property &second) const
Definition: Property.h:25
Gaudi::Parsers::Property::ValuePosition
const Position & ValuePosition() const
Definition: Property.cpp:21
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1