More work on client and server

This commit is contained in:
2021-11-11 16:23:11 -05:00
parent caa5bab9d3
commit c1c0b02926
9 changed files with 103 additions and 21 deletions

View File

@@ -1,5 +1,6 @@
#include "invocation.hpp"
#include <sstream>
const std::string &InvocationData::get(const std::string &key) const {
static std::string blank_;
@@ -51,3 +52,22 @@ void Invocation::deserialize(StreamBuffer *sb) {
data_.deserialize(sb);
}
std::string Invocation::debug_string() {
std::ostringstream oss;
oss << "inv[";
switch (kind_) {
case KIND_INVALID: oss << "invalid"; break;
case KIND_PLAN: oss << "plan"; break;
case KIND_LUA: oss << "lua"; break;
case KIND_FLUSH_PRINTS: oss << "flush_prints"; break;
default: oss << "UNKNOWN"; break;
}
oss << " a=" << actor_;
oss << " p=" << place_;
oss << " " << action_;
for (const auto &pair : data_) {
oss << " " << pair.first << "=" << pair.second;
}
oss << "]";
return oss.str();
}