Loading...
Searching...
No Matches
Public Member Functions | List of all members
bitpit::LevelSetCacheCollection< key_t >::Item Interface Reference

The class LevelSetCacheCollection::Item defines the items stored in a cache collection. Each item stores the cache and the factory that will be used to create the cache. More...

Public Member Functions

 Item (const Item &other)
 
 Item (const std::shared_ptr< LevelSetCacheFactory< key_t > > &factory=nullptr)
 
 Item (Item &&other)=default
 
LevelSetCache< key_t > * createCache ()
 
void destroyCache ()
 
LevelSetCache< key_t > * getCache (bool allowCreation=true)
 
template<typename value_t >
LevelSetValueCache< key_t, value_t > * getCache (bool allowCreation=true)
 
const LevelSetCache< key_t > * getCache (bool allowCreation=true) const
 
template<typename value_t >
const LevelSetValueCache< key_t, value_t > * getCache (bool allowCreation=true) const
 
bool hasCache () const
 
bool hasFactory () const
 
Itemoperator= (const Item &other)
 
Itemoperator= (Item &&other)=default
 

Detailed Description

template<typename key_t>
interface bitpit::LevelSetCacheCollection< key_t >::Item

The class LevelSetCacheCollection::Item defines the items stored in a cache collection. Each item stores the cache and the factory that will be used to create the cache.

Definition at line 593 of file levelSetCache.hpp.

Constructor & Destructor Documentation

◆ Item()

template<typename key_t >
bitpit::LevelSetCacheCollection< key_t >::Item::Item ( const std::shared_ptr< LevelSetCacheFactory< key_t > > & factory = nullptr)

Constructor.

Parameters
factoryis the factory that will be used to create the cache

Definition at line 1462 of file levelSetCache.tpp.

Member Function Documentation

◆ createCache()

template<typename key_t >
LevelSetCache< key_t > * bitpit::LevelSetCacheCollection< key_t >::Item::createCache ( )

Create the cache associated with the item.

If the cache has been previously created, the existing cache will be returned. If no factory has been set for the item, a null pointer is returned.

Returns
Return a pointer to the newly created cache.

Definition at line 1527 of file levelSetCache.tpp.

◆ destroyCache()

template<typename key_t >
void bitpit::LevelSetCacheCollection< key_t >::Item::destroyCache ( )

Destroy the cache associated with the item.

Definition at line 1563 of file levelSetCache.tpp.

◆ getCache() [1/4]

template<typename key_t >
LevelSetCache< key_t > * bitpit::LevelSetCacheCollection< key_t >::Item::getCache ( bool allowCreation = true)

Get a pointer to the cache owned by the item.

Parameters
allowCreationcontrols the behaviour when the cache has not yet been created, if the argument is set to true, the item will create a new cache from scratch, otherwise a null pointer is returned
Returns
A pointer to the cache owned by the item.

Definition at line 1577 of file levelSetCache.tpp.

◆ getCache() [2/4]

template<typename key_t >
template<typename value_t >
LevelSetValueCache< key_t, value_t > * bitpit::LevelSetCacheCollection< key_t >::Item::getCache ( bool allowCreation = true)

Get a pointer to the cache owned by the item.

Parameters
allowCreationcontrols the behaviour when the cache has not yet been created, if the argument is set to true, the item will create a new cache from scratch, otherwise a null pointer is returned
Returns
A pointer to the cache owned by the item.

Definition at line 1617 of file levelSetCache.tpp.

◆ getCache() [3/4]

template<typename key_t >
const LevelSetCache< key_t > * bitpit::LevelSetCacheCollection< key_t >::Item::getCache ( bool allowCreation = true) const

Get a constant pointer to the cache owned by the item.

Parameters
allowCreationcontrols the behaviour when the cache has not yet been created, if the argument is set to true, the item will create a new cache from scratch, otherwise a null pointer is returned
Returns
A constant pointer to the cache owned by the item.

Definition at line 1591 of file levelSetCache.tpp.

◆ getCache() [4/4]

template<typename key_t >
template<typename value_t >
const LevelSetValueCache< key_t, value_t > * bitpit::LevelSetCacheCollection< key_t >::Item::getCache ( bool allowCreation = true) const

Get a constant pointer to the cache owned by the item.

Parameters
allowCreationcontrols the behaviour when the cache has not yet been created, if the argument is set to true, the item will create a new cache from scratch, otherwise a null pointer is returned
Returns
A constant pointer to the cache owned by the item.

Definition at line 1632 of file levelSetCache.tpp.

◆ hasCache()

template<typename key_t >
bool bitpit::LevelSetCacheCollection< key_t >::Item::hasCache ( ) const

Check if a cache has been created for the item.

Returns
Return true if a has has been created for the item, false otherwise.

Definition at line 1512 of file levelSetCache.tpp.

◆ hasFactory()

template<typename key_t >
bool bitpit::LevelSetCacheCollection< key_t >::Item::hasFactory ( ) const

Check if a factory has been set for the item.

Returns
Return true if a factory has been set for the item, false otherwise.

Definition at line 1501 of file levelSetCache.tpp.


The documentation for this interface was generated from the following files:
--- layout: doxygen_footer ---