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

#include <SharedPointerCache.h>

Inheritance diagram for alexaClientSDK::acsdkManufactory::internal::SharedPointerCache:
Inheritance graph
Collaboration diagram for alexaClientSDK::acsdkManufactory::internal::SharedPointerCache:
Collaboration graph

Public Member Functions

 SharedPointerCache (std::shared_ptr< AbstractRecipe > recipe)
 ~SharedPointerCache ()
AbstractPointerCache methods.
void * get (RuntimeManufactory &runtimeManufactory) override
void cleanup () override
- Public Member Functions inherited from alexaClientSDK::acsdkManufactory::internal::AbstractPointerCache
virtual ~AbstractPointerCache ()=default

Detailed Description

Class used to cache a shared_ptr to an instance.

Constructor & Destructor Documentation

◆ SharedPointerCache()

alexaClientSDK::acsdkManufactory::internal::SharedPointerCache::SharedPointerCache ( std::shared_ptr< AbstractRecipe recipe)


recipeThe recipe that contains information on the means of producing an instance.

◆ ~SharedPointerCache()

alexaClientSDK::acsdkManufactory::internal::SharedPointerCache::~SharedPointerCache ( )


Member Function Documentation

◆ cleanup()

void alexaClientSDK::acsdkManufactory::internal::SharedPointerCache::cleanup ( )

Release any unneeded references in the cache after calling get().

If get() is called without calling cleanup() afterwards, that may result in memory leaks.

Implements alexaClientSDK::acsdkManufactory::internal::AbstractPointerCache.

◆ get()

void* alexaClientSDK::acsdkManufactory::internal::SharedPointerCache::get ( RuntimeManufactory runtimeManufactory)

Get the instance from the cache.

runtimeManufactoryThe RuntimeManufactory to use to acquire an instance if the cache is empty.
A void* to a shared_ptr<Type>. Caller is responsible for casting this to to shared_ptr<Type>*.

Implements alexaClientSDK::acsdkManufactory::internal::AbstractPointerCache.

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

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