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::acsdkManufactory::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
 
 Annotated (Type *value)
 
 Annotated (const std::shared_ptr< Type > &value)
 
 Annotated (std::shared_ptr< Type > &&value)
 
void reset ()
 
Type * get () const
 
Type & operator* () const
 
Type * operator-> () const
 
 operator std::shared_ptr< Type > () const
 
 operator bool () const
 

Detailed Description

template<typename Annotation, typename Type>
struct alexaClientSDK::acsdkManufactory::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::acsdkManufactory::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::acsdkManufactory::Annotated< Annotation, Type >::Annotated ( )
default

Constructor.

◆ Annotated() [2/4]

template<typename Annotation , typename Type>
alexaClientSDK::acsdkManufactory::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>
alexaClientSDK::acsdkManufactory::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>
alexaClientSDK::acsdkManufactory::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 >
Type * alexaClientSDK::acsdkManufactory::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 >
alexaClientSDK::acsdkManufactory::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 >
alexaClientSDK::acsdkManufactory::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 >
Type & alexaClientSDK::acsdkManufactory::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 >
Type * alexaClientSDK::acsdkManufactory::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 >
void alexaClientSDK::acsdkManufactory::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