Skip to content

Commit

Permalink
Implement the fetch of link, as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
linas committed Oct 25, 2019
1 parent a7f5648 commit c663cb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
18 changes: 10 additions & 8 deletions opencog/persist/ipfs/IPFSAtomLoad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,9 @@ std::string IPFSAtomStorage::encodeValueToStr(const ValuePtr& v)

/* ================================================================ */

Handle IPFSAtomStorage::getNode(Type t, const char * str)
Handle IPFSAtomStorage::do_fetch_atom(Handle &h)
{
rethrow();

// Build the name
Handle h(createNode(t, str));
std::string path = _atomspace_cid + "/" + h->to_short_string();

// std::cout << "Query path = " << path << std::endl;
Expand All @@ -185,13 +182,18 @@ Handle IPFSAtomStorage::getNode(Type t, const char * str)
return h;
}

Handle IPFSAtomStorage::getNode(Type t, const char * str)
{
rethrow();
Handle h(createNode(t, str));
return do_fetch_atom(h);
}

Handle IPFSAtomStorage::getLink(Type t, const HandleSeq& hs)
{
rethrow();
throw RuntimeException (TRACE_INFO, "Not implemented\n");
Handle hg; // (doGetLink(t, hs));
// if (hg) get_atom_values(hg);
return hg;
Handle h(createLink(hs, t));
return do_fetch_atom(h);
}

/* ============================= END OF FILE ================= */
1 change: 1 addition & 0 deletions opencog/persist/ipfs/IPFSAtomStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class IPFSAtomStorage : public BackingStore
ipfs::Json fetch_atom_dag(const std::string&);
Handle decodeStrAtom(const std::string&);
Handle decodeJSONAtom(const ipfs::Json&);
Handle do_fetch_atom(Handle&);

void store_incoming_of(const Handle &, const Handle&);
// --------------------------
Expand Down

0 comments on commit c663cb6

Please sign in to comment.