diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 05:02:10 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 05:02:10 -0800 |
commit | 520119a6f6ed418b8ae45bfde8239bbb532562cd (patch) | |
tree | 6cc381877adb5ddfaf131415c64f87eca5649676 /starts/meaning-vm/level-0/concept.cpp | |
parent | cd03e291664cb102bde61d86a15f0add11809766 (diff) | |
download | standingwithresilience-520119a6f6ed418b8ae45bfde8239bbb532562cd.tar.gz standingwithresilience-520119a6f6ed418b8ae45bfde8239bbb532562cd.zip |
cleanup mixin pointer mess for refs
Diffstat (limited to 'starts/meaning-vm/level-0/concept.cpp')
-rw-r--r-- | starts/meaning-vm/level-0/concept.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/starts/meaning-vm/level-0/concept.cpp b/starts/meaning-vm/level-0/concept.cpp index dace7df..dde48c2 100644 --- a/starts/meaning-vm/level-0/concept.cpp +++ b/starts/meaning-vm/level-0/concept.cpp @@ -5,17 +5,17 @@ using namespace intellect::level0; #define selfref const_cast<concept*>(&self) -ref concept::id() +concept* concept::id() { return this; } -void concept::link(ref const & type, ref const & target) +void concept::link(concept* type, concept* target) { links.insert({type, target}); } -void concept::unlink(ref const & type, ref const & target) +void concept::unlink(concept* type, concept* target) { auto ls = links.equal_range(type); for (auto l = ls.first; l != ls.second; ++ l) { @@ -27,7 +27,7 @@ void concept::unlink(ref const & type, ref const & target) throw no_such_link_type_target(selfref, type, target); } -void concept::unlink(ref const & type) +void concept::unlink(concept* type) { auto ls = links.equal_range(type); if (ls.first == ls.second) { @@ -41,14 +41,14 @@ void concept::unlink(ref const & type) links.erase(ls.first); } -bool concept::linked(ref const & type) const +bool concept::linked(concept* type) const { return links.count(type) > 0; } -bool concept::linked(ref const & type, ref const & target) const +bool concept::linked(concept* type, concept* target) const { - for (ref const & t : getAll(type)) { + for (concept* t : getAll(type)) { if (t == target) { return true; } @@ -56,7 +56,7 @@ bool concept::linked(ref const & type, ref const & target) const return false; } -concept::array concept::getAll(ref const & type) const +concept::array concept::getAll(concept* type) const { array ret; for ( @@ -69,7 +69,7 @@ concept::array concept::getAll(ref const & type) const return ret; } -ref concept::get(ref const & type) const +concept* concept::get(concept* type) const { auto result = links.equal_range(type); if (result.first == result.second) { @@ -83,7 +83,7 @@ ref concept::get(ref const & type) const return result.first->second; } -void concept::set(ref const & type, ref const & target) +void concept::set(concept* type, concept* target) { if (linked(type)) { throw link_type_not_unique(selfref, type); |