AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
List of all members
alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager Class Reference

#include <NoOpPowerResourceManager.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager:
Collaboration graph
[legend]

Public Member Functions

PowerResourceManagerInterface Functions
void acquirePowerResource (const std::string &component, const PowerResourceLevel level=PowerResourceLevel::ACTIVE_HIGH) override
 
void releasePowerResource (const std::string &component) override
 
bool isPowerResourceAcquired (const std::string &component) override
 
std::shared_ptr< PowerResourceIdcreate (const std::string &resourceId, bool isRefCounted=true, const PowerResourceLevel level=PowerResourceLevel::STANDBY_MED) override
 
bool acquire (const std::shared_ptr< PowerResourceId > &id, const std::chrono::milliseconds autoReleaseTimeout=std::chrono::milliseconds::zero()) override
 
bool release (const std::shared_ptr< PowerResourceId > &id) override
 
bool close (const std::shared_ptr< 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)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface
enum  PowerResourceLevel {
  PowerResourceLevel::STANDBY_LOW = 0, PowerResourceLevel::STANDBY_MED, PowerResourceLevel::STANDBY_HIGH, PowerResourceLevel::ACTIVE_LOW,
  PowerResourceLevel::ACTIVE_MED, PowerResourceLevel::ACTIVE_HIGH
}
 
enum  PowerResourceTypeIndex {
  TYPE_CPU = 0, TYPE_DDR, TYPE_STORAGE, TYPE_NETWORK,
  TYPE_RESERVED_ONE, TYPE_RESERVED_TWO, NUM_OF_TYPES
}
 
enum  PowerResourceTypeFlag {
  TYPE_ALL_FLAG = 0, TYPE_CPU_FLAG = 1 << PowerResourceTypeIndex::TYPE_CPU, TYPE_DDR_FLAG = 1 << PowerResourceTypeIndex::TYPE_DDR, TYPE_STORAGE_FLAG = 1 << PowerResourceTypeIndex::TYPE_STORAGE,
  TYPE_NETWORK_FLAG = 1 << PowerResourceTypeIndex::TYPE_NETWORK, TYPE_RESERVED_ONE_FLAG = 1 << PowerResourceTypeIndex::TYPE_RESERVED_ONE, TYPE_RESERVED_TWO_FLAG = 1 << PowerResourceTypeIndex::TYPE_RESERVED_TWO
}
 
using PartialStateBitSet = std::bitset< PowerResourceTypeIndex::NUM_OF_TYPES >
 

Detailed Description

A no-op implemention of the PowerResourceManager to be used for fallback behavior.

Member Function Documentation

◆ acquire()

bool alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager::acquire ( const std::shared_ptr< PowerResourceId > &  id,
const std::chrono::milliseconds  autoReleaseTimeout = std::chrono::milliseconds::zero() 
)
inlineoverridevirtual

Acquire a power resource.

Parameters
idshared pointer of type PowerResourceId representing the resource.
autoReleaseTimeoutauto release timeout value. Zero denotes auto release disabled.
Returns
true if acquire was successful, false if it failed.

Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.

◆ acquirePowerResource()

void alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager::acquirePowerResource ( const std::string &  component,
const PowerResourceLevel  level = PowerResourceLevel::ACTIVE_HIGH 
)
inlineoverridevirtual

Acquire a power resource for the component.

Parameters
componentcomponent name.
levelpower resource level.

Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.

◆ close()

bool alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager::close ( const std::shared_ptr< PowerResourceId > &  id)
inlineoverridevirtual

Close a power resource.

Parameters
idshared pointer of type PowerResourceId representing the resource.
Returns
true if close was successful, false if it failed.

Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.

◆ create()

std::shared_ptr<PowerResourceId> alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager::create ( const std::string &  resourceId,
bool  isRefCounted = true,
const PowerResourceLevel  level = PowerResourceLevel::STANDBY_MED 
)
inlineoverridevirtual

Create a power resource keyed by the unique string resourceId.

Parameters
resourceIdmentions what the resource is for.
isRefCountedwhether refcounting is enabled for this resource
levelpower resource level.
Returns
shared pointer of type PowerResourceId representing the resource

Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.

◆ isPowerResourceAcquired()

bool alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager::isPowerResourceAcquired ( const std::string &  component)
inlineoverridevirtual

Checks whether a power resource had been acquired or not.

Parameters
componentcomponent name.
Returns
true if the power resource had been acquired, otherwise return false.

Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.

◆ release()

bool alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager::release ( const std::shared_ptr< PowerResourceId > &  id)
inlineoverridevirtual

Release a power resource.

Parameters
idshared pointer of type PowerResourceId representing the resource.
Returns
true if release was successful, false if it failed.

Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.

◆ releasePowerResource()

void alexaClientSDK::avsCommon::utils::power::NoOpPowerResourceManager::releasePowerResource ( const std::string &  component)
inlineoverridevirtual

Release the acquired power resource of the specified component.

Parameters
componentcomponent name.

Implements alexaClientSDK::avsCommon::sdkInterfaces::PowerResourceManagerInterface.


The documentation for this class was generated from the following file:

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0