# sys::ServiceWatcher

## Summary

| ### Constructors and Destructors ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/sys/service-watcher#classsys_1_1_service_watcher_1a5dac521eca8b49a376346f9fa07f8247(https://fuchsia.dev/reference/cpp/class/fit/function-impl#classfit_1_1function__impl callback)` ||

| ### Public types ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/sys/service-watcher#classsys_1_1_service_watcher_1a2fc33c1205acc30f569ee64fe20e6e12` | using `https://fuchsia.dev/reference/cpp/class/fit/function-impl#classfit_1_1function__impl< void(fuchsia::io::WatchEvent event, std::string instance)>` |

| ### Public functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/sys/service-watcher#classsys_1_1_service_watcher_1a2e43b83ab456dda04143a3ed18efd1f7(const https://fuchsia.dev/reference/cpp/class/sys/service-aggregate-base#classsys_1_1_service_aggregate_base & service_aggregate, async_dispatcher_t *dispatcher)` | `zx_status_t` |
| `https://fuchsia.dev/reference/cpp/class/sys/service-watcher#classsys_1_1_service_watcher_1ab818722ae1ced1a2ce3c67dacf2ad433()` | `zx_status_t` |

## Public types

### Callback

```c++
fit::function< void(fuchsia::io::WatchEvent event, std::string instance)> Callback
```

## Public functions

### Begin

```c++
zx_status_t Begin(
  const ServiceAggregateBase & service_aggregate,
  async_dispatcher_t *dispatcher
)
```

### Cancel

```c++
zx_status_t Cancel()
```

### ServiceWatcher

```c++
 ServiceWatcher(
  Callback callback
)
```