Class Referenced

Inheritance Relationships

Derived Types

Class Documentation

class Referenced

Base class for reference counting.

A form of memory management is needed to prevent memory leaks when using MPC in Python via SWIG. This base class enables reference counting. Every reference increases the reference counter, every dereference decreases it. When the counter is decreased to 0, the object is deleted. Candidate, Module, MagneticField and Source inherit from this class

Subclassed by AdvectionField, Candidate, CylindricalProjectionMap, Density, EmissionMap, Grid< T >, MagneticField, Module, ObserverFeature, SourceFeature, SourceInterface, Surface

Public Functions

Referenced()
Referenced(const Referenced&)
Referenced &operator=(const Referenced&)
size_t addReference() const
size_t removeReference() const
int removeReferenceNoDelete() const
size_t getReferenceCount() const

Protected Functions

virtual ~Referenced()

Protected Attributes

size_t _referenceCount