Results 1 to 2 of 2

Thread: any way to extend slice2cpp?

  1. #1
    peterlspot is offline Registered User
    Name: Peter Lau
    Organization: Self
    Project: Study
    Join Date
    Nov 2007
    Posts
    13

    any way to extend slice2cpp?

    Hi

    Just wonder if there is any way to extend slice2cpp so that I can have additional methods added for data-only SLICE classes?

    The method to be added may be very simple. The reason for not adding this methods to SLICE class definitions is due to the overhead caused by introducing operations to SLICE classes: 1) the class can not be instantiated directly since they r abstract 2) object factories need to be defined to help ICE communicator.

    So I wonder if the SLICE2CPP can be extensible?

    Thanks a lot.
    Peter Lau
    No pains, no gains.
    Lifelong programming ...

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    No, there are no extension hooks for the kind of thing you want to do. I am not sure that we'd add such hooks either--we have not exactly been overwhelmed with requests for this.

    Note that, as far as run-time overhead is concerned, there is no difference between instantiating a concrete class as generated by the Slice compiler, and instantiating a concrete class that you write yourself. One way to get your additional methods into a Slice class would be:

    Code:
    // Slice
    class X {
        int i;
    };
    This generates a corresponding C++ class X, from which you can derive your own class with the additional methods:

    Code:
    // C++
    class MyX : public X {
    public:
        void foo();
    };
    Whenever the Ice run time receives an X over the wire, it calls the object factory for X, so all you need to do is register an object factory for X that instantiates a MyX instead.

    Cheers,

    Michi.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Slice2cpp terminates
    By gmh in forum Bug Reports
    Replies: 3
    Last Post: 05-12-2009, 03:40 PM
  2. How to extend ICE log information?
    By vshevchenko in forum Help Center
    Replies: 2
    Last Post: 02-06-2008, 12:57 PM
  3. slice2cpp possible problem
    By g00fy in forum Bug Reports
    Replies: 2
    Last Post: 01-10-2006, 01:53 PM
  4. a problem using slice2cpp
    By alienwolf in forum Help Center
    Replies: 3
    Last Post: 04-05-2005, 11:26 PM
  5. Slice2cpp question
    By Mr.Freeze in forum Help Center
    Replies: 1
    Last Post: 12-11-2003, 09:55 AM

Posting Permissions

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