AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <PowerResource.h>
Public Member Functions | |
~PowerResource () | |
std::string | getId () const |
bool | isRefCounted () const |
bool | isFrozen () const |
sdkInterfaces::PowerResourceManagerInterface::PowerResourceLevel | getLevel () const |
void | acquire () |
void | release () |
void | freeze () |
void | thaw () |
Static Public Member Functions | |
static std::shared_ptr< PowerResource > | create (const std::string &identifier, std::shared_ptr< sdkInterfaces::PowerResourceManagerInterface > powerManager, sdkInterfaces::PowerResourceManagerInterface::PowerResourceLevel level=sdkInterfaces::PowerResourceManagerInterface::PowerResourceLevel::STANDBY_MED, bool refCounted=true) |
Static Public Attributes | |
static constexpr const char * | PREFIX = "ACSDK_" |
An object representing a configuration of power level preferences.
Behavior is undefined if direct calls are made to PowerResourceManagerInterface
using the same component identifier as one associated with a PowerResource
object.
alexaClientSDK::avsCommon::utils::power::PowerResource::~PowerResource | ( | ) |
Destructor. This will release all acquired instances.
void alexaClientSDK::avsCommon::utils::power::PowerResource::acquire | ( | ) |
Acquire a count of the resource.
|
static |
Creates an instance of the PowerResource
.
identifier | The identifier. This identifier must be unique across all instances, as it will be used to call the underlying PowerResourceManagerInterface . This will be prefixed internally with ACSDK_ to maintain uniqueness within PowerResourceManagerInterface . |
powerManager | A pointer to the underlying PowerResourceManagerInterface . |
level | The level to create this resource with. |
refCounted | Whether refcounting is enabled. |
void alexaClientSDK::avsCommon::utils::power::PowerResource::freeze | ( | ) |
Freezes the resource, and caches the current refcount. Any calls to acquire or release will no-op while the PowerResource
is frozen.
std::string alexaClientSDK::avsCommon::utils::power::PowerResource::getId | ( | ) | const |
Returns the id. This will equal the identifier passed into the constructor without the internal prefix.
sdkInterfaces::PowerResourceManagerInterface::PowerResourceLevel alexaClientSDK::avsCommon::utils::power::PowerResource::getLevel | ( | ) | const |
Get the current level.
bool alexaClientSDK::avsCommon::utils::power::PowerResource::isFrozen | ( | ) | const |
Returns whether the current resource is frozen.
bool alexaClientSDK::avsCommon::utils::power::PowerResource::isRefCounted | ( | ) | const |
Returns whether the current resource is refCounted.
void alexaClientSDK::avsCommon::utils::power::PowerResource::release | ( | ) |
Release a count of the resource.
void alexaClientSDK::avsCommon::utils::power::PowerResource::thaw | ( | ) |
Thaws the resource, and re-acquires the amount of times the resource has been acquired.
|
static |
Prefix that will be internally appended before calling PowerResourceManagerInterface
.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0