# component_testing::RealmBuilder

## Summary

| ### Constructors and Destructors ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1aa019606ee932a1f399ecd58a9a23c3a8(https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &&)` ||
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1aedf391057861476e4119cb2eb68ba975(const https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &)` ||

| ### Public static functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1aaa92b84dc45ee776facec72891334eb0(std::shared_ptr< https://fuchsia.dev/reference/cpp/class/sys/service-directory#classsys_1_1_service_directory > svc)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1af62c1412138305ec6afe7e197e5faccd(std::string_view fragment_only_url, std::shared_ptr< https://fuchsia.dev/reference/cpp/class/sys/service-directory#classsys_1_1_service_directory > svc)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder` |

| ### Public functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a2e9dd6ac2406b98dea9ed5947421160d(fuchsia::component::decl::Capability capability)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a8a2bfed20bda61e0b6a20992c9f41daa(const std::string & child_name, const std::string & url, const https://fuchsia.dev/reference/cpp/struct/component-testing/child-options#structcomponent__testing_1_1_child_options & options)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a1427d7603dda028cfcd5c144f86a5261(const std::string & child_name, const https://fuchsia.dev/reference/cpp/struct/component-testing/child-options#structcomponent__testing_1_1_child_options & options)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a09e20d4ab4eca6305b9e627bbc2bfee2(std::vector< https://fuchsia.dev/reference/cpp/struct/component-testing/config-capability#structcomponent__testing_1_1_config_capability > configurations)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a3d372731c9ecbe1128b756c5b385de7f(const std::string & child_name, https://fuchsia.dev/reference/cpp/class/component-testing/local-component#classcomponent__testing_1_1_local_component *local_impl, const https://fuchsia.dev/reference/cpp/struct/component-testing/child-options#structcomponent__testing_1_1_child_options & options) ZX_REMOVED_SINCE(1` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a120d3c5bc3765bbcdea3e7bce3490b6f(..., https://fuchsia.dev/reference/cpp/class/fit/function-impl#classfit_1_1function__impl, ...)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder Use` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a7815af6c9f607fb28b7b7fe2803a5a0b(const std::string & child_name, https://fuchsia.dev/reference/cpp/class/fit/function-impl#classfit_1_1function__impl local_impl, const https://fuchsia.dev/reference/cpp/struct/component-testing/child-options#structcomponent__testing_1_1_child_options & options)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a2c5eaaa0f8f7b0005ecea89a177fb551(https://fuchsia.dev/reference/cpp/struct/component-testing/route#structcomponent__testing_1_1_route route)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1ab3ce10f30cecef6ecd682d9fbf8eacc5(async_dispatcher_t *dispatcher)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-root#classcomponent__testing_1_1_realm_root` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1ad8e83777e1a0c8beea992e3cd29e066b(const std::string & child_name)` | `fuchsia::component::decl::Component` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1afdb08b333840cb062abcecc721493c33()` | `fuchsia::component::decl::Component` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a3578e8d894ee9dabd7715f44e8b84ba9(const std::string & name)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1ad834d396d6fff959323a461cbfec2fa1(const std::string & name)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a8222550fb23708be3af93ec87db721d4(const std::string & child_name, fuchsia::component::decl::Component decl)` | `void` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a77f9bbd64b8df6e72dda889605c36c2b(fuchsia::component::decl::Component decl)` | `void` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a5e3b6b7d7dc334d2f90f602b70a0f052(const std::string & name, std::vector< Ref > to, https://fuchsia.dev/reference/cpp/class/component-testing/directory-contents#classcomponent__testing_1_1_directory_contents directory)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1aa7fffa4cf6b65d807593c03de4506ec7(const std::string & name, const std::string & key, https://fuchsia.dev/reference/cpp/class/component-testing/config-value#classcomponent__testing_1_1_config_value value)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a93668e223235ea6d6bd1120ca582220c(const std::string & collection)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a5201e20fdeaa1900bd7c882b0c129cb6(const std::string & name)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a6632d9b59c4f2323d50dbdbeac56a9b9(bool start_on_build)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a778f92cfb1a080b323034c02d60d60ef(https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &&)=default` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1a70b0deee172e908907a4420945f7fff7(const https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &)=delete` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm-builder#classcomponent__testing_1_1_realm_builder_1aa97892bfb72388e5286281c2d08cc5ca()` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &` |

