mardi 12 juin 2018

zeromq msgpack struct example

I am trying to communicate between nodes via zeromq. I need to send a struct of:

struct Content{
    std::vector<cv::Mat> image;
    std::string msg;

};

try to utilize msgpack:

    Content content;
    content.image = msg2;
    content.mesaj = "naber kardes";

    msgpack::type::tuple<Content> src(content);
    // serialize the object into the buffer.
    // any classes that implements write(const char*,size_t) can be a buffer.
    std::stringstream buffer;
    msgpack::pack(buffer, src);
    cout << sizeof(buffer) << endl;

it gives:

/usr/local/include/msgpack/v1/object.hpp:631:11: error: no member named 'msgpack_pack' in 'Content'

still new to c++. How can I send my Content struct through zeromq with help of the msgpack ?

thanks

Aucun commentaire:

Enregistrer un commentaire