Shopify SDK for Unity
Public Member Functions | Properties | List of all members
Shopify.UIToolkit.Cache< T > Interface Template Reference

An interface for defining a cache. More...

Inheritance diagram for Shopify.UIToolkit.Cache< T >:
Shopify.UIToolkit.LRUCache< T >

Public Member Functions

void SetMemorySizeLimit (int newLimit)
 Sets the size limit in bytes that we can store in the cache. More...
 
ResourceForKey (string key)
 Returns the cached resource saved against the given url. More...
 
void SetResourceForKey (string key, T resource)
 Associates the given key with the given resource in the cache. More...
 
void RemoveKey (string key)
 Removes the key and associated resource instance from the cache. More...
 
void Clear ()
 Clears the cache. More...
 

Properties

int MemorySizeLimit [get]
 The estimated size limit in bytes of how much memory we want to use for the cache (readonly). More...
 
int EstimatedMemorySize [get]
 The current estimated size the cache takes up in memory (readonly). More...
 
int Count [get]
 Returns the number of entries in the cache (readonly). More...
 

Detailed Description

An interface for defining a cache.

Member Function Documentation

◆ Clear()

void Shopify.UIToolkit.Cache< T >.Clear ( )

Clears the cache.

Implemented in Shopify.UIToolkit.LRUCache< T >.

◆ RemoveKey()

void Shopify.UIToolkit.Cache< T >.RemoveKey ( string  key)

Removes the key and associated resource instance from the cache.

Parameters
keyKey to remove from the cache.

Implemented in Shopify.UIToolkit.LRUCache< T >.

◆ ResourceForKey()

T Shopify.UIToolkit.Cache< T >.ResourceForKey ( string  key)

Returns the cached resource saved against the given url.

Parameters
keyKey mapping to a resource.
Returns
The cached resource associated with the given key.

Implemented in Shopify.UIToolkit.LRUCache< T >.

◆ SetMemorySizeLimit()

void Shopify.UIToolkit.Cache< T >.SetMemorySizeLimit ( int  newLimit)

Sets the size limit in bytes that we can store in the cache.

Parameters
newLimitNew size limit in bytes.

Implemented in Shopify.UIToolkit.LRUCache< T >.

◆ SetResourceForKey()

void Shopify.UIToolkit.Cache< T >.SetResourceForKey ( string  key,
resource 
)

Associates the given key with the given resource in the cache.

Parameters
keyKey to cache with.
resourceA resource to cache in memory.

Implemented in Shopify.UIToolkit.LRUCache< T >.

Property Documentation

◆ Count

int Shopify.UIToolkit.Cache< T >.Count
get

Returns the number of entries in the cache (readonly).

Returns
Number of entries in the cache.

◆ EstimatedMemorySize

int Shopify.UIToolkit.Cache< T >.EstimatedMemorySize
get

The current estimated size the cache takes up in memory (readonly).

Returns

◆ MemorySizeLimit

int Shopify.UIToolkit.Cache< T >.MemorySizeLimit
get

The estimated size limit in bytes of how much memory we want to use for the cache (readonly).

Returns

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