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
| 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

  ProductPtr | the shared pointer of the product that is actually stored in this cache.

Definition at line 79 of file productcache.hh.

## Constructor & Destructor Documentation

## TProductCache()

template<typename ProductPtr>

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

Constructor

Definition at line 148 of file productcache.hh.

References CProductCache::CProductCache().

## 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

  name | initializer string of the product
  product | the shared pointer of the product to be added

Definition at line 166 of file productcache.hh.

References get(), and CProductCache::is_enabled().

## get()

template<typename ProductPtr>

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

Get a profuct if it is cached,

Parameters

  name | the initializer string

Returns
  the shared product pointer, if available, or an empty shared pointer

Definition at line 154 of file productcache.hh.

Referenced by add().

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

- productcache.hh