Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-30-2004
Nis Baggesen Nis Baggesen is offline
Registered User
 
 
Join Date: Aug 2004
Location: Aarhus, Denmark
Posts: 112
Object Factories and object initialisation

As far as I have been able to determine, then when you create an object with an Object Factory, the object factory will first call the constructor of the implementation class specified in the factory, and then all the public members specified in the slice definition are set.

Now my question is - Is there anyway I can setup some kind of initialisation function which is called by the object factory (Or something similar) _after_ all the public members have been set, so that I can do my initialisation based on the data that was actually transmitted.

Of course I could call such an initialisation function in all the slice functions where I receive an object, but it just isn't as elegant as an extension of the object factory would be.

mvh

Nis
Reply With Quote
  #2 (permalink)  
Old 09-30-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,762
Yes, you can overload ice_postUnmarshal(), which will be called after all data members have been initialized. For an example, have a look at test/Ice/object.

Apparently we have this not documented in the Ice manual. We will fix this with the next release.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
object factories in slice japanman Help Center 2 03-13-2005 05:30 PM
thread per object Harvinder Comments 3 06-21-2004 04:12 PM
Object Replication? rstolle Help Center 3 03-29-2004 04:36 PM
Object Factory enzo Help Center 2 03-17-2004 01:29 PM
Object serialization in ICE shantanu_k06 Help Center 4 02-17-2004 01:00 PM


All times are GMT -4. The time now is 07:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.