## Public static functions

### Create

```c++
RealmBuilder Create(
  std::shared_ptr< sys::ServiceDirectory > svc
)
```

### CreateFromRelativeUrl

```c++
RealmBuilder CreateFromRelativeUrl(
  std::string_view fragment_only_url,
  std::shared_ptr< sys::ServiceDirectory > svc
)
```

## Public functions

### AddCapability

```c++
RealmBuilder & AddCapability(
  fuchsia::component::decl::Capability capability
)
```

### AddChild

```c++
RealmBuilder & AddChild(
  const std::string & child_name,
  const std::string & url,
  const ChildOptions & options
)
```

### AddChildRealm

```c++
Realm AddChildRealm(
  const std::string & child_name,
  const ChildOptions & options
)
```

### AddConfiguration

```c++
RealmBuilder & AddConfiguration(
  std::vector< ConfigCapability > configurations
)
```

### AddLocalChild

```c++
RealmBuilder & AddLocalChild(
  const std::string & child_name,
  LocalComponent *local_impl,
  const ChildOptions & options
) ZX_REMOVED_SINCE(1
```

### AddLocalChild

```c++
RealmBuilder Use AddLocalChild(
  ...,
  LocalComponentFactory,
  ...
)
```

### AddLocalChild

```c++
RealmBuilder & AddLocalChild(
  const std::string & child_name,
  LocalComponentFactory local_impl,
  const ChildOptions & options
)
```

### AddRoute

```c++
RealmBuilder & AddRoute(
  Route route
)
```

### Build

```c++
RealmRoot Build(
  async_dispatcher_t *dispatcher
)
```

### GetComponentDecl

```c++
fuchsia::component::decl::Component GetComponentDecl(
  const std::string & child_name
)
```

### GetRealmDecl

```c++
fuchsia::component::decl::Component GetRealmDecl()
```

### InitMutableConfigFromPackage

```c++
RealmBuilder & InitMutableConfigFromPackage(
  const std::string & name
)
```

### InitMutableConfigToEmpty

```c++
RealmBuilder & InitMutableConfigToEmpty(
  const std::string & name
)
```

### RealmBuilder

```c++
 RealmBuilder(
  RealmBuilder &&
)=default
```

### RealmBuilder

```c++
 RealmBuilder(
  const RealmBuilder &
)=delete
```

### ReplaceComponentDecl

```c++
void ReplaceComponentDecl(
  const std::string & child_name,
  fuchsia::component::decl::Component decl
)
```

### ReplaceRealmDecl

```c++
void ReplaceRealmDecl(
  fuchsia::component::decl::Component decl
)
```

### RouteReadOnlyDirectory

```c++
RealmBuilder & RouteReadOnlyDirectory(
  const std::string & name,
  std::vector< Ref > to,
  DirectoryContents directory
)
```

### SetConfigValue

```c++
RealmBuilder & SetConfigValue(
  const std::string & name,
  const std::string & key,
  ConfigValue value
)
```

### SetRealmCollection

```c++
RealmBuilder & SetRealmCollection(
  const std::string & collection
)
```

### SetRealmName

```c++
RealmBuilder & SetRealmName(
  const std::string & name
)
```

### StartOnBuild

```c++
RealmBuilder & StartOnBuild(
  bool start_on_build
)
```

### operator=

```c++
RealmBuilder & operator=(
  RealmBuilder &&
)=default
```

### operator=

```c++
RealmBuilder & operator=(
  const RealmBuilder &
)=delete
```

### root

```c++
Realm & root()
```