In the below code, I am taking requests from a client, put them together on a json object on my server class and sending it to a pusher(directly connected to a website, putting my data in there so I can search data easily) The code is working perfectly fine, but my manager said that I need to pass json by reference in this code, and I have no idea what to do. On Server Class:
grpc::Status RouteGuideImpl::PubEvent(grpc::ServerContext *context, 
                    const events::PubEventRequest *request, 
                    events::PubEventResponse *response){
    for(int i=0; i<request->event_size();i++){
    nhollman::json object;
    auto message = request->events(i);
    object["uuid"]=message.uuid();
    object["topic"]=message.type();
    pusher.jsonCollector(obj);
    }
    ...
}
On Pusher Class:
private:
    nholmann::json queue = nlohmann::json::array();
public:
    void Pusher::jsonCollector(nlohmann::json dump){
        queue.push_back(dump);
    }
    void Pusher::curlPusher(){
        std::string str = queue.dump();
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, str.data());
...
}
As much as I understand, I need to send the json object by reference. How can I do that?
 
     
    