Article View: comp.std.c++
Article #1208Re: Zero-length structures and pointer comparisons
From: Stuart MacMartin
Date: Fri, 11 Dec 1992 21:28
Date: Fri, 11 Dec 1992 21:28
42 lines
2933 bytes
2933 bytes
In article <5357@holden.lulea.trab.se> jbn@lulea.trab.se (Johan Bengtsson) writes: >Put differently: the database ID total order and the corresponding >transient pointer orders must be order-isomorphic (look it up, I did :-), >to ensure that the total pointer order for the addresses of >persistent objects mapped into transient memory is consistent between >different runs of the same program. Aren't we talking about a total ordering that is consistent for the duration of the process? The OODBMS objects can have an ordering that is persistent, but obviously the transient objects won't have a persistent ordering. Do we care if the ordering of persistent objects is the same between different runs of the program? Am I missing something? And as I said in an earlier post (which you might not have read when you posted this), several OODBMSs allow multiple handles on the same object. Furthermore, Objectivity (for example) has a handle in which the actual address of the object in core is swizzled. This swizzling is safe because it is private to the handle, and the user's program never sees the address of the actual object (if he is practicing safe programming). In fact, the object might not be in core even if the handle is valid, and the address in core may change unbeknownst to the user. So the user does not have the address of the object, so he won't be comparing C++ pointers to these objects. And in fact, comparing the address of the actual object will not give you the consistent ordering for the duration of the process unless you explicitly restrict the capabilities of the OODBMS. Since this is all OODBMS specific, it is much better to let the OODBMS manage the ordering and forget about trying to get an ordering out of whatever handles it gives you. All that long-winded explanation aside, I would like to be able to define a total ordering on my objects - my persistent objects (stored in various OODBMSs) and my transient C++ objects - that is consistent for the lifetime of the objects and the duration of the process. I don't have any specific need for it at the moment, but I expect I would use this if I had it available. Stuart -- : Stuart MacMartin email: sjm@bnr.ca : : Bell-Northern Research phone: (613) 763-5625 : : PO Box 3511, Stn C, Ottawa, K1Y-4H7, CANADA Standard disclaimers apply. :
Technical Details
Message-ID:
<1992Dec11.212831.19493@bcrka451.bnr.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!nott!bnrgate!bcrka451!bcrki65!sjmReferences:
<1992Dec10.051649.10282@jyu.fi> <5357@holden.lulea.trab.se>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!nott!bnrgate!bcrka451!bcrki65!sjm From: sjm@bcrki65.bnr.ca (Stuart MacMartin) Subject: Re: Zero-length structures and pointer comparisons Message-ID: <1992Dec11.212831.19493@bcrka451.bnr.ca> Sender: 5E00 Corkstown News Server Organization: Bell-Northern Research Ltd., Ottawa, Canada References: <1992Dec10.051649.10282@jyu.fi> <5357@holden.lulea.trab.se> Date: Fri, 11 Dec 1992 21:28:31 GMT Lines: 42