AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <AggregatedPowerResourceManager.h>
Public Member Functions | |
virtual | ~AggregatedPowerResourceManager () |
Destructor. More... | |
PowerResourceManagerInterface Legacy Methods | |
void | acquirePowerResource (const std::string &component, const PowerResourceLevel level=PowerResourceLevel::STANDBY_MED) override |
void | releasePowerResource (const std::string &component) override |
bool | isPowerResourceAcquired (const std::string &component) override |
std::shared_ptr< avsCommon::sdkInterfaces::PowerResourceManagerInterface::PowerResourceId > | create (const std::string &resourceId, bool isRefCounted=true, const PowerResourceLevel level=PowerResourceLevel::STANDBY_MED) override |
bool | acquire (const std::shared_ptr< avsCommon::sdkInterfaces::PowerResourceManagerInterface::PowerResourceId > &id, const std::chrono::milliseconds autoReleaseTimeout=std::chrono::milliseconds::zero()) override |
bool | release (const std::shared_ptr< avsCommon::sdkInterfaces::PowerResourceManagerInterface::PowerResourceId > &id) override |
bool | close (const std::shared_ptr< avsCommon::sdkInterfaces::PowerResourceManagerInterface::PowerResourceId > &id) override |
Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface | |
virtual | ~PowerResourceManagerInterface ()=default |
virtual std::chrono::milliseconds | getTimeSinceLastResumeMS () |
virtual std::chrono::milliseconds | getTimeSinceLastPartialMS (const std::string &component, PartialStateBitSet &resourceFlags, PartialStateBitSet partialState=PowerResourceTypeFlag::TYPE_ALL_FLAG) |
virtual bool | acquire (const std::shared_ptr< PowerResourceId > &id, const std::chrono::milliseconds autoReleaseTimeout=std::chrono::milliseconds::zero())=0 |
virtual bool | release (const std::shared_ptr< PowerResourceId > &id)=0 |
virtual bool | close (const std::shared_ptr< PowerResourceId > &id)=0 |
Static Public Member Functions | |
static std::shared_ptr< AggregatedPowerResourceManager > | create (std::shared_ptr< avsCommon::sdkInterfaces::PowerResourceManagerInterface > powerResourceManager) |
An AVS SDK implementation of PowerResourceManagerInterface
which aggregates calls to the application provided PowerResourceManagerInterface
. This implementation creates a PowerResourceManagerInterface::PowerResourceId
for each PowerResourceLevel
, and maps acquire/release/etc calls down to each level-aggregated PowerResourceId
.
This reduces the number of resources that are created from the perspective of the application provided PowerResourceManagerInterface
. Additionally, it allows optimizations (such as deduping calls to reference counted resources) to be more effective.
To reduce latency associated with create/close, aggregated PowerResourceIds are not closed dynamically, and will persist for the lifetime of the AggregatedPowerResourceManager
.
This class does not aggregate the acquirePowerResource/releasePowerResource related APIs.
|
virtual |
Destructor.
|
override |
|
overridevirtual |
Acquire a power resource for the component.
component | component name. |
level | power resource level. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.
|
override |
|
static |
Create an instance of this class.
powerResourceManager | The application provided PowerResourceManagerInterface . |
|
overridevirtual |
Create a power resource keyed by the unique string resourceId.
resourceId | mentions what the resource is for. |
isRefCounted | whether refcounting is enabled for this resource |
level | power resource level. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.
|
overridevirtual |
Checks whether a power resource had been acquired or not.
component | component name. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.
|
override |
|
overridevirtual |
Release the acquired power resource of the specified component.
component | component name. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::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