| The Gaudi Framework v28r2-patches (bc4ad17a)

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