Results 1 to 3 of 3

Thread: Assertion when serializing a struct (Dynamic Ice)

  1. #1
    cyrille_favreau is offline Registered User
    Name: Cyrille Favreau
    Organization: Lombard Odier Darier Hentsch & Cie
    Project: Calculation Engine
    Join Date
    Aug 2011
    Posts
    11

    Assertion when serializing a struct (Dynamic Ice)

    Hi, I have the following simple struct

    Code:
    module StompPOC
    {
       struct Message
       {
          string description;
          int    value;
       };
    };
    And when I run the following code, I get an assertion:

    Code:
    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:

    Code:
    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

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,445
    Hi Cyrille,

    Welcome to the forum.

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

    Regards,
    Mark

  3. #3
    cyrille_favreau is offline Registered User
    Name: Cyrille Favreau
    Organization: Lombard Odier Darier Hentsch & Cie
    Project: Calculation Engine
    Join Date
    Aug 2011
    Posts
    11
    Hi Mark,

    No I did not, that does improve the situation

    Many thanks for your very quick response.

    Have a good weekend.
    Cyrille

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Serializing Exceptions
    By halfhp in forum Help Center
    Replies: 2
    Last Post: 02-18-2010, 03:45 AM
  2. How to marshaling struct with Ice-E?
    By wan in forum Help Center
    Replies: 1
    Last Post: 07-29-2009, 02:37 PM
  3. Dynamic Ice for Python
    By Edward Bishop in forum Help Center
    Replies: 3
    Last Post: 05-03-2007, 07:21 PM
  4. Dynamic Ice and Blobject (IceStorm)
    By KE5CRP in forum Help Center
    Replies: 7
    Last Post: 04-20-2005, 01:20 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •