Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
BaseUnit< Derived > Class Template Reference

#include <units.h>

Public Member Functions

 ~BaseUnit ()=default
 

Static Public Member Functions

static void InitializeStaticVariables (unsigned long n)
 Initialize the number of instances for the derived class that must be known when simulation is started.
 
static void VacuumInstancesAndStaticVariables ()
 Clean up all instances and static variables of the derived class.
 

Detailed Description

template<class Derived>
class BaseUnit< Derived >

This class represents the base class for all kind of units, i.e., Substation, ControlUnit and MeasurementUnit. This template class is using the so-called Curiously Recurring Template Pattern (CRTP) technique.

Template Parameters
DerivedThe derived unit class.

Constructor & Destructor Documentation

◆ ~BaseUnit()

template<class Derived >
BaseUnit< Derived >::~BaseUnit ( )
default

Even though not required, this default destructor is added for safety reasons.

Member Function Documentation

◆ InitializeStaticVariables()

template<class Derived >
static void BaseUnit< Derived >::InitializeStaticVariables ( unsigned long  n)
inlinestatic

Initialize the number of instances for the derived class that must be known when simulation is started.

This method forwards the call to Derived::InitializeStaticVariables().

Parameters
nThe number of units to initialize (e.g., number of substations or control units).

◆ VacuumInstancesAndStaticVariables()

template<class Derived >
static void BaseUnit< Derived >::VacuumInstancesAndStaticVariables ( )
inlinestatic

Clean up all instances and static variables of the derived class.

This method forwards the call to Derived::VacuumInstancesAndStaticVariables(). Each derived class must implement this function, which should remove all dynamically created instances and reset static variables (including public_to_internal_id if appropriate).


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