# component Namespace

# component

## Summary

| ### Typedefs ||
|---|---|
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a72e49b8e786ce73eb1a794591ef2bd1e` | using `https://fuchsia.dev/reference/cpp/class/fit/function-impl#classfit_1_1function__impl< void(typename https://fuchsia.dev/reference/cpp/class/zx/channel#classzx_1_1channel)>` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1affbf0d64554e040ea5f5361776a477e8` | using `fidl::ServiceInstanceHandler< fidl::internal::ChannelTransport >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a711cad00c00882f03a1339900994fef7` | using `https://fuchsia.dev/reference/cpp/class/fit/function-impl#classfit_1_1function__impl< void(fidl::internal::ServerEndType< Protocol > request)>` |

| ### Functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a9d89eab37017f971b1e26497c4d392e6(https://fuchsia.dev/reference/cpp/other/singletonfidl/unowned-client-end#singletonfidl_1_1_unowned_client_end< Protocol > client)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< Protocol > >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1ab5c910cfcda345d1d4bb3f368ced4a82(const https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< Protocol > & client)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< Protocol > >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a4098e417e7f49e53a389cd64adfc129c(https://fuchsia.dev/reference/cpp/other/singletonfidl/server-end#singletonfidl_1_1_server_end< Protocol > server_end, std::string_view path)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a45bd9f24577cffae6f7959eb0659a81b(std::string_view path)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< Protocol > >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a3cccc7fc998f79f4093b8aa75bc10163(https://fuchsia.dev/reference/cpp/other/singletonfidl/unowned-client-end#singletonfidl_1_1_unowned_client_end< fuchsia_io::Directory > svc_dir, https://fuchsia.dev/reference/cpp/other/singletonfidl/server-end#singletonfidl_1_1_server_end< Protocol > server_end, std::string_view name)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a9b06c669b0ad4f774b4382dac270e998(https://fuchsia.dev/reference/cpp/other/singletonfidl/unowned-client-end#singletonfidl_1_1_unowned_client_end< fuchsia_io::Directory > svc_dir, std::string_view name)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< Protocol > >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a477b3716574026910e5620e9a2f64e47(https://fuchsia.dev/reference/cpp/other/singletonfidl/unowned-client-end#singletonfidl_1_1_unowned_client_end< fuchsia_io::Directory > svc_dir, https://fuchsia.dev/reference/cpp/other/singletonfidl/server-end#singletonfidl_1_1_server_end< typename ServiceMember::ProtocolType > server_end, std::string_view instance)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a4475f04063a435e97ef507bce6e22b05(https://fuchsia.dev/reference/cpp/other/singletonfidl/unowned-client-end#singletonfidl_1_1_unowned_client_end< fuchsia_io::Directory > svc_dir, std::string_view instance)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< typename ServiceMember::ProtocolType > >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a4270ebb70d6128b1c3821cd0d8bc804a(std::string_view instance)` | `std::string` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1aca199d7f3e150e42afd9f8de64650176(https://fuchsia.dev/reference/cpp/other/singletonfidl/unowned-client-end#singletonfidl_1_1_unowned_client_end< Protocol > client)` | `https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< Protocol >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a01acca9dffe1cba7d54f83df418d4a0e(const https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< Protocol > & client)` | `https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< Protocol >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a18a1c7d473e8677124adfc88ccf8dfc2(std::string_view path, fuchsia_io::wire::Flags flags)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< fuchsia_io::Directory > >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1aba13a2e7225c5943fabe944d318e8240(https://fuchsia.dev/reference/cpp/other/singletonfidl/unowned-client-end#singletonfidl_1_1_unowned_client_end< fuchsia_io::Directory > dir, std::string_view path, fuchsia_io::wire::Flags flags)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< fuchsia_io::Directory > >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1aff05fef88a9f059f3e135253422c8608(std::string_view instance)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< typename Service::ServiceClient >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a2c50f3f2565588e9e11643cd02bbd78c(https://fuchsia.dev/reference/cpp/other/singletonfidl/unowned-client-end#singletonfidl_1_1_unowned_client_end< fuchsia_io::Directory > dir, std::string_view instance)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< typename Service::ServiceClient >` |
| `https://fuchsia.dev/reference/cpp/namespace/component#namespacecomponent_1a0769712e1e35a751876e180bbb4ee8c6(std::string_view path)` | `https://fuchsia.dev/reference/cpp/other/singletonzx/result#singletonzx_1_1result< https://fuchsia.dev/reference/cpp/other/singletonfidl/client-end#singletonfidl_1_1_client_end< fuchsia_io::Directory > >` |

