Archived

This forum has been archived. Please start a new discussion on GitHub.

Assertion when serializing a struct (Dynamic Ice)

Hi, I have the following simple struct
module StompPOC
{
   struct Message
   {
      string description;
      int    value;
   };
};

And when I run the following code, I get an assertion:
std::vector<Ice::Byte> data;
Ice::OutputStreamPtr dataOut = Ice::createOutputStream( communicator() );
StompPOC::Message msg;
msg.description = "This is a byte message (Dynamic Iced)";
msg.value = 999;
dataOut->write( msg ); ==> ASSERTION 
dataOut->finished( data );

The assertion is raised by the following piece of code, in the Ice/stream.h file:
template<StreamTraitType st>
struct StreamWriter
{
    template<typename T>
    static void write(const OutputStreamPtr&, const T&)
    {
        // This asserts because we end up writing something for which
        // we never defined a trait.
        assert(false);
    }
};
What I am doing wrong?

Thanks in advance for any help.
Cyrille

Comments

  • mes
    mes California
    Hi Cyrille,

    Welcome to the forum.

    Did you include the --stream option when you compiled your Slice definitions with slice2cpp?

    Regards,
    Mark
  • Hi Mark,

    No I did not, that does improve the situation :)

    Many thanks for your very quick response.

    Have a good weekend.
    Cyrille