medcrypt::guardian::Task

Multithreading container.

#include <Task.h>

Public Functions

Name

~Task() The destructor.

Run() Runs the contained object.

GetService(std::unique_ptr< Service > * out_service) Returns the contained service.

GetSession(std::unique_ptr< Session > * out_session) Returns the contained session.

GetChannelGuard(std::unique_ptr< ChannelGuard > * out_channelguard) Returns the contained channelguard.

Public Functions Documentation

function ~Task

~Task()

The destructor.

Parameters:

  • none

Return: none

The destructor will return the contained object to the main Guardian Run thread.

function Run

Runs the contained object.

Parameters:

  • none

Returns:

  • OK contained object ran successfully

  • FAIL general failure

  • SHUTDOWN the contained object is shutdown

Return: medcrypt::guardian::Statusarrow-up-right

This run call should be called by the thread's main loop.

function GetService

Returns the contained service.

Parameters:

  • out_service pointer to unique_ptr storage for contained service

Returns:

  • OK the pointer in out_service is valid

  • FAIL general failure

  • BADPARAM out_service is nullptr

  • MISCONFIGURED the task does not contain a service

Return: medcrypt::guardian::Statusarrow-up-right

function GetSession

Returns the contained session.

Parameters:

  • out_session pointer to unique_ptr storage for contained session

Returns:

  • OK the pointer in out_session is valid

  • FAIL general failure

    • BADPARAM out_session is nullptr

    • MISCONFIGURED the task does not contain a session

Return: medcrypt::guardian::Statusarrow-up-right

function GetChannelGuard

Returns the contained channelguard.

Parameters:

  • out_channelguard pointer to unique_ptr storage for contained channelguard

Returns:

  • OK the pointer in out_channelguard is valid

  • FAIL general failure

  • BADPARAM out_channelguard is nullptr

  • MISCONFIGURED the task does not contain a channelguard

Return: medcrypt::guardian::Statusarrow-up-right

Debugging and logging

Guardian does not create log files. Instead, logging is controlled by the application:

  • Guardian logs to stdout and stderr, which appear in the terminal/CLI of the running application during execution. Look for specific error codes or connection failures in the output.

  • Custom logging: Use SetLoggingCallback to redirect log messages to a callback function, stopping terminal output and allowing custom log handling

  • Log control: Applications can control log level and verbosity.

  • Guardian Cloud UI: Check the Guardian Cloud interface for additional error details and provisioning status.

Last updated