Skip to content

Commit f231147

Browse files
committed
Mark response parameters accessor const and JSON serializable
1 parent 816d4ac commit f231147

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/infer_response.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ InferResponse::OutputTensors()
6060
return output_tensors_;
6161
}
6262

63-
std::string&
64-
InferResponse::Parameters()
63+
const std::string&
64+
InferResponse::Parameters() const
6565
{
6666
return parameters_;
6767
}

src/infer_response.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class InferResponse {
7676
std::shared_ptr<PbError> error = nullptr, std::string parameters = "",
7777
const bool is_last_response = true, void* id = nullptr);
7878
std::vector<std::shared_ptr<PbTensor>>& OutputTensors();
79-
std::string& Parameters();
79+
const std::string& Parameters() const; // JSON serializable unless empty
8080
void SaveToSharedMemory(
8181
std::unique_ptr<SharedMemoryManager>& shm_pool, bool copy_gpu = true);
8282
static std::unique_ptr<InferResponse> LoadFromSharedMemory(

0 commit comments

Comments
 (0)