Files
ternfs-XTXMarkets/cpp/ShardDBData.cpp
Francesco Mazzoli fc0cee0e07 C++ shard
Most operations apart from spans-related ones work. Using this as
a checkpoint -- the Python code is currently not really working,
I'm working to migrate to pretty much a full C++/go world.
2022-12-10 10:55:25 +00:00

28 lines
782 B
C++

#include "ShardDBData.hpp"
std::ostream& operator<<(std::ostream& out, SpanState state) {
switch (state) {
case SpanState::CLEAN:
out << "CLEAN";
break;
case SpanState::DIRTY:
out << "DIRTY";
break;
case SpanState::CONDEMNED:
out << "CONDEMNED";
break;
default:
out << "SpanState(" << ((int)state) << ")";
break;
}
return out;
}
std::ostream& operator<<(std::ostream& out, const EdgeKey& edgeKey) {
out << "EdgeKey(dirId=" << edgeKey.dirId() << ", current=" << (int)edgeKey.current() << ", nameHash=" << edgeKey.nameHash() << ", name=" << edgeKey.name();
if (!edgeKey.current()) {
out << ", creationTime=" << edgeKey.creationTime();
}
out << ")";
return out;
}