class ObjectLinkerBase

Defined at line 32 of file ../../src/ui/scenic/lib/utils/object_linker.h

Contains common linking functionality that operates on type-erased objects.

Use ObjectLinker to link objects of concrete types together.

Protected Members

unordered_map exports_
unordered_map imports_

Public Methods

void ~ObjectLinkerBase ()

Defined at line 34 of file ../../src/ui/scenic/lib/utils/object_linker.h

size_t ExportCount ()

Defined at line 36 of file ../../src/ui/scenic/lib/utils/object_linker.h

size_t UnresolvedExportCount ()

Defined at line 40 of file ../../src/ui/scenic/lib/utils/object_linker.cc

size_t ImportCount ()

Defined at line 41 of file ../../src/ui/scenic/lib/utils/object_linker.h

size_t UnresolvedImportCount ()

Defined at line 46 of file ../../src/ui/scenic/lib/utils/object_linker.cc

Protected Methods

zx_koid_t CreateEndpoint (zx::handle token, ErrorReporter * error_reporter, bool is_import)

Creates a new Endpoint for linking and reports any errors in creation

using |error_reporter|.

Returns a zx_koid_t that uniquely identifies the registered Endpoint, or

ZX_KOID_INVALID if creation failed.

Defined at line 52 of file ../../src/ui/scenic/lib/utils/object_linker.cc

void DestroyEndpoint (zx_koid_t endpoint_id, bool is_import, bool destroy_peer)

Destroys the Endpoint pointed to by |endpoint_id| and removes all traces

of it from the linker. If the Endpoint is linked to a peer, the peer

will be notified of the Endpoint's destruction.

Defined at line 91 of file ../../src/ui/scenic/lib/utils/object_linker.cc

void ObjectLinkerBase ()

Defined at line 108 of file ../../src/ui/scenic/lib/utils/object_linker.h

void InitializeEndpoint (ObjectLinkerBase::Link * link, zx_koid_t endpoint_id, bool is_import)

Puts the Endpoint pointed to by |endpoint_id| into an initialized state

by supplying it with an object and connection callbacks. The Endpoint

will not be linked until its peer is also initialized.

Defined at line 151 of file ../../src/ui/scenic/lib/utils/object_linker.cc

ScopedAccess GetScopedAccess ()

Each method should acquire this before execution.

Defined at line 171 of file ../../src/ui/scenic/lib/utils/object_linker.h

void AttemptLinking (zx_koid_t endpoint_id, zx_koid_t peer_endpoint_id, bool is_import)

Attempts linking of the endpoints associated with |endpoint_id| and |peer_endpoint_id|.

The operation will only succeed if both endpoints have been initialized first.

Defined at line 185 of file ../../src/ui/scenic/lib/utils/object_linker.cc

std::unique_ptr<async::Wait> WaitForPeerDeath (async_dispatcher_t * dispatcher, zx_handle_t endpoint_handle, zx_koid_t endpoint_id, bool is_import)

Sets up an async::Wait on |Endpoint| that will fire a callback if the Endpoint peer's token is

destroyed before a link has been established.

All wait tasks run on the Endpoint's dispatcher, i.e. the default dispatcher at the Endpoint's

construction time.

Defined at line 221 of file ../../src/ui/scenic/lib/utils/object_linker.cc

zx::handle ReleaseToken (zx_koid_t endpoint_id, bool is_import)

Releases the zx::handle for the Endpoint associated with |endpoint_id|, allowing the caller

to establish a new link with it.

This operation works regardless of whether or not the link has resolved. If the link was

resolved, the peer Endpoint receives a |link_invalidated| callback and is put back in the

initialized-but-unresolved state.

Defined at line 287 of file ../../src/ui/scenic/lib/utils/object_linker.cc

Records