Skip to content

dtguidable

This is a facade layer which allows an object to expose its GUID.

This facade is vtable-dispatched. Please refer to dtvtable for more information on vtable dispatching.

Various objects in the system implement this facade to provide a common interface for retrieving their GUIDs. It is especially useful for transferring object identity information across processor network boundaries.

Mini-guide

  • For a class to implement this facade, it must register a dtguidable_vt_t vtable for its model number and implement the get_guid function.
  • To call the facade function dtguidable_get_guid, pass the handle to the function cast as dtguidable_handle.
  • Retrieve a GUID through the dispatcher function rather than calling implementation functions directly.

Example

dtguid_t guid;
my_obj_handle handle = NULL;
obtain_my_obj_handle_somehow(&handle);
dtguidable_get_guid((dtguidable_handle)handle, &guid);

Data structures

dtguidable_handle

Opaque handle used for dispatching GUID requests.

Macros

DTGUIDABLE_COMMON_MEMBERS

Defines required leading members for implementation structures.

DTGUIDABLE_DECLARE_API

Declares the GUID retrieval implementation for a concrete type.

DTGUIDABLE_INIT_VTABLE

Defines and initializes a static vtable for an implementation.

Functions

dtguidable_get_guid

Retrieves the GUID associated with a handle using its registered vtable.

Params:

const dtguidable_handle handle Opaque handle identifying the object.
dtguid_t* guid Output structure to receive the GUID.

Return: dterr_t* Error object on failure or NULL on success.