| ### Classes ||
|---|---|
| [component::DirectoryWatcher](https://fuchsia.dev/reference/cpp/class/component/directory-watcher) |   |
| [component::OutgoingDirectory](https://fuchsia.dev/reference/cpp/class/component/outgoing-directory) |   |
| [component::ServiceMemberWatcher](https://fuchsia.dev/reference/cpp/class/component/service-member-watcher) |   |
| [component::SyncDirectoryWatcher](https://fuchsia.dev/reference/cpp/class/component/sync-directory-watcher) |   |
| [component::SyncServiceMemberWatcher](https://fuchsia.dev/reference/cpp/class/component/sync-service-member-watcher) |   |

| ### Structs ||
|---|---|
| [component::IsStructuredConfig](https://fuchsia.dev/reference/cpp/struct/component/is-structured-config) |   |
| [component::IsStructuredConfig\< T, std::void_t\< decltype(T::kIsStructuredConfig)\> \>](https://fuchsia.dev/reference/cpp/struct/component/is-structured-config-t-std/void-t-decltype-07-t/k-is-structured-config-08-4-) |   |

## Typedefs

### AnyHandler

```c++
fit::function< void(typename fidl::internal::ChannelTransport::OwnedType)> AnyHandler
```

### ServiceInstanceHandler

```c++
fidl::ServiceInstanceHandler< fidl::internal::ChannelTransport > ServiceInstanceHandler
```

### TypedHandler

```c++
fit::function< void(fidl::internal::ServerEndType< Protocol > request)> TypedHandler
```

## Functions

### Clone

```c++
zx::result< fidl::ClientEnd< Protocol > > Clone(
  fidl::UnownedClientEnd< Protocol > client
)
```

### Clone

```c++
zx::result< fidl::ClientEnd< Protocol > > Clone(
  const fidl::ClientEnd< Protocol > & client
)
```

### Connect

```c++
zx::result Connect(
  fidl::ServerEnd< Protocol > server_end,
  std::string_view path
)
```

### Connect

```c++
zx::result< fidl::ClientEnd< Protocol > > Connect(
  std::string_view path
)
```

### ConnectAt

```c++
zx::result ConnectAt(
  fidl::UnownedClientEnd< fuchsia_io::Directory > svc_dir,
  fidl::ServerEnd< Protocol > server_end,
  std::string_view name
)
```

### ConnectAt

```c++
zx::result< fidl::ClientEnd< Protocol > > ConnectAt(
  fidl::UnownedClientEnd< fuchsia_io::Directory > svc_dir,
  std::string_view name
)
```

### ConnectAtMember

```c++
zx::result ConnectAtMember(
  fidl::UnownedClientEnd< fuchsia_io::Directory > svc_dir,
  fidl::ServerEnd< typename ServiceMember::ProtocolType > server_end,
  std::string_view instance
)
```

### ConnectAtMember

```c++
zx::result< fidl::ClientEnd< typename ServiceMember::ProtocolType > > ConnectAtMember(
  fidl::UnownedClientEnd< fuchsia_io::Directory > svc_dir,
  std::string_view instance
)
```

### MakeServiceMemberPath

```c++
std::string MakeServiceMemberPath(
  std::string_view instance
)
```

### MaybeClone

```c++
fidl::ClientEnd< Protocol > MaybeClone(
  fidl::UnownedClientEnd< Protocol > client
)
```

### MaybeClone

```c++
fidl::ClientEnd< Protocol > MaybeClone(
  const fidl::ClientEnd< Protocol > & client
)
```

### OpenDirectory

```c++
zx::result< fidl::ClientEnd< fuchsia_io::Directory > > OpenDirectory(
  std::string_view path,
  fuchsia_io::wire::Flags flags
)
```

### OpenDirectoryAt

```c++
zx::result< fidl::ClientEnd< fuchsia_io::Directory > > OpenDirectoryAt(
  fidl::UnownedClientEnd< fuchsia_io::Directory > dir,
  std::string_view path,
  fuchsia_io::wire::Flags flags
)
```

### OpenService

```c++
zx::result< typename Service::ServiceClient > OpenService(
  std::string_view instance
)
```

### OpenServiceAt

```c++
zx::result< typename Service::ServiceClient > OpenServiceAt(
  fidl::UnownedClientEnd< fuchsia_io::Directory > dir,
  std::string_view instance
)
```

### OpenServiceRoot

```c++
zx::result< fidl::ClientEnd< fuchsia_io::Directory > > OpenServiceRoot(
  std::string_view path
)
```