---
title: "ClikaRT::ProfileSession::CaptureScope"
sidebar_label: "ProfileSession::CaptureScope"
description: "RAII capture handle. While alive, work on the constructing thread (and its live streams) is profiled into the parent session. End the capture by letting this go out of scope."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--class">class</span>

**Header:** `ClikaRT/profiler/profiler.h`

RAII capture handle. While alive, work on the constructing thread (and its live streams) is profiled into the parent session. End the capture by letting this go out of scope. Move-only; keep it alive for the region you want timed.

## Member functions

### CaptureScope() {#CaptureScope}

<div class="api-signature">

**`CaptureScope`**(`CaptureScope&&`) `noexcept`

</div>

Move-only: transfers the capture.

<div class="api-declared">

Declared in `ClikaRT/profiler/profiler.h`, line 139

</div>

### operator=() {#operator-assign}

<div class="api-signature">

[`CaptureScope`](./ProfileSession.CaptureScope.md)`&` **`operator=`**([`CaptureScope`](./ProfileSession.CaptureScope.md)`&&`) `noexcept`

</div>

Move-assign: transfers the capture.

<div class="api-declared">

Declared in `ClikaRT/profiler/profiler.h`, line 141

</div>

### \~CaptureScope() {#CaptureScope-2}

<div class="api-signature">

**`~CaptureScope`**()

</div>

Ends the capture (RAII exit).

<div class="api-declared">

Declared in `ClikaRT/profiler/profiler.h`, line 143

</div>

### add\_marker() {#add_marker}

<div class="api-signature">

`void` **`add_marker`**(`std::string_view` `label`)

</div>

Drop a named marker into the timeline at this point (renders as an instant event in the Chrome/Perfetto trace). `label` is copied.

<div class="api-declared">

Declared in `ClikaRT/profiler/profiler.h`, line 147

</div>
