# component_testing::Realm

## Summary

| ### Constructors and Destructors ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a48781c21772653c9ec64ae905de095f1(https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &&)` ||
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1af240e6f25aa9bf7b3940463110a0c43d(const https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &)` ||

| ### Friend classes ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a63185751afd1bc80012034a162f8f503` | `friend class` |

| ### Public functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1abc3152d3df7ced40700d8cbb0f923b29(fuchsia::component::decl::Capability capability)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a2a5b163b9270c46b9fc2995e45695841(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#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a3b20e92ebe633b468b45800a21c71aca(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#classcomponent__testing_1_1_realm_1aa625ecbcf34ebac5cd7a8ae90f010773(fuchsia::component::decl::Collection collection)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a151b492fb3b8cc0385fec179eb39b591(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#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a5996daba30b8fee7be7136cb9c8bc591(fuchsia::component::decl::Environment environment)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a559df201eeb288e407ecc2bdadd10204(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#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a6ea109b9159c30813263569992a31195(..., https://fuchsia.dev/reference/cpp/class/fit/function-impl#classfit_1_1function__impl, ...)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm Use` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1ad267e956fe40c8fdc1f3126275bdecf9(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#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1af3cad58617e79add0ea942f3f185ed3d(https://fuchsia.dev/reference/cpp/struct/component-testing/route#structcomponent__testing_1_1_route route)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a6a73490b7167c0ed1d208b4d8d1fdaa8(const std::string & child_name)` | `fuchsia::component::decl::Component` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1aefb068e8b46f42a48558fb479c60d785()` | `fuchsia::component::decl::Component` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a55da409d743aeddfeac7e0c70a3744a2(const std::string & name)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a13f35268cf3ceceecc8871f589d2a305(const std::string & name)` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a0b30a867edf87ef19944419863ed4149(const std::string & child_name, fuchsia::component::decl::Component decl)` | `void` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a29e28f126d70364e9e170c62e4709d93(fuchsia::component::decl::Component decl)` | `void` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a9c6ddac4e641cc3bf1c2b99afcf1ca2b(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#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1aaab6a010aece330d6ea35f5e485232d3(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#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a3529c24e2551669414c704a4f4f2a396(https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &&)=default` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &` |
| `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm_1a10ef0ceac7651c5be15286e30095dfb4(const https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm &)=delete` | `https://fuchsia.dev/reference/cpp/class/component-testing/realm#classcomponent__testing_1_1_realm` |

## Friend classes

### RealmBuilder

```c++
friend class RealmBuilder
```

## Public functions

### AddCapability

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

### AddChild

```c++
Realm & 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
)
```

### AddCollection

```c++
Realm & AddCollection(
  fuchsia::component::decl::Collection collection
)
```

### AddConfiguration

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

### AddEnvironment

```c++
Realm & AddEnvironment(
  fuchsia::component::decl::Environment environment
)
```

### AddLocalChild

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

### AddLocalChild

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

### AddLocalChild

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

### AddRoute

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

### GetComponentDecl

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

### GetRealmDecl

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

### InitMutableConfigFromPackage

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

### InitMutableConfigToEmpty

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

### Realm

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

### Realm

```c++
 Realm(
  const Realm &
)=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++
Realm & RouteReadOnlyDirectory(
  const std::string & name,
  std::vector< Ref > to,
  DirectoryContents directory
)
```

### SetConfigValue

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

### operator=

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

### operator=

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