| The Gaudi Framework v32r1 (f65d50dc)

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 namespace Parsers {
16 // ============================================================================
17 class Property final {
18 // ----------------------------------------------------------------------------
19 public:
20 // ----------------------------------------------------------------------------
21 struct LessThen {
22 bool operator()( const Property& first, const Property& second ) const {
23 return first.FullName() < second.FullName();
24 }
25 };
26
27 class Equal {
28 public:
29 Equal( const std::string& short_name ) : short_name_( short_name ) {}
30 bool operator()( const Property& property ) const { return short_name_ == property.NameInClient(); }
31
32 private:
33 std::string short_name_;
34 };
35 // ----------------------------------------------------------------------------
36 Property( PropertyName property_name, PropertyValue property_value )
37 : property_name_( std::move( property_name ) ), property_value_( std::move( property_value ) ) {}
38 // ----------------------------------------------------------------------------
39 const PropertyName& property_name() const { return property_name_; }
40 PropertyValue& property_value() { return property_value_; }
41 // ----------------------------------------------------------------------------
42 Property& operator+=( const PropertyValue& value ) {
43 property_value_ += value;
44 return *this;
45 }
46 Property& operator-=( const PropertyValue& value ) {
47 property_value_ -= value;
48 return *this;
49 }
50 // ----------------------------------------------------------------------------
51 const Position& DefinedPosition() const;
52 bool HasDefinedPosition() const { return DefinedPosition().Exists(); }
53 // ----------------------------------------------------------------------------
54 const Position& ValuePosition() const;
55 bool HasValuePosition() const { return ValuePosition().Exists(); }
56 // ----------------------------------------------------------------------------
57 const std::string& ClientName() const;
58 const std::string& NameInClient() const;
59 std::string FullName() const;
60 std::string ValueAsString() const;
61 std::string ToString() const;
62 bool IsSimple() const;
63 bool IsVector() const;
64 bool IsMap() const;
65 bool IsReference() const { return property_value_.IsReference(); }
66 // ----------------------------------------------------------------------------
67 private:
68 // ----------------------------------------------------------------------------
69 PropertyName property_name_;
70 PropertyValue property_value_;
71 };
72 // ============================================================================
73 } // namespace Parsers
74 } // namespace Gaudi
75 // ============================================================================
76 #endif // JOBOPTIONSVC_PROPERTY_H_
Gaudi::Parsers::Property::Equal::operator()
bool operator()(const Property &property) const
Definition: Property.h:30
Gaudi::Parsers::Property::property_name_
PropertyName property_name_
Definition: Property.h:69
Gaudi::Parsers::Property::property_value_
PropertyValue property_value_
Definition: Property.h:70
Gaudi::Parsers::Property::operator+=
Property & operator+=(const PropertyValue &value)
Definition: Property.h:42
Gaudi::Parsers::Property::IsVector
bool IsVector() const
Definition: Property.cpp:35
Gaudi::Parsers::Property::operator-=
Property & operator-=(const PropertyValue &value)
Definition: Property.h:46
Gaudi::Parsers::Property
Definition: Property.h:17
std
STL namespace.
Gaudi::Parsers::Property::DefinedPosition
const Position & DefinedPosition() const
Definition: Property.cpp:19
Gaudi::Parsers::Property::IsSimple
bool IsSimple() const
Definition: Property.cpp:33
Gaudi::Parsers::Property::ToString
std::string ToString() const
Definition: Property.cpp:31
Gaudi::Units::second
constexpr double second
Definition: SystemOfUnits.h:121
std::string
STL class.
Gaudi::Parsers::Property::LessThen
Definition: Property.h:21
Gaudi::Parsers::PropertyValue
Definition: PropertyValue.h:19
Gaudi::Parsers::Position::Exists
bool Exists() const
Definition: Position.h:23
Gaudi::Parsers::PropertyValue::IsReference
bool IsReference() const
Definition: PropertyValue.h:48
Gaudi::Parsers::Property::property_value
PropertyValue & property_value()
Definition: Property.h:40
Gaudi::Parsers::Property::ClientName
const std::string & ClientName() const
Definition: Property.cpp:23
Gaudi::Parsers::Property::NameInClient
const std::string & NameInClient() const
Definition: Property.cpp:25
Gaudi::Parsers::Position
Definition: Position.h:13
Gaudi::Parsers::Property::LessThen::operator()
bool operator()(const Property &first, const Property &second) const
Definition: Property.h:22
Gaudi::Parsers::Property::property_name
const PropertyName & property_name() const
Definition: Property.h:39
Gaudi::Parsers::PropertyName
Definition: PropertyName.h:16
PropertyName.h
Gaudi::Parsers::Property::HasValuePosition
bool HasValuePosition() const
Definition: Property.h:55
Gaudi::Parsers::Property::ValuePosition
const Position & ValuePosition() const
Definition: Property.cpp:21
Gaudi::Parsers::Property::ValueAsString
std::string ValueAsString() const
Definition: Property.cpp:29
Position.h
Gaudi::Parsers::Property::Equal::short_name_
std::string short_name_
Definition: Property.h:33
Gaudi::Parsers::Property::Equal::Equal
Equal(const std::string &short_name)
Definition: Property.h:29
Gaudi::Parsers::Property::IsReference
bool IsReference() const
Definition: Property.h:65
Gaudi::Parsers::Property::Property
Property(PropertyName property_name, PropertyValue property_value)
Definition: Property.h:36
Gaudi::Parsers::Property::Equal
Definition: Property.h:27
PropertyValue.h
Gaudi::Parsers::Property::HasDefinedPosition
bool HasDefinedPosition() const
Definition: Property.h:52
Gaudi::Parsers::Property::IsMap
bool IsMap() const
Definition: Property.cpp:37
Gaudi::Parsers::Property::FullName
std::string FullName() const
Definition: Property.cpp:27
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1