AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToRangeMapping Class Reference

#include <StatesToRangeMapping.h>

Public Member Functions

 StatesToRangeMapping ()
 
bool addState (const std::string &stateId)
 
bool setRange (double minValue, double maxValue)
 
bool isValid () const
 
std::string toJson () const
 

Detailed Description

This class represents a "StatesToRange" type "stateMapping" in a semantic annotation for a capability primitive.

See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/capability-primitives.html#semantic-annotation
Note
This mapping may only be used if the corresponding CapabilitySemantics belongs to a RangeController capability instance.

Constructor & Destructor Documentation

◆ StatesToRangeMapping()

alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToRangeMapping::StatesToRangeMapping ( )

The constructor.

Member Function Documentation

◆ addState()

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToRangeMapping::addState ( const std::string &  stateId)

Adds the specified state identifier to the "states" array of this mapping object. The state identifier represents utterances that correspond to the range specified in setRange().

Note
See the class-level link for supported state identifiers.
Parameters
statesThe identifier of the state to add to the "states" array.
Returns
true if the state was successfully added, else false.

◆ isValid()

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToRangeMapping::isValid ( ) const

Checks whether this StatesToRangeMapping is valid.

Returns
true if valid, else false.

◆ setRange()

bool alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToRangeMapping::setRange ( double  minValue,
double  maxValue 
)

Sets the range used in this state mapping.

Note
The minValue and maxValue of the range must be within minimumValue and maximumValue configured in configuration.supportedRange for this RangeController instance.
Parameters
minValueThe minimum value of the range mapped to the state(s).
maxValueThe minimum value of the range mapped to the state(s).
Returns
true if the value was successfully set, else false.

◆ toJson()

std::string alexaClientSDK::avsCommon::avs::capabilitySemantics::StatesToRangeMapping::toJson ( ) const

Converts this StatesToRangeMapping to a JSON string.

Note
This follows the AVS discovery message format.
Returns
A JSON string of this StatesToRangeMapping.

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