13#ifndef CXXUTILS_SIMPLEUPDATER_H
14#define CXXUTILS_SIMPLEUPDATER_H
void clean()
Delete all objects we're managing except for the current one.
std::vector< std::unique_ptr< T > > m_objs
List of all allocated objects.
void update(std::unique_ptr< T > p, const Context_t &)
Install a new object.
void swap(SimpleUpdater &other)
Swap this object with another.
void quiescent(const Context_t &)
Mark that an event slot is not referencing this object.
const T & get() const
Return a reference to the current object.
SimpleUpdater(SimpleUpdater &&other)
Move constructor.
static const Context_t defaultContext()
Return the current event context.
SimpleUpdater()=default
We need a default constructor.
std::atomic< const T * > m_obj
Pointer to the current object.
void discard(std::unique_ptr< T > p)
Queue an object for later deletion.