> 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::ServiceKey

> Key structure for service registry that combines type and identifier.

Key structure for service registry that combines type and identifier.

`ServiceKey` uniquely identifies a service in the fragment's service registry by combining the type information with an optional string identifier. This allows multiple instances of the same service type to coexist with different identifiers.

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

***

## Methods

### operator== \[#operator\_eq]

```cpp showLineNumbers={false}
bool holoscan::ServiceKey::operator==(
    const ServiceKey &other
) const noexcept
```

Equality comparison operator.

Two ServiceKeys are equal if both their type and id match.

**Returns:** true if the keys are equal, false otherwise.

**Parameters**

The `ServiceKey` to compare with.

***

## Member variables

| Name   | Type              | Description                                                   |
| ------ | ----------------- | ------------------------------------------------------------- |
| `type` | `std::type_index` | Type information of the service.                              |
| `id`   | `std::string`     | Service identifier (empty string indicates default instance). |