ASL  0.1.7
Advanced Simulation Library
Public Member Functions | List of all members
asl::Parameter< T > Class Template Reference

#include <aslParametersManager.h>

Inheritance diagram for asl::Parameter< T >:
Inheritance graph
[legend]

Public Member Functions

 Parameter (const char *key_, const char *description_, const char *units_="")
 
 Parameter (T defaultValue, const char *key_, const char *description_, const char *units_="")
 
const T & v () const
 
T & v ()
 
std::shared_ptr< T > p ()
 

Detailed Description

template<typename T>
class asl::Parameter< T >

This class stores parameter's value and the information needed to extract it from command line and/or parameters file. Important: declare Parameters only after declaring ParametersManager or ApplicationParametersManager instance and before calling ParametersManager::load() because each Parameter adds itself to the instance automatically!

Examples
bus_wind.cc, compressor.cc, cubeGravity.cc, cubeIncompressibleGravity.cc, cubePoroelasticGravity.cc, jumpingBox.cc, levelSetBasic.cc, levelSetFacetedGrowth.cc, levelSetNormalGrowth.cc, locomotive.cc, locomotive_laminar.cc, locomotive_stability.cc, and poroelastic.cc.

Definition at line 44 of file aslParametersManager.h.

Constructor & Destructor Documentation

◆ Parameter() [1/2]

template<typename T>
asl::Parameter< T >::Parameter ( const char *  key_,
const char *  description_,
const char *  units_ = "" 
)

key_ - option key; is used to specify this parameter through command line and/or parameters file. description_ is used in the help output and as comment on parameters file generation. units_ - parameter units; is used to complement the option description mentioned above. Might be used for automatic unit conversion in future (to this end it is recommended to use the notation of the Boost::Units library). Since no default value is specified, the parameter is required to be specified in the parameters file or command line. Use "" to provide a vector asl::AVec<T> through command line, e.g.: –size "30 20 50"

◆ Parameter() [2/2]

template<typename T>
asl::Parameter< T >::Parameter ( defaultValue,
const char *  key_,
const char *  description_,
const char *  units_ = "" 
)

defaultValue - default parameter value. Since a default value is specified, the parameter is not required to be specified in the parameters file or command line. key_ - option key; is used to specify this parameter through command line and/or parameters file. description_ is used in the help output and as comment on parameters file generation. units_ - parameter units; is used to complement the option description mentioned above. Might be used for automatic unit conversion in future (to this end it is recommended to use the notation of the Boost::Units library).

Member Function Documentation

◆ p()

template<typename T >
std::shared_ptr< T > asl::Parameter< T >::p ( )
inline

Definition at line 190 of file aslParametersManager.h.

◆ v() [1/2]

template<typename T >
const T & asl::Parameter< T >::v ( ) const
inline

Definition at line 179 of file aslParametersManager.h.

◆ v() [2/2]

template<typename T >
T & asl::Parameter< T >::v ( )
inline

Definition at line 185 of file aslParametersManager.h.


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