summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-0/ref.hpp
blob: abe3897ca328d0d51ae3c43919d3a6594153e1fa (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
#pragma once

#include "common.hpp"
#include "ref-mixin.hpp"

#include <string>

namespace intellect {
namespace level0 {

struct ref : public refmixin<ref, vref>
{
	ref(concept *p);
	ref(ref const & other) : ref(other.ptr) { }
	ref & operator=(ref const & other) { self.ptr = other.ptr; return self; }
	operator concept*() const { return ptr; }
	concept* operator->() const { return ptr; }
	concept & deref() { return *ptr; }

	ref & l0() { return self; }
	ref const & l0() const { return self; }

	std::string dump(ref skipmarkertype, ref skipmarkertarget);

private:
	concept * ptr;
};

}
}