> For the complete documentation index, see [llms.txt](https://docs.medcrypt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.medcrypt.com/ko/guardian/api-overview/api-reference/classes/classmedcrypt-guardian-task.md).

# medcrypt::guardian::Task

멀티스레딩 컨테이너입니다.

`#include <Task.h>`

## 공개 함수

|                                                                                                       | 이름                                                                                                                                                                                                                                                               |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                                                                                       | <p><a href="#function-~task"><strong>\~Task</strong></a>()<br>소멸자입니다.</p>                                                                                                                                                                                        |
| [상태](/ko/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status) | <p><a href="#function-run"><strong>실행</strong></a>()<br>포함된 객체를 실행합니다.</p>                                                                                                                                                                                       |
| [상태](/ko/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status) | <p><a href="#function-getservice"><strong>GetService</strong></a>(std::unique\_ptr< <a href="/ko/guardian/api-overview/api-reference/classes/classmedcrypt-guardian-service.md">Service</a> > \* out\_service)<br>포함된 서비스를 반환합니다.</p>                            |
| [상태](/ko/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status) | <p><a href="#function-getsession"><strong>GetSession</strong></a>(std::unique\_ptr< <a href="/ko/guardian/api-overview/api-reference/classes/classmedcrypt-guardian-session.md">Session</a> > \* out\_session)<br>포함된 세션을 반환합니다.</p>                             |
| [상태](/ko/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status) | <p><a href="#function-getchannelguard"><strong>GetChannelGuard</strong></a>(std::unique\_ptr< <a href="/ko/guardian/api-overview/api-reference/classes/classmedcrypt-guardian-channelguard.md">ChannelGuard</a> > \* out\_channelguard)<br>포함된 채널 가드를 반환합니다.</p> |

## 공개 함수 문서

### 함수 \~Task

```cpp
~Task()
```

소멸자입니다.

**매개변수**:

* **없음**

**반환값**: 없음

소멸자는 포함된 객체를 메인 [Guardian](/ko/guardian/api-overview/api-reference/classes/classmedcrypt-guardian-guardian.md) 스레드를 실행합니다.

### 함수 Run

```cpp
Status Run()
```

포함된 객체를 실행합니다.

**매개변수**:

* **없음**

**반환값**:

* **OK** 포함된 객체가 성공적으로 실행되었습니다
* **FAIL** 일반 오류
* **SHUTDOWN** 포함된 객체가 종료되었습니다

**반환값**: [medcrypt::guardian::Status](/ko/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status)

이 Run 호출은 스레드의 메인 루프에서 호출해야 합니다.

### 함수 GetService

```cpp
Status GetService(
    std::unique_ptr< Service > * out_service
)
```

포함된 서비스를 반환합니다.

**매개변수**:

* **out\_service** 포함된 서비스의 unique\_ptr 저장소를 가리키는 포인터

**반환값**:

* **OK** out\_service의 포인터가 유효합니다
* **FAIL** 일반 오류
* **BADPARAM** out\_service가 nullptr입니다
* **MISCONFIGURED** 작업에 서비스가 포함되어 있지 않습니다

**반환값**: [medcrypt::guardian::Status](/ko/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status)

### 함수 GetSession

```cpp
Status GetSession(
    std::unique_ptr< Session > * out_session
)
```

포함된 세션을 반환합니다.

**매개변수**:

* **out\_session** 포함된 세션의 unique\_ptr 저장소를 가리키는 포인터

**반환값**:

* **OK** out\_session의 포인터가 유효합니다
* **FAIL** 일반 오류
* * **BADPARAM** out\_session이 nullptr입니다
  * **MISCONFIGURED** 작업에 세션이 포함되어 있지 않습니다

**반환값**: [medcrypt::guardian::Status](/ko/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status)

### 함수 GetChannelGuard

```cpp
Status GetChannelGuard(
    std::unique_ptr< ChannelGuard > * out_channelguard
)
```

포함된 channelguard를 반환합니다.

**매개변수**:

* **out\_channelguard** 포함된 channelguard의 unique\_ptr 저장소에 대한 포인터

**반환값**:

* **OK** out\_channelguard의 포인터가 유효합니다
* **FAIL** 일반 오류
* **BADPARAM** out\_channelguard가 nullptr입니다
* **MISCONFIGURED** 작업에 channelguard가 포함되어 있지 않습니다

**반환값**: [medcrypt::guardian::Status](/ko/guardian/api-overview/api-reference/namespaces/namespacemedcrypt-guardian.md#typedef-status)

## 디버깅 및 로깅

Guardian은 로그 파일을 생성하지 않습니다. 대신 로깅은 애플리케이션에서 제어합니다.

* Guardian은 로그를 다음으로 출력합니다: `stdout` 및 `stderr`이러한 로그는 실행 중인 애플리케이션의 터미널/CLI에 표시됩니다. 출력에서 특정 오류 코드나 연결 실패를 확인하세요.
* **사용자 지정 로깅:** 다음을 사용하여 `SetLoggingCallback` 로그 메시지를 콜백 함수로 리디렉션할 수 있습니다. 이렇게 하면 터미널 출력이 중단되고 사용자 지정 로그 처리가 가능해집니다.
* **로그 제어:** 애플리케이션에서 로그 수준과 상세도를 제어할 수 있습니다.
* **Guardian Cloud UI**: Guardian Cloud 인터페이스에서 추가 오류 세부 정보와 프로비저닝 상태를 확인하세요.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.medcrypt.com/ko/guardian/api-overview/api-reference/classes/classmedcrypt-guardian-task.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
