Skip to content

Commit

Permalink
[release] fuckzxxcache
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Aug 8, 2022
1 parent d6d645f commit 50e8806
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions zeno/src/core/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ namespace zeno {

namespace {

template <class F>
struct ImplNodeClass : INodeClass {
F ctor;
std::unique_ptr<INode>(*ctor)();

ImplNodeClass(F const &ctor, Descriptor const &desc)
ImplNodeClass(std::unique_ptr<INode>(*ctor)(), Descriptor const &desc)
: INodeClass(desc), ctor(ctor) {}

virtual std::unique_ptr<INode> new_instance() const override {
Expand All @@ -42,7 +41,7 @@ ZENO_API void Session::defNodeClass(std::unique_ptr<INode>(*ctor)(), std::string
if (nodeClasses.find(id) != nodeClasses.end()) {
log_error("node class redefined: `{}`\n", id);
}
auto cls = std::make_unique<ImplNodeClass<std::unique_ptr<INode>(*)()>>(ctor, desc);
auto cls = std::make_unique<ImplNodeClass>(ctor, desc);
nodeClasses.emplace(id, std::move(cls));
}

Expand Down
4 changes: 2 additions & 2 deletions zeno/src/extra/GlobalComm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void toDisk(std::string cachedir, int frameid, GlobalComm::ViewObjects &o
keys.push_back('\a');

auto path = std::filesystem::path(cachedir) / (std::to_string(1000000 + frameid).substr(1) + ".zencache");
log_debug("dump cache to disk {}", path);
log_critical("dump cache to disk {}", path);
std::ofstream ofs(path);
std::ostreambuf_iterator<char> oit(ofs);
std::copy(keys.begin(), keys.end(), oit);
Expand All @@ -37,7 +37,7 @@ static void fromDisk(std::string cachedir, int frameid, GlobalComm::ViewObjects
if (cachedir.empty()) return;
objs.clear();
auto path = std::filesystem::path(cachedir) / (std::to_string(1000000 + frameid).substr(1) + ".zencache");
log_debug("load cache from disk {}", path);
log_critical("load cache from disk {}", path);
std::ifstream ifs(path);
std::istreambuf_iterator<char> iit(ifs), iite;
std::vector<char> dat;
Expand Down
4 changes: 2 additions & 2 deletions zeno/src/nodes/InputParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ZENDEFNODE(ParamFormat, {
},
{"format"},
{},
{"layout"},
{"string"},
});

struct ParamFileParser : zeno::INode {
Expand Down Expand Up @@ -256,7 +256,7 @@ ZENDEFNODE(ParamFileParser, {
{"DictObject", "params"},
},
{},
{"layout"},
{"string"},
});

}
Expand Down

0 comments on commit 50e8806

Please sign in to comment.