# ArResolveAnchorOnTerrainFuture

An asynchronous operation for resolving a terrain anchor launched by `https://developers.google.com/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync`.

See the [Terrain anchors developer guide](https://developers.google.com/ar/develop/geospatial/c/anchors#terrain-anchors) for more information.

## Summary

| ### Typedefs ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterraincallback)(void *context, ArAnchor *anchor, ArTerrainAnchorState terrain_anchor_state)` | typedef `void(*` Callback definition for `https://developers.google.com/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync`. |
| `https://developers.google.com/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture` | typedef `struct ArResolveAnchorOnTerrainFuture_` Handle to an asynchronous operation launched by `https://developers.google.com/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync`. |

| ### Functions ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture_acquireresultanchor(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture *future, https://developers.google.com/ar/reference/c/group/ar-anchor#aranchor **out_anchor)` | `void` Gets the resolved Terrain anchor. |
| `https://developers.google.com/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture_getresultterrainanchorstate(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture *future, https://developers.google.com/ar/reference/c/group/ar-anchor#arterrainanchorstate *out_terrain_anchor_state)` | `void` Gets the result status of the resolving operation, if the operation is done. |

## Typedefs

### ArResolveAnchorOnTerrainCallback

```
void(* ArResolveAnchorOnTerrainCallback)(void *context, ArAnchor *anchor, ArTerrainAnchorState terrain_anchor_state)
```
Callback definition for `https://developers.google.com/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync`.

The `context` argument will be the same as that passed to `https://developers.google.com/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync`. The `anchor` argument will be the same as that returned by `https://developers.google.com/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture_acquireresultanchor` and must be released using `https://developers.google.com/ar/reference/c/group/ar-anchor#aranchor_release`. The `terrain_anchor_state` argument will be the same as that returned by `https://developers.google.com/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture_getresultterrainanchorstate`.

It is a best practice to free `context` memory provided to `https://developers.google.com/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync` at the end of the callback implementation.

### ArResolveAnchorOnTerrainFuture

```
struct ArResolveAnchorOnTerrainFuture_ ArResolveAnchorOnTerrainFuture
```
Handle to an asynchronous operation launched by `https://developers.google.com/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync`.

Release with `https://developers.google.com/ar/reference/c/group/ar-future#arfuture_release`. ([reference type, long-lived](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)).

## Functions

### ArResolveAnchorOnTerrainFuture_acquireResultAnchor

```
void ArResolveAnchorOnTerrainFuture_acquireResultAnchor(
  const ArSession *session,
  const ArResolveAnchorOnTerrainFuture *future,
  ArAnchor **out_anchor
)
```
Gets the resolved Terrain anchor.

If the operation isn't done yet or the operation failed, this will be `NULL`. The caller must release the anchor using `https://developers.google.com/ar/reference/c/group/ar-anchor#aranchor_release`.


| Details ||
|---|---|
| Parameters | |---|---| | `session` | The ARCore session. | | `future` | The handle for the asynchronous operation. | | `out_anchor` | The anchor. | |

### ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState

```
void ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState(
  const ArSession *session,
  const ArResolveAnchorOnTerrainFuture *future,
  ArTerrainAnchorState *out_terrain_anchor_state
)
```
Gets the result status of the resolving operation, if the operation is done.


| Details ||
|---|---|
| Parameters | |---|---| | `session` | The ARCore session. | | `future` | The handle for the asynchronous operation. | | `out_terrain_anchor_state` | The result status. | |