openPMD-api
Public Member Functions | List of all members
openPMD::internal::EraseStaleEntries< Container_t > Class Template Reference

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

#include <Container.hpp>

Public Member Functions

 EraseStaleEntries (Container_t &container_in)
 
 EraseStaleEntries (BareContainer_t &&container_in)
 
 EraseStaleEntries (EraseStaleEntries &&)=default
 
EraseStaleEntriesoperator= (EraseStaleEntries &&)=default
 
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 Container_t>
class openPMD::internal::EraseStaleEntries< Container_t >

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. Container_t can be instantiated either by a reference or value type.

Member Function Documentation

◆ forget()

template<typename Container_t >
template<typename K >
void openPMD::internal::EraseStaleEntries< Container_t >::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: