Class Module

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class Module : public Referenced

Abstract base class for modules.

This class is the abstract base for any module, that means if your module should be made usable over the ModuleList::add function it needs to be derived from Module

Subclassed by AbstractAccelerationModule, AbstractCondition, AdiabaticCooling, CandidateSplitting, ConstantMomentumDiffusion, DiffusionSDE, EMDoublePairProduction, EMInverseComptonScattering, EMPairProduction, EMTripletPairProduction, ElasticScattering, ElectronPairProduction, EmissionMapFiller, FutureRedshift, ModuleList, ModuleListRunner, NuclearDecay, Observer, Output, ParticleCollector, ParticleSplitting, PerformanceModule, PeriodicBox, PhotoDisintegration, PhotoPionProduction, PhotonOutput1D, PropagationBP, PropagationCK, Redshift, ReflectiveBox, ReflectiveShell, RestrictToRegion, ShellOutput, ShellOutput1D, ShellPropertyOutput, SimplePropagation, SynchrotronRadiation

Public Functions

Module()

Constructor Automatically sets the description to the name of the derived class

inline virtual ~Module() override

Destructor Virtual destructor that overrides Referenced::~Referenced, does nothing per default.

virtual std::string getDescription() const

Returns description, can be overriden by derived class.

void setDescription(const std::string &description)

Sets description, can be used instead of getDescription in derived class

Parameters:

description – Description string

virtual void process(Candidate *candidate) const = 0

Process function This is the main function to work with, it is called during every ModuleList::run step. Derived functions need to override this overload of process!

Parameters:

candidateCandidate raw pointer

inline void process(ref_ptr<Candidate> candidate) const

Process function Overload for process function to explicitly make a conversion from ref_ptr to a raw pointer

inline size_t addReference() const
inline size_t removeReference() const
inline int removeReferenceNoDelete() const
inline size_t getReferenceCount() const

Protected Attributes

mutable size_t _referenceCount