class LocalComponentImplBase
Defined at line 163 of file ../../sdk/lib/sys/component/cpp/testing/realm_builder_types.h
[START mock_interface_cpp]
The interface for backing implementations of components with a Source of Mock.
Protected Members
fdio_ns_t * namespace_
bool initialized_
Public Methods
void ~LocalComponentImplBase ()
Defined at line 149 of file ../../sdk/lib/sys/component/cpp/testing/realm_builder_types.cc
void OnStart ()
Invoked when the Component Manager issues a Start request to the component.
|mock_handles| contains the outgoing directory and namespace of
the component.
void Exit (zx_status_t return_code)
The component can call this method to terminate its instance. This will
release the handles, and drop the |ComponentController|, informing
component manager that the component has stopped. Calling |Exit()| will
also cause the Realm to drop the |LocalComponentImplBase|, which should
destruct the component, and the handles and bindings held by the component.
Therefore the |LocalComponentImplBase| should not do anything else after
calling |Exit()|.
This method is not valid until |OnStart()| is invoked.
Defined at line 139 of file ../../sdk/lib/sys/component/cpp/testing/realm_builder_types.cc
fdio_ns_t * ns ()
Returns the namespace provided to the mock component.
This method is not valid until |OnStart()| is invoked.
Defined at line 88 of file ../../sdk/lib/sys/component/cpp/testing/realm_builder_types.cc
void OnStop ()
The LocalComponentImplBase derived class may override this method to be informed if
ComponentController::Stop() was called on the controller associated with
the component instance. The ComponentController binding will be dropped
automatically, immediately after LocalComponentImplBase::OnStop() returns.
Defined at line 176 of file ../../sdk/lib/sys/component/cpp/testing/realm_builder_types.h
Protected Methods
zx_status_t Initialize (fdio_ns_t * ns, zx::channel outgoing_dir, async_dispatcher_t * dispatcher, fit::function<void (zx_status_t)> on_exit)
Called by internal::LocalComponentInstance
Defined at line 95 of file ../../sdk/lib/sys/component/cpp/testing/realm_builder_types.cc
zx_status_t SetOutgoingDirectory (zx::channel outgoing_dir, async_dispatcher_t * dispatcher)
The different bindings override this function and provide their own
Outgoing_directory calls.
Friends
class LocalComponentInstance