openPMD-api
Public Member Functions | List of all members
openPMD::Container< T, T_key, T_container >::EraseStaleEntries Class Reference

This class wraps a Container and forwards operator[]() and at() to it. More...

#include <Container.hpp>

Public Member Functions

 EraseStaleEntries (Container &container_in)
 
template<typename K >
mapped_type & operator[] (K &&k)
 
template<typename K >
mapped_type & at (K &&k)
 
template<typename K >
void forget (K &&k)
 Remove key from the list of accessed keys. More...
 

Detailed Description

template<typename T, typename T_key = std::string, typename T_container = std::map<T_key, T>>
class openPMD::Container< T, T_key, T_container >::EraseStaleEntries

This class wraps a Container and forwards operator[]() and at() to it.

It remembers the keys used for accessing. Upon going out of scope, all keys not yet accessed are removed from the Container. Note that the container is stored by non-owning reference, thus requiring that the original Container stay in scope while using this class.

Member Function Documentation

◆ forget()

template<typename T, typename T_key = std::string, typename T_container = std::map<T_key, T>>
template<typename K >
void openPMD::Container< T, T_key, T_container >::EraseStaleEntries::forget ( K &&  k)
inline

Remove key from the list of accessed keys.

If the key is not accessed after this again, it will be deleted along with all other unaccessed keys upon destruction.


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