AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <Optional.h>
Public Member Functions | |||
Optional () | |||
Optional (const ValueT &value) | |||
Optional (const Optional< ValueT > &other) | |||
void | set (const ValueT &value) | ||
void | reset () | ||
bool | hasValue () const | ||
ValueT | valueOr (const ValueT &other) const | ||
ValueT | value () const | ||
~Optional () | |||
Optional< ValueT > & | operator= (const Optional< ValueT > &rhs) | ||
bool | operator== (const Optional< ValueT > &rhs) const | ||
bool | operator!= (const Optional< ValueT > &rhs) const | ||
Comparison operators. | |||
Compare the current optional object against a second optional.
| |||
bool | operator< (const Optional &rhs) const | ||
bool | operator> (const Optional &rhs) const | ||
bool | operator<= (const Optional &rhs) const | ||
bool | operator>= (const Optional &rhs) const | ||
Auxiliary class that implements an optional object, where the value may or may not be present.
ValueT
MUST have a copy constructor. value()
is available only for ValueT
types that have a default constructor. alexaClientSDK::avsCommon::utils::Optional< ValueT >::Optional | ( | ) |
Creates an optional object with no valid value.
alexaClientSDK::avsCommon::utils::Optional< ValueT >::Optional | ( | const ValueT & | value | ) |
Creates an optional object with a valid value.
value | Object used to initialize the new optional value. |
ValueT
to have a copy constructor is available. alexaClientSDK::avsCommon::utils::Optional< ValueT >::Optional | ( | const Optional< ValueT > & | other | ) |
Copy constructor.
other | Object used to initialize the new optional object. |
alexaClientSDK::avsCommon::utils::Optional< ValueT >::~Optional | ( | ) |
Optional destructor.
bool alexaClientSDK::avsCommon::utils::Optional< ValueT >::hasValue | ( | ) | const |
Checks whether the optional contains a value or not.
bool alexaClientSDK::avsCommon::utils::Optional< ValueT >::operator!= | ( | const Optional< ValueT > & | rhs | ) | const |
Inequality operator.
rhs | The object to compare *this against. |
true
if only one object holds a value, and false
if both objects don't hold a value. If both optionals hold valid values, return the result of operator!= for their values. bool alexaClientSDK::avsCommon::utils::Optional< ValueT >::operator< | ( | const Optional< ValueT > & | rhs | ) | const |
bool alexaClientSDK::avsCommon::utils::Optional< ValueT >::operator<= | ( | const Optional< ValueT > & | rhs | ) | const |
Optional< ValueT > & alexaClientSDK::avsCommon::utils::Optional< ValueT >::operator= | ( | const Optional< ValueT > & | rhs | ) |
Assignment operator.
rhs | The optional object source of the assignment. |
*this
. bool alexaClientSDK::avsCommon::utils::Optional< ValueT >::operator== | ( | const Optional< ValueT > & | rhs | ) | const |
Equality operator.
rhs | The object to compare *this against. |
true
if both objects don't hold a value, and false
if only one object holds a value. If both optionals hold valid values, return the result of operator== for their values. bool alexaClientSDK::avsCommon::utils::Optional< ValueT >::operator> | ( | const Optional< ValueT > & | rhs | ) | const |
bool alexaClientSDK::avsCommon::utils::Optional< ValueT >::operator>= | ( | const Optional< ValueT > & | rhs | ) | const |
void alexaClientSDK::avsCommon::utils::Optional< ValueT >::reset | ( | ) |
Modifies the optional object so it no longer holds any valid value.
void alexaClientSDK::avsCommon::utils::Optional< ValueT >::set | ( | const ValueT & | value | ) |
Sets optional value to the given ValueT.
value | Object that will be assigned to the optional value. |
ValueT alexaClientSDK::avsCommon::utils::Optional< ValueT >::value | ( | ) | const |
Gets the value if present or return other. ValueT
must have a default constructor.
m_object
is valid; otherwise, return ValueT()
. ValueT alexaClientSDK::avsCommon::utils::Optional< ValueT >::valueOr | ( | const ValueT & | other | ) | const |
Gets the value if present or return other. ValueT
must have a copy constructor.
other | Object that will be returned if this optional does not hold a value. |
other
. AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0