World Ocean Simulation System (WOSS) library
woss::DefHandler Class Reference

Class for managing dynamic instantiation of foundation classes. More...

#include <definitions-handler.h>

Collaboration diagram for woss::DefHandler:
Collaboration graph

Public Member Functions

 DefHandler ()
 
 DefHandler (const DefHandler &copy)
 
DefHandleroperator= (const DefHandler &copy)
 
virtual ~DefHandler ()
 
double getRand () const
 
int getRandInt () const
 
double getTimeReference () const
 
void setPressure (Pressure *const ptr)
 
void setTimeArr (TimeArr *const ptr)
 
void setSSP (SSP *const ptr)
 
void setSediment (Sediment *const ptr)
 
void setTimeReference (TimeReference *const ptr)
 
void setRandGenerator (RandomGenerator *const ptr)
 
void setTransducer (Transducer *const ptr)
 
void setAltimetry (Altimetry *const ptr)
 
const Pressure *const getPressure () const
 
const TimeArr *const getTimeArr () const
 
const SSP *const getSSP () const
 
const Sediment *const getSediment () const
 
RandomGenerator *const getRandomGenerator () const
 
const Transducer *const getTransducer () const
 
const Altimetry *const getAltimetry () const
 
void setDebug (bool flag)
 
bool getDebug ()
 

Protected Attributes

bool debug
 
SSPssp_creator
 
Sedimentsediment_creator
 
Pressurepressure_creator
 
TimeArrtime_arr_creator
 
TimeReferencetime_reference
 
RandomGeneratorrand_generator
 
Transducertransducer
 
Altimetryaltimetry_creator
 

Detailed Description

Class for managing dynamic instantiation of foundation classes.

woss::DefHandler is a class that handle dynamic instances of woss::SSP, woss::Sediment, woss::TimeArr, woss::Pressure. A client should aks for a pointer to any of them, and then call the virtual create method for an instance of that particular class. In this way a class that inherits from any of those mentioned above, could be "plugged-in" at run time in any WOSS class without changing the code. It should be created with singleton pattern for safety reasons (e.g. woss::Sigleton< woss::DefHandler > )

Constructor & Destructor Documentation

◆ DefHandler() [1/2]

DefHandler::DefHandler ( )

Default constructor

◆ DefHandler() [2/2]

DefHandler::DefHandler ( const DefHandler copy)

Copy constructor

◆ ~DefHandler()

DefHandler::~DefHandler ( )
virtual

Destructor

Member Function Documentation

◆ getRand()

double woss::DefHandler::getRand ( ) const
inline

Returns a random value from the connected woss::RandomGenerator object

Returns
a random value

References woss::RandomGenerator::getRand().

Here is the call graph for this function:

◆ getRandInt()

int woss::DefHandler::getRandInt ( ) const
inline

Returns a random integer from the connected woss::RandomGenerator object

Returns
a random integer value

References woss::RandomGenerator::getRandInt().

Here is the call graph for this function:

◆ getTimeReference()

double woss::DefHandler::getTimeReference ( ) const
inline

Returns the current simulation time reference from the connected woss::TimeReference object

Returns
a simulation time reference in seconds

References woss::TimeReference::getTimeReference().

Here is the call graph for this function:

◆ operator=()

Member Data Documentation

◆ debug

bool woss::DefHandler::debug
protected

Debug flag

Referenced by operator=().


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