summaryrefslogtreecommitdiffstats
path: root/lib/base/reference.hpp
blob: 30faabe5fa8af3190e316cc5b3dcd330358c4802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */

#ifndef REFERENCE_H
#define REFERENCE_H

#include "base/i2-base.hpp"
#include "base/objectlock.hpp"
#include "base/value.hpp"

namespace icinga
{

/**
 * A reference.
 *
 * @ingroup base
 */
class Reference final : public Object
{
public:
	DECLARE_OBJECT(Reference);

	Reference(const Object::Ptr& parent, const String& index);

	Value Get() const;
	void Set(const Value& value);

	Object::Ptr GetParent() const;
	String GetIndex() const;

	static Object::Ptr GetPrototype();

private:
	Object::Ptr m_Parent;
	String m_Index;
};

}

#endif /* REFERENCE_H */