Я хочу иметь возможность отправлять сериализованные данные Protobuf с помощью HazelCast. Я понимаю, почему это вызывает ошибку, но есть ли способ ее обойти?
Вот пример кода, который я использую:
main. cpp
#include <iostream>
#include <vector>
#include <hazelcast/client/HazelcastClient.h>
#include "testProto.pb.h"
using namespace std;
int main(){
// create object
tutorial::Input protoInput;
protoInput.set_innum(500);
// buffer to store serialized string
string stringBuffer;
protoInputer.SerializeToString(&stringBuffer);
// set up hazelcast client
hazelcast::client::ClientConfig(config);
hazelcast::client::HazelcastClient hz(config);
hazelcast::client::IMap<string,string> map = hz.getMap<string,string>("myMap");
//error is from trying to write it
map.put("Input", stringBuffer);
return 0;
}
testProto.proto
syntax = "proto3";
package tutorial;
message Input{
int64 inNum = 1;
}