MCPcopy Create free account
hub / github.com/AimRT/AimRT / ToString

Method ToString

src/interface/aimrt_module_cpp_interface/rpc/rpc_context.h:129–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 }
128
129 std::string ToString() const {
130 std::stringstream ss;
131 if (type_ == aimrt_rpc_context_type_t::AIMRT_RPC_CLIENT_CONTEXT) {
132 ss << "Client context, ";
133 } else if (type_ == aimrt_rpc_context_type_t::AIMRT_RPC_SERVER_CONTEXT) {
134 ss << "Server context, ";
135 } else {
136 ss << "Unknown context, ";
137 }
138
139 ss << "timeout: " << timeout_ns_ / 1000000 << "ms, meta: {";
140
141 for (auto itr = meta_data_map_.begin(); itr != meta_data_map_.end(); ++itr) {
142 if (itr != meta_data_map_.begin()) ss << ",";
143 ss << "{\"" << itr->first << "\":\"" << itr->second << "\"}";
144 }
145
146 ss << "}";
147
148 return ss.str();
149 }
150
151 private:
152 static const aimrt_rpc_context_base_ops_t* GenOpsBase() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected