TProductCache< ProductPtr > Class Template Reference

The type specific product cache. More...

#include <mia/core/productcache.hh>

Inheritance diagram for TProductCache< ProductPtr >:
[legend]
Collaboration diagram for TProductCache< ProductPtr >:
[legend]

Public Member Functions

void add (const std::string &name, ProductPtr product)
 
ProductPtr get (const std::string &name) const
 
 TProductCache (const std::string &descriptor)
 
- Public Member Functions inherited from CProductCache
void clear ()
 clear the cache More...
 
 CProductCache (const std::string &name)
 
void enable_write (bool enable)
 

Additional Inherited Members

- Protected Member Functions inherited from CProductCache
bool is_enabled () const
 

Detailed Description

template<typename ProductPtr>
class TProductCache< ProductPtr >

The type specific product cache.

Template Parameters
ProductPtrthe shared pointer of the product that is actually stored in this cache.

Definition at line 78 of file productcache.hh.

Constructor & Destructor Documentation

◆ TProductCache()

template<typename ProductPtr >
TProductCache< ProductPtr >::TProductCache ( const std::string &  descriptor)

Constructor

Definition at line 145 of file productcache.hh.

Member Function Documentation

◆ add()

template<typename ProductPtr >
void TProductCache< ProductPtr >::add ( const std::string &  name,
ProductPtr  product 
)

Add a product pointer to the cache if the cache is enabled

Parameters
nameinitializer string of the product
productthe shared pointer of the product to be added

Definition at line 161 of file productcache.hh.

References CProductCache::is_enabled(), and NS_MIA_END.

◆ get()

template<typename ProductPtr >
ProductPtr TProductCache< ProductPtr >::get ( const std::string &  name) const

Get a profuct if it is cached,

Parameters
namethe initializer string
Returns
the shared product pointer, if available, or an empty shared pointer

Definition at line 151 of file productcache.hh.


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