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 >, GridProperties, MagneticField, Module, ObserverFeature, PhotonField, SourceFeature, SourceInterface, StepLengthModifier, Surface, TurbulenceSpectrum

Public Functions

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

Protected Functions

inline virtual ~Referenced()

Protected Attributes

mutable size_t _referenceCount