From 520119a6f6ed418b8ae45bfde8239bbb532562cd Mon Sep 17 00:00:00 2001 From: olpc user Date: Mon, 25 Nov 2019 05:02:10 -0800 Subject: cleanup mixin pointer mess for refs --- starts/meaning-vm/level-0/ref-mixin.hpp | 42 --------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 starts/meaning-vm/level-0/ref-mixin.hpp (limited to 'starts/meaning-vm/level-0/ref-mixin.hpp') diff --git a/starts/meaning-vm/level-0/ref-mixin.hpp b/starts/meaning-vm/level-0/ref-mixin.hpp deleted file mode 100644 index 15e5abe..0000000 --- a/starts/meaning-vm/level-0/ref-mixin.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include -#include - -namespace intellect { -namespace level0 { - -template typename vref> -struct refmixin { - using links_t = std::multimap; - using array = std::vector; - - void link(ref const & type, ref const & target) { p()->link(conv(type), conv(target)); } - void unlink(ref const & type, ref const & target) { p()->unlink(conv(type), conv(target)); } - void unlink(ref const & type) { p()->unlink(conv(type)); } - - bool linked(ref const & type) const { return p()->linked(conv(type)); } - bool linked(ref const & type, ref const & target) const { return p()->linked(conv(type), conv(target)); } - - array getAll(ref const & type) const { return conv(p()->getAll(conv(type))); } - - links_t & links() const { return *(links_t*)&(p()->links); } - - ref get(ref const & type) const { return conv(p()->get(conv(type))); } - void set(ref const & type, ref const & target) { p()->set(conv(type), conv(target)); } - - template - vref vget(ref const & type) const { return conv>(get(type)); } - - bool operator==(ref const & other) const { return self.p() == other.p(); } - bool operator!=(ref const & other) const { return self.p() == other.p(); } - bool operator<(ref const & other) const { return self.p() < other.p(); } - -private: - inline concept * p() const { return *conv(this); } - using r = level0::ref; - template - static inline OUT conv(IN r) { return *(OUT*)&r; } -}; -} -} -- cgit v1.2.3