concepts::Flyweight< KeyT, ValueT > Class Template Reference

flyweight memory manager More...

#include <flyweight.hh>

Public Member Functions

 Flyweight ()
 
std::shared_ptr< const ValueT > get (const KeyT &key)
 
void insert (const KeyT &key, std::shared_ptr< const ValueT > &value)
 

Protected Attributes

std::unordered_map< KeyT, std::weak_ptr< const ValueT >, Hash< KeyT > > container_
 TODO: Write extra method for the removable of entries with non-lockable weak_ptrs. More...
 

Detailed Description

template<class KeyT, class ValueT>
class concepts::Flyweight< KeyT, ValueT >

flyweight memory manager

Definition at line 94 of file flyweight.hh.

Constructor & Destructor Documentation

◆ Flyweight()

template<class KeyT , class ValueT >
concepts::Flyweight< KeyT, ValueT >::Flyweight ( )
inline

Definition at line 96 of file flyweight.hh.

Member Function Documentation

◆ get()

template<class KeyT , class ValueT >
std::shared_ptr<const ValueT> concepts::Flyweight< KeyT, ValueT >::get ( const KeyT &  key)
inline

Definition at line 98 of file flyweight.hh.

◆ insert()

template<class KeyT , class ValueT >
void concepts::Flyweight< KeyT, ValueT >::insert ( const KeyT &  key,
std::shared_ptr< const ValueT > &  value 
)
inline

Definition at line 106 of file flyweight.hh.

Member Data Documentation

◆ container_

template<class KeyT , class ValueT >
std::unordered_map<KeyT,std::weak_ptr<const ValueT>, Hash<KeyT> > concepts::Flyweight< KeyT, ValueT >::container_
protected

TODO: Write extra method for the removable of entries with non-lockable weak_ptrs.

Definition at line 117 of file flyweight.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich