Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!nih-csl!alw.nih.gov!kgorlen From: kgorlen@alw.nih.gov (Keith Gorlen) Newsgroups: comp.lang.c++ Subject: Re: Object/IO in NIHCL Message-ID: <1547@nih-csl.nih.gov> Date: 30 May 91 18:44:16 GMT References: <1991May27.145953.115@bio.embnet.se> Sender: news@nih-csl.nih.gov Reply-To: kgorlen@alw.nih.gov (Keith Gorlen) Organization: National Inst. of Health Lines: 33 In article <1991May27.145953.115@bio.embnet.se>, sundvall@bio.embnet.se (Mats Sundvall) writes: |> |> I am aboout to use the object IO mechanism in NIHCL 3.0 to be able to tranfer |> data transactions between two machines. What I have not figured out yet is |> if you transfer an object that contains pointers to other objects, are the |> objects pointed to transfered as well. |> |> |> class Transaction : public Object { |> |> private: |> int counter; |> someObject *typeofdata; |> someOtherObject data; |> |> .. |> |> } |> |> |> I do not want typeofdata to be transfered in every transaction because that |> will be to much overhead. |> |> You will have to write a storer() member function and a readFrom() constructor for class Transaction that will store/read instances of class Transaction. These functions can decide whether or not to store/read typeofdata. Note that if you store a data structure that contains multiple Transaction instances, and some or all of these instances point to a shared instance of someObject, and your write the storer()/readFrom() for class Transaction to unconditionally store/read typeofdata, the shared someObject instances will be stored only once anyway. -- Keith Gorlen phone: (301) 496-1111 Building 12A, Room 2033 FAX: (301) 402-0007 National Institutes of Health uucp: uunet!kgorlen%alw.nih.gov Bethesda, MD 20892 Internet: kgorlen@alw.nih.gov