From 717fc707d1109d9e1e5e7a1f9c99c08921d499b2 Mon Sep 17 00:00:00 2001 From: Austin Schneider Date: Sun, 20 Oct 2024 21:38:03 -0600 Subject: [PATCH] Remove printouts --- .../public/SIREN/serialization/ByteString.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/projects/serialization/public/SIREN/serialization/ByteString.h b/projects/serialization/public/SIREN/serialization/ByteString.h index 05762234..ac2a21cd 100644 --- a/projects/serialization/public/SIREN/serialization/ByteString.h +++ b/projects/serialization/public/SIREN/serialization/ByteString.h @@ -34,15 +34,12 @@ std::vector to_byte_string(T const & obj) { } std::string bytes_to_hex_string(std::vector const & bytes) { - std::cout << "bytes_to_hex_string" << std::endl; - std::cout << "bytes.size(): " << bytes.size() << std::endl; std::ostringstream oss; oss << std::hex << std::setfill('0'); for (char const & byte : bytes) { oss << std::setw(2) << (unsigned int)std::uint8_t(byte); } std::string s = oss.str(); - std::cout << "s.size(): " << s.size() << std::endl; if(not (s.size() % 2 == 0)) throw std::runtime_error("s.size() % 2 != 0"); if(not (s.size() == 2 * bytes.size())) @@ -52,11 +49,9 @@ std::string bytes_to_hex_string(std::vector const & bytes) { template T from_byte_string(std::vector const & byte_string) { - std::cout << "from_byte_string" << std::endl; std::string str(byte_string.begin(), byte_string.end()); if(not (str.size() == byte_string.size())) throw std::runtime_error("str.size() != byte_string.size()"); - std::cout << "str.size(): " << str.size() << std::endl; std::istringstream iss(str, std::ios::binary); std::shared_ptr obj(cereal::access::construct()); { @@ -66,13 +61,10 @@ T from_byte_string(std::vector const & byte_string) { size_t n_bytes = iss.tellg(); if(not (n_bytes == str.size())) throw std::runtime_error("n_bytes != str.size()"); - std::cout << "obj: " << obj << std::endl; return *obj; } std::vector hex_string_to_bytes(std::string const & hex_string) { - std::cout << "hex_string_to_bytes" << std::endl; - std::cout << "hex_string.size(): " << hex_string.size() << std::endl; std::vector bytes; for (size_t i = 0; i < hex_string.size(); i += 2) { std::string byte_string = hex_string.substr(i, 2); @@ -81,7 +73,6 @@ std::vector hex_string_to_bytes(std::string const & hex_string) { } if(not (bytes.size() == hex_string.size() / 2)) throw std::runtime_error("bytes.size() != hex_string.size() / 2"); - std::cout << "bytes.size(): " << bytes.size() << std::endl; return bytes; } @@ -89,24 +80,17 @@ template pybind11::tuple pickle_save(T const & cpp_obj) { std::vector byte_string = to_byte_string(cpp_obj); std::string hex_string = bytes_to_hex_string(byte_string); - std::cout << "Pickle save" << std::endl; - std::cout << "hex_string.size(): " << hex_string.size() << std::endl; return pybind11::make_tuple(hex_string); } template T pickle_load(pybind11::tuple t) { - std::cout << "pickle_load" << std::endl; - std::cout << "t.size(): " << t.size() << std::endl; if (t.size() != 1) { throw std::runtime_error("Invalid state!"); } std::string hex_string = t[0].cast(); - std::cout << "hex_string.size(): " << hex_string.size() << std::endl; std::vector byte_string = hex_string_to_bytes(hex_string); - std::cout << "byte_string.size(): " << byte_string.size() << std::endl; T res = from_byte_string(byte_string); - std::cout << "res: " << res << std::endl; return res; }