summaryrefslogtreecommitdiff
path: root/intellect-framework-from-internet/starts/meaning-vm/level-0/ref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'intellect-framework-from-internet/starts/meaning-vm/level-0/ref.cpp')
-rw-r--r--intellect-framework-from-internet/starts/meaning-vm/level-0/ref.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/intellect-framework-from-internet/starts/meaning-vm/level-0/ref.cpp b/intellect-framework-from-internet/starts/meaning-vm/level-0/ref.cpp
new file mode 100644
index 0000000..513d3ce
--- /dev/null
+++ b/intellect-framework-from-internet/starts/meaning-vm/level-0/ref.cpp
@@ -0,0 +1,33 @@
+#include "ref.hpp"
+#include "concept.hpp"
+#include "errors.hpp"
+#include "memorystore.hpp"
+
+#include <iomanip>
+#include <ostream>
+#include <sstream>
+
+using namespace intellect::level0;
+using namespace concepts;
+
+std::string ref::dump(ref skipmarkertype, ref skipmarkertarget)
+{
+ if (self.linked(skipmarkertype, skipmarkertarget)) {
+ return {};
+ }
+ std::stringstream ss;
+ ss << std::hex << (size_t)ptr() << ":" << std::endl;
+ for (auto & link : self.links()) {
+ if (link.first.linked(allocator(), level0allocations())) { continue; }
+ ss << " " << (size_t)link.first.ptr() << ": " << (size_t)link.second.ptr() << std::endl;
+ }
+ self.link(skipmarkertype, skipmarkertarget);
+ for (auto & link : self.links()) {
+ if (link.first.linked(allocator(), level0allocations())) { continue; }
+ if (link.first == skipmarkertype && link.second == skipmarkertarget) {
+ continue;
+ }
+ ss << link.second.dump(skipmarkertype, skipmarkertarget);
+ }
+ return ss.str();
+}