Here we go. Maybe the problem is the vector<std::string> inside the class Calculation.
namespace ignite {
namespace binary {
template<>
struct BinaryType<Calculation>
{
static int32_t GetTypeId()
{
return GetBinaryStringHashCode("Calculation");
}
static void GetTypeName(std::string& dst)
{
dst = "Calculation";
}
static int32_t GetFieldId(const char* name)
{
return GetBinaryStringHashCode(name);
}
static int32_t GetHashCode(const Calculation& obj)
{
return 0;
}
static bool IsNull(const Calculation& obj)
{
return false;
}
static void GetNull(Calculation& dst)
{
dst = Calculation();
}
static void Write(BinaryWriter& writer, const Calculation& obj)
{
writer.RawWriter().WriteBool(obj.local_log_);
writer.RawWriter().WriteString(obj.service_name_);
auto sa_writer = writer.WriteStringArray("input");
for(const auto &s : obj.input_)
sa_writer.Write(s);
sa_writer.Close();
}
static void Read(BinaryReader& reader, Calculation& dst)
{
dst.local_log_ = reader.RawReader().ReadBool();
dst.service_name_ = reader.RawReader().ReadString();
auto sa_reader = reader.ReadStringArray("input");
while(sa_reader.HasNext())
dst.input_.push_back(sa_reader.GetNext());
}
};
template<>
struct BinaryType<std::vector<std::string>>
{
typedef std::vector<std::string> value_type;
static int32_t GetTypeId()
{
return GetBinaryStringHashCode("VectorOfString");
}
static void GetTypeName(std::string& dst)
{
dst = "VectorOfString";
}
static int32_t GetFieldId(const char* name)
{
return GetBinaryStringHashCode(name);
}
static int32_t GetHashCode(const std::vector<std::string> &obj)
{
return 0;
}
static bool IsNull(const std::vector<std::string> &obj)
{
return !obj.size();
}
static void GetNull(std::vector<std::string> &dst)
{
dst = value_type();
}
static void Write(BinaryWriter &writer, const std::vector<std::string> &obj)
{
auto sa_writer = writer.WriteStringArray("items");
for(const auto &s : obj)
sa_writer.Write(s);
sa_writer.Close();
}
static void Read(BinaryReader &reader, std::vector<std::string> &dst)
{
auto sa_reader = reader.ReadStringArray("items");
while(sa_reader.HasNext())
dst.push_back(sa_reader.GetNext());
}
};
} } // namespace ignite binary
Thanks,
F.D.