TIMPI
Classes | Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
TIMPI::SemiPermanent Class Reference

The SemiPermanent "class" is basically just a place for a destructor vtable. More...

#include <semipermanent.h>

Inheritance diagram for TIMPI::SemiPermanent:
[legend]

Classes

struct  Ref
 

Public Member Functions

 SemiPermanent ()=default
 
virtual ~SemiPermanent ()=default
 

Static Public Member Functions

static void add (std::unique_ptr< SemiPermanent > obj)
 

Static Private Attributes

static int _ref_count = 0
 
static std::vector< std::unique_ptr< SemiPermanent > > _stuff_to_clean
 

Detailed Description

The SemiPermanent "class" is basically just a place for a destructor vtable.

Derive from it and pass a unique_ptr to your derived object to SemiPermanent::add() whenever you have something that ought to be almost permanent: that should be cleaned up eventually to avoid resource leaks, but that should not be cleaned up until the last TIMPIInit object exits, just before the MPI_Finalize call if TIMPI initialized MPI.

Definition at line 48 of file semipermanent.h.

Constructor & Destructor Documentation

◆ SemiPermanent()

TIMPI::SemiPermanent::SemiPermanent ( )
default

◆ ~SemiPermanent()

virtual TIMPI::SemiPermanent::~SemiPermanent ( )
virtualdefault

Member Function Documentation

◆ add()

void TIMPI::SemiPermanent::add ( std::unique_ptr< SemiPermanent obj)
static

Member Data Documentation

◆ _ref_count

int TIMPI::SemiPermanent::_ref_count = 0
staticprivate

◆ _stuff_to_clean

std::vector< std::unique_ptr< SemiPermanent > > TIMPI::SemiPermanent::_stuff_to_clean
staticprivate

Definition at line 74 of file semipermanent.h.

Referenced by add(), and TIMPI::SemiPermanent::Ref::~Ref().


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