ReFRACtor
FullPhysics::Altitude Class Referenceabstract

The class handles the calculation of the altitude and gravity constants. More...

#include <altitude.h>

+ Inheritance diagram for FullPhysics::Altitude:
+ Collaboration diagram for FullPhysics::Altitude:

Public Member Functions

virtual ~Altitude ()
 
virtual void add_observer (Observer< Altitude > &Obs)
 Add an observer. More...
 
void add_observer_and_keep_reference (boost::shared_ptr< Observer< Altitude > > &Obs)
 Add an observer and keep a reference to it. More...
 
virtual AutoDerivativeWithUnit< double > altitude (const AutoDerivativeWithUnit< double > &P) const =0
 Return altitude grid for the given pressure. More...
 
virtual boost::shared_ptr< Altitudeclone () const =0
 Clone an Altitude object. More...
 
virtual boost::shared_ptr< Altitudeclone (const boost::shared_ptr< Pressure > &Press, const boost::shared_ptr< Temperature > &Temp) const =0
 This version of clone takes a pressure and temperature to use. More...
 
virtual AutoDerivativeWithUnit< double > gravity (const AutoDerivativeWithUnit< double > &P) const =0
 Return gravity constant for the given pressure. More...
 
virtual void print (std::ostream &Os) const
 
std::string print_to_string () const
 Print to string. More...
 
virtual void remove_observer (Observer< Altitude > &Obs)
 Remove an observer. More...
 

Protected Member Functions

void add_observer_do (Observer< Altitude > &Obs, Altitude &t)
 Add an observer. More...
 
void add_observer_do (Observer< Altitude > &Obs)
 
void clean_dead_ptr ()
 Remove any dead pointers. More...
 
void notify_update_do (const Altitude &Self)
 Function to call to notify Observers of a state change. More...
 
void remove_observer_do (Observer< Altitude > &Obs, Altitude &t)
 Remove an observer. More...
 
void remove_observer_do (Observer< Altitude > &Obs)
 

Protected Attributes

std::list< boost::weak_ptr< Observer< Altitude > > > olist
 
std::vector< boost::shared_ptr< Observer< Altitude > > > ref_list
 

Detailed Description

The class handles the calculation of the altitude and gravity constants.

Other objects may depend on the altitude, and should be updated when the altitude is updated. To facilitate that, this class in an Oberverable, and objects can add themselves as Observers to be notified when the temperature is updated.

Definition at line 19 of file altitude.h.

Constructor & Destructor Documentation

◆ ~Altitude()

virtual FullPhysics::Altitude::~Altitude ( )
inlinevirtual

Definition at line 21 of file altitude.h.

Member Function Documentation

◆ add_observer()

virtual void FullPhysics::Altitude::add_observer ( Observer< Altitude > &  Obs)
inlinevirtual

Add an observer.

Implements FullPhysics::Observable< Altitude >.

Definition at line 22 of file altitude.h.

◆ add_observer_and_keep_reference()

void FullPhysics::Observable< Altitude >::add_observer_and_keep_reference ( boost::shared_ptr< Observer< Altitude > > &  Obs)
inlineinherited

Add an observer and keep a reference to it.

See the discussion in the Observer class description for details.

Definition at line 107 of file observer.h.

◆ add_observer_do() [1/2]

void FullPhysics::Observable< Altitude >::add_observer_do ( Observer< Altitude > &  Obs,
Altitude t 
)
inlineprotectedinherited

Add an observer.

Definition at line 148 of file observer.h.

◆ add_observer_do() [2/2]

void FullPhysics::Observable< Altitude >::add_observer_do ( Observer< Altitude > &  Obs)
inlineprotectedinherited

Definition at line 159 of file observer.h.

◆ altitude()

virtual AutoDerivativeWithUnit<double> FullPhysics::Altitude::altitude ( const AutoDerivativeWithUnit< double > &  P) const
pure virtual

Return altitude grid for the given pressure.

Implemented in FullPhysics::AltitudeHydrostatic.

◆ clean_dead_ptr()

void FullPhysics::Observable< Altitude >::clean_dead_ptr ( )
inlineprotectedinherited

Remove any dead pointers.

Definition at line 196 of file observer.h.

◆ clone() [1/2]

virtual boost::shared_ptr<Altitude> FullPhysics::Altitude::clone ( ) const
pure virtual

Clone an Altitude object.

Note that the cloned version will not be attached to and StateVector or Observer<Altitude>, although you can of course attach them after receiving the cloned object.

Because this isn't attached to the StateVector, one use of the clone operator is to create a "frozen" Altitude object.

Implemented in FullPhysics::AltitudeHydrostatic.

◆ clone() [2/2]

virtual boost::shared_ptr<Altitude> FullPhysics::Altitude::clone ( const boost::shared_ptr< Pressure > &  Press,
const boost::shared_ptr< Temperature > &  Temp 
) const
pure virtual

This version of clone takes a pressure and temperature to use.

The intent is that the pressure and temperature has been cloned from the original pressure and temperature (although this class has no way to verify this). This allows sets of objects to be cloned using a common Pressure and Temperature clone, e.g. Atmosphere.

Implemented in FullPhysics::AltitudeHydrostatic.

◆ gravity()

virtual AutoDerivativeWithUnit<double> FullPhysics::Altitude::gravity ( const AutoDerivativeWithUnit< double > &  P) const
pure virtual

Return gravity constant for the given pressure.

Implemented in FullPhysics::AltitudeHydrostatic.

◆ notify_update_do()

void FullPhysics::Observable< Altitude >::notify_update_do ( const Altitude Self)
inlineprotectedinherited

Function to call to notify Observers of a state change.

The object should pass itself to this function, so it can be passed to the Observers.

Definition at line 121 of file observer.h.

◆ print()

virtual void FullPhysics::Altitude::print ( std::ostream &  Os) const
inlinevirtual

Reimplemented in FullPhysics::AltitudeHydrostatic.

Definition at line 42 of file altitude.h.

◆ print_to_string()

std::string FullPhysics::Printable< Altitude >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.

◆ remove_observer()

virtual void FullPhysics::Altitude::remove_observer ( Observer< Altitude > &  Obs)
inlinevirtual

Remove an observer.

Implements FullPhysics::Observable< Altitude >.

Definition at line 24 of file altitude.h.

◆ remove_observer_do() [1/2]

void FullPhysics::Observable< Altitude >::remove_observer_do ( Observer< Altitude > &  Obs,
Altitude t 
)
inlineprotectedinherited

Remove an observer.

Definition at line 173 of file observer.h.

◆ remove_observer_do() [2/2]

void FullPhysics::Observable< Altitude >::remove_observer_do ( Observer< Altitude > &  Obs)
inlineprotectedinherited

Definition at line 181 of file observer.h.

Member Data Documentation

◆ olist

std::list<boost::weak_ptr<Observer<Altitude > > > FullPhysics::Observable< Altitude >::olist
protectedinherited

Definition at line 200 of file observer.h.

◆ ref_list

std::vector<boost::shared_ptr<Observer<Altitude > > > FullPhysics::Observable< Altitude >::ref_list
protectedinherited

Definition at line 201 of file observer.h.


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

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:12