> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::gxf::GXFWrapper

> Class to wrap an Operator into a GXF Codelet.

Class to wrap an [Operator](../../../classes/operator) into a GXF Codelet.

```cpp showLineNumbers={false}
#include <holoscan/gxf/gxf_wrapper.hpp>
```

**Inherits from:** `nvidia::gxf::Codelet` (public)

---

## Constructors

### Destructor \[#destructor]

### \~GXFWrapper

```cpp showLineNumbers={false}
virtual holoscan::gxf::GXFWrapper::~GXFWrapper() = default
```

---

## Methods

### initialize \[#initialize]

```cpp showLineNumbers={false}
gxf_result_t holoscan::gxf::GXFWrapper::initialize() override
```

### deinitialize \[#deinitialize]

```cpp showLineNumbers={false}
gxf_result_t holoscan::gxf::GXFWrapper::deinitialize() override
```

### registerInterface \[#registerinterface]

```cpp showLineNumbers={false}
gxf_result_t holoscan::gxf::GXFWrapper::registerInterface(
    nvidia::gxf::Registrar *registrar
) override
```

### start \[#start]

```cpp showLineNumbers={false}
gxf_result_t holoscan::gxf::GXFWrapper::start() override
```

### tick \[#tick]

```cpp showLineNumbers={false}
gxf_result_t holoscan::gxf::GXFWrapper::tick() override
```

### stop \[#stop]

```cpp showLineNumbers={false}
gxf_result_t holoscan::gxf::GXFWrapper::stop() override
```

### set\_operator \[#setoperator]

```cpp showLineNumbers={false}
void holoscan::gxf::GXFWrapper::set_operator(
    Operator *op
)
```

Set the [Operator](../../../classes/operator) object to be wrapped.

**Parameters**

**`op`** `Operator *`

The pointer to the [Operator](../../../classes/operator) object.

---

### op \[#op]

```cpp showLineNumbers={false}
Operator * holoscan::gxf::GXFWrapper::op() const
```

Get the [Operator](../../../classes/operator) object.

**Returns:** The pointer to the [Operator](../../../classes/operator) object.

### execution\_context \[#executioncontext]

```cpp showLineNumbers={false}
GXFExecutionContext * holoscan::gxf::GXFWrapper::execution_context() const
```

Get the [ExecutionContext](../../../classes/executioncontext) object.

**Returns:** The pointer to the [ExecutionContext](../../../classes/executioncontext) object.

### input\_context \[#inputcontext]

```cpp showLineNumbers={false}
InputContext * holoscan::gxf::GXFWrapper::input_context() const
```

Get the [InputContext](../../../classes/inputcontext) object.

**Returns:** The pointer to the [InputContext](../../../classes/inputcontext) object.

### output\_context \[#outputcontext]

```cpp showLineNumbers={false}
OutputContext * holoscan::gxf::GXFWrapper::output_context() const
```

Get the [OutputContext](../../../classes/outputcontext) object.

**Returns:** The pointer to the [OutputContext](../../../classes/outputcontext) object.

### store\_exception \[#storeexception]

```cpp showLineNumbers={false}
void holoscan::gxf::GXFWrapper::store_exception()
```

### initialize\_contexts \[#initializecontexts]

```cpp showLineNumbers={false}
void holoscan::gxf::GXFWrapper::initialize_contexts()
```

Initialize the local contexts (input/output/execution) for the operator.

### create\_post\_compute\_nvtx\_range \[#createpostcomputenvtxrange]

```cpp showLineNumbers={false}
void holoscan::gxf::GXFWrapper::create_post_compute_nvtx_range()
```

Create post-compute NVTX child range with frame information.

### is\_root\_operator \[#isrootoperator]

```cpp showLineNumbers={false}
bool holoscan::gxf::GXFWrapper::is_root_operator() const
```

Check if the current operator is a root operator.

### get\_root\_operator\_frame\_info \[#getrootoperatorframeinfo]

```cpp showLineNumbers={false}
std::string holoscan::gxf::GXFWrapper::get_root_operator_frame_info() const
```

Get frame information string for root operators.

### get\_non\_root\_operator\_frame\_info \[#getnonrootoperatorframeinfo]

```cpp showLineNumbers={false}
std::string holoscan::gxf::GXFWrapper::get_non_root_operator_frame_info() const
```

Get frame information string for non-root operators.

---

## Member variables

| Name            | Type                    | Description                                                      |
| --------------- | ----------------------- | ---------------------------------------------------------------- |
| `op_`           | `Operator *`            |                                                                  |
| `exec_context_` | `GXFExecutionContext *` | The execution context of the operator. Copied from the operator. |
| `op_input_`     | `InputContext *`        | The input context of the operator. Copied from the operator.     |
| `op_output_`    | `OutputContext *`       | The output context of the operator. Copied from the operator.    |