Results 1 to 4 of 4

Thread: IceStorm: Publishing my own class

  1. #1
    ShaChris23 is offline Registered User
    Name: Shiv Wang
    Organization: Applied Signal Technology, Inc.
    Project: high-performance scientific computation
    Join Date
    Oct 2009
    Posts
    9

    IceStorm: Publishing my own class

    Hi,

    Does IceStorm support publishing my own class?

    For example, I want to pubishing a topic called "BigInteger" as described here:

    C++ Big Integer Library - Matt McCutchen's Web Site

    I have an application that I want to publish a number that keeps growing forever (i.e. never overflows or wraps around).

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Sivesh,

    IceStorm allows you to publish any message, as long as this message is defined in Slice.

    For example, you could associate an IceStorm topic with the following interface:

    Code:
    // Slice
    
    sequence<long> BigIntegerData;
    
    interface MyEvent
    {
        void sentData(BigIntegerData bigIntData);
    };
    Your publisher would transform its BigInteger objects into BigIntegerData before calling sendData, and your subscribers would transform the received BigIntegerData into BigIntegers.

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    ShaChris23 is offline Registered User
    Name: Shiv Wang
    Organization: Applied Signal Technology, Inc.
    Project: high-performance scientific computation
    Join Date
    Oct 2009
    Posts
    9

    Smile

    Hi Bernard,

    So essentially, I would have to:

    1) convert from an Object to a sequence of bytes (serializing it)
    2) publish the serialized data (as specified in the Slice file)
    3) have a subscriber that receives the serialized data
    4) subscriber will convert from sequence of bytes to Object (de-serializing it)
    5) and now it's ready to be used!

    I just want to confirm this is along the line of what you said.

    Note: Since I convert into sequence of bytes myself, this means I probably have to also take care of byte-endianness myself, or not?

    Thanks!

    S.

  4. #4
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Shivesh,

    If you want to use bytes, you could, yes. In my example above, I used a sequence<long>: in that case, Ice would take care of reordering bytes as needed when your publisher and subscriber have different endianess.

    In Java and C#, you can pass serializable objects directly as Ice operation parameters (the Ice runtime sees just a sequence<byte>): see
    http://www.zeroc.com/doc/Ice-3.3.1/m...lice.5.18.html

    However, we don't have anything equivalent for C++.

    Cheers,
    Bernard
    Bernard Normier
    ZeroC, Inc.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 09-09-2010, 12:28 PM
  2. How to use IceStorm::Service class?
    By caihua2007 in forum Help Center
    Replies: 2
    Last Post: 03-20-2008, 09:04 PM
  3. Publishing to replicated IceStorms
    By bigtim in forum Help Center
    Replies: 4
    Last Post: 02-13-2008, 11:19 AM
  4. Connections newsletter now publishing bi-monthly
    By mes in forum Announcements
    Replies: 0
    Last Post: 08-22-2007, 10:12 AM
  5. IceStorm Publishing Error
    By aerowyn in forum Help Center
    Replies: 3
    Last Post: 10-18-2005, 09:56 PM

Posting Permissions

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