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::AbstractPointerCache Class Referenceabstract

#include <AbstractPointerCache.h>

Inheritance diagram for alexaClientSDK::acsdkManufactory::internal::AbstractPointerCache:
Inheritance graph
[legend]

Public Member Functions

virtual ~AbstractPointerCache ()=default
 
virtual void * get (RuntimeManufactory &runtimeManufactory)=0
 
virtual void cleanup ()=0
 

Detailed Description

Common parent class for an object used to cache an instance.

Constructor & Destructor Documentation

◆ ~AbstractPointerCache()

virtual alexaClientSDK::acsdkManufactory::internal::AbstractPointerCache::~AbstractPointerCache ( )
virtualdefault

Destructor.

Member Function Documentation

◆ cleanup()

virtual void alexaClientSDK::acsdkManufactory::internal::AbstractPointerCache::cleanup ( )
pure virtual

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

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

Implemented in alexaClientSDK::acsdkManufactory::internal::SharedPointerCache, and alexaClientSDK::acsdkManufactory::internal::WeakPointerCache.

◆ get()

virtual void* alexaClientSDK::acsdkManufactory::internal::AbstractPointerCache::get ( RuntimeManufactory runtimeManufactory)
pure virtual

Get the instance from the cache.

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

Implemented in alexaClientSDK::acsdkManufactory::internal::SharedPointerCache, and alexaClientSDK::acsdkManufactory::internal::WeakPointerCache.


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