AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Types | Public Member Functions | List of all members
alexaClientSDK::sdkClient::Annotated< Annotation, Type > Struct Template Reference

#include <Annotated.h>

Public Types

using element_type = Type
 The underlying type that is being annotated. More...
 

Public Member Functions

 Annotated ()=default
 
ACSDK_INLINE_VISIBILITY Annotated (Type *value)
 
ACSDK_INLINE_VISIBILITY Annotated (const std::shared_ptr< Type > &value)
 
ACSDK_INLINE_VISIBILITY Annotated (std::shared_ptr< Type > &&value)
 
ACSDK_INLINE_VISIBILITY void reset ()
 
ACSDK_INLINE_VISIBILITY Type * get () const
 
ACSDK_INLINE_VISIBILITY Type & operator* () const
 
ACSDK_INLINE_VISIBILITY Type * operator-> () const
 
ACSDK_INLINE_VISIBILITY operator std::shared_ptr< Type > () const
 
ACSDK_INLINE_VISIBILITY operator bool () const
 

Detailed Description

template<typename Annotation, typename Type>
struct alexaClientSDK::sdkClient::Annotated< Annotation, Type >

Annotated is a shared_ptr wrapper used to define a shared_ptr to a Type where the type of the wrapper is distinguished by an Annotation type. You can use this when you have multiple instances of the same interface but want to identify or distinguish them by type rather than the underlying pointer value.

Template Parameters
AnnotationA type used to flavor the template instantiation. This is typically an empty struct definition, where just the name of the struct is used to distinguish types.
TypeThe underlying type that the Annotated shared_ptr refers to.

Member Typedef Documentation

◆ element_type

template<typename Annotation, typename Type>
using alexaClientSDK::sdkClient::Annotated< Annotation, Type >::element_type = Type

The underlying type that is being annotated.

Constructor & Destructor Documentation

◆ Annotated() [1/4]

template<typename Annotation, typename Type>
alexaClientSDK::sdkClient::Annotated< Annotation, Type >::Annotated ( )
default

Constructor.

◆ Annotated() [2/4]

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY alexaClientSDK::sdkClient::Annotated< Annotation, Type >::Annotated ( Type *  value)
inline

Create an Annotated<> instance from a pointer to the underlying Type. The resulting instance of Annotated takes ownership of the pointer.

Parameters
valueA pointer to an instance of the underlying Type.

◆ Annotated() [3/4]

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY alexaClientSDK::sdkClient::Annotated< Annotation, Type >::Annotated ( const std::shared_ptr< Type > &  value)
inline

Create from a shared_ptr to an instance underlying Type.

Parameters
valueA shared_ptr to an instance underlying Type.

◆ Annotated() [4/4]

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY alexaClientSDK::sdkClient::Annotated< Annotation, Type >::Annotated ( std::shared_ptr< Type > &&  value)
inline

Create from a shared_ptr to an instance underlying Type.

Parameters
valueA shared_ptr to an instance underlying Type.

Member Function Documentation

◆ get()

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY Type * alexaClientSDK::sdkClient::Annotated< Annotation, Type >::get ( ) const
inline

Get a naked pointer to the underlying instance.

Returns
A naked pointer to the underlying instance.

◆ operator bool()

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY alexaClientSDK::sdkClient::Annotated< Annotation, Type >::operator bool ( ) const
inlineexplicit

Return true if the pointer is non-null.

Returns
True if the pointer is non-null.

◆ operator std::shared_ptr< Type >()

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY alexaClientSDK::sdkClient::Annotated< Annotation, Type >::operator std::shared_ptr< Type > ( ) const
inline

Convert to a shared_ptr to the underlying instance.

Returns
A shared_ptr to the underlying instance.

◆ operator*()

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY Type & alexaClientSDK::sdkClient::Annotated< Annotation, Type >::operator* ( ) const
inline

Get a reference to the underlying instance.

Returns
A reference to the underlying instance.

◆ operator->()

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY Type * alexaClientSDK::sdkClient::Annotated< Annotation, Type >::operator-> ( ) const
inline

Get a naked pointer to the underlying instance.

Returns
A naked pointer to the underlying instance.

◆ reset()

template<typename Annotation , typename Type >
ACSDK_INLINE_VISIBILITY void alexaClientSDK::sdkClient::Annotated< Annotation, Type >::reset ( )
inline

Release this reference to the underlying instance.


The documentation for this struct 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