]> git.buserror.net Git - polintos/scott/priv.git/blob - doc/orb/ids
469303d9a34cddc3f79469b9ffe3e0ed3e90fae0
[polintos/scott/priv.git] / doc / orb / ids
1 IDs are used to identify a specific objects and methods to the ORB. Each
2 address space has its own object ID space.  Methods are identified by index
3 within an interface.  Interfaces and struct types are merely objects that
4 implement specific introspection interfaces, and thus share the object ID
5 space.
6
7 Applications interact with objects via pointers (or references, or whatever
8 else is appropriate for the language), not IDs.  Thus, the marshalling stubs
9 accept all object references in pointer form, rather than ID form.  The
10 language mapping ensures that the ID can be found from the pointer in a
11 manner consistent with the platform ABI.  Typically, it is stored as some
12 fixed offset of the first word of the entity pointed to.  
13
14 Objects are not assigned IDs until they are passed to the ORB.  When
15 marshalling such an object, an ID is assigned from the local numberspace
16 (high-bit clear) by marshalling code, and the ID is added to the newobj
17 list, along with a SHA-1 hash of the list of interfaces associated with the
18 object (hereafter, the "interface hash").  The ID is stored into the object
19 for future use.
20
21 When presenting the object to the destination address space, the ORB needs
22 to convert the local object ID to the object ID in the server's ID space. 
23 If the object has not yet been used in that address space, there will be no
24 local ID (or pointer) associated with it.  If this is the case, an ID in the
25 remote numberspace (high-bit set) will be created by the ORB, and the object
26 will be on the receiver's newobj list.
27
28 Marshalling code will maintain a wrapper object for every remote ID, as well
29 as an ID-to-pointer lookup table for both local and remote objects.
30
31 Each local and remote object contains two reference counts -- local and orb. 
32 The local reference count