]> granicus.if.org Git - icinga2/blob - lib/base/reference.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / reference.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef REFERENCE_H
4 #define REFERENCE_H
5
6 #include "base/i2-base.hpp"
7 #include "base/objectlock.hpp"
8 #include "base/value.hpp"
9
10 namespace icinga
11 {
12
13 /**
14  * A reference.
15  *
16  * @ingroup base
17  */
18 class Reference final : public Object
19 {
20 public:
21         DECLARE_OBJECT(Reference);
22
23         Reference(const Object::Ptr& parent, const String& index);
24
25         Value Get() const;
26         void Set(const Value& value);
27
28         Object::Ptr GetParent() const;
29         String GetIndex() const;
30
31         static Object::Ptr GetPrototype();
32
33 private:
34         Object::Ptr m_Parent;
35         String m_Index;
36 };
37
38 }
39
40 #endif /* REFERENCE_H */