class Service
Defined at line 29 of file ../../src/storage/lib/vfs/cpp/service.h
A node which binds a channel to a service implementation when opened.
This class is thread-safe.
Public Methods
fuchsia_io::NodeProtocolKinds GetProtocols ()
|Vnode| implementation:
Defined at line 20 of file ../../src/storage/lib/vfs/cpp/service.cc
zx_status_t ConnectService (zx::channel channel)
Defined at line 24 of file ../../src/storage/lib/vfs/cpp/service.cc
Protected Methods
void Service (Connector connector)
Creates a service with the specified connector.
If the |connector| is null, then incoming connection requests will be dropped.
Defined at line 16 of file ../../src/storage/lib/vfs/cpp/service.cc
void ~Service ()
Destroys the services and releases its connector.
Defined at line 18 of file ../../src/storage/lib/vfs/cpp/service.cc
template <typename Callable, std::enable_if_t<maybe_protocol_connector<Callable>, bool> = true>
void Service (Callable && connector)
Creates a service with the specified connector. This version is typed to the exact FIDL
protocol the handler will support:
auto service = fbl::MakeRefCounted
<fs
::Service>(
[](fidl::ServerEnd
<fidl
_library::SomeProtocol> server_end) {
// |server_end| speaks the |fidl_library::SomeProtocol| protocol.
// Handle FIDL messages on |server_end|.
});
If the |connector| is null, then incoming connection requests will be dropped.
The connector should be a callable taking a single |fidl::ServerEnd
<ProtocolType
>| as argument,
and return a |zx_status_t|.
Defined at line 81 of file ../../src/storage/lib/vfs/cpp/service.h
Records
Friends
class RefPtr
class MakeRefCountedHelper