PISM, A Parallel Ice Sheet Model  stable v2.0.4 committed by Constantine Khrulev on 2022-05-25 12:02:27 -0800
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
pism::Config Class Referenceabstract

A class for storing and accessing PISM configuration flags and parameters. More...

#include <ConfigInterface.hh>

+ Inheritance diagram for pism::Config:

Classes

struct  Impl
 

Public Types

enum  UseFlag { REMEMBER_THIS_USE = 0 , FORGET_THIS_USE = 1 }
 Flag used by get_...() methods. More...
 
typedef std::shared_ptr< ConfigPtr
 
typedef std::shared_ptr< const ConfigConstPtr
 
typedef std::map< std::string, std::vector< double > > Doubles
 
typedef std::map< std::string, std::string > Strings
 
typedef std::map< std::string, bool > Flags
 

Public Member Functions

 Config (units::System::Ptr unit_system)
 
virtual ~Config ()
 
void import_from (const Config &other)
 
const std::set< std::string > & parameters_set_by_user () const
 
const std::set< std::string > & parameters_used () const
 
void read (MPI_Comm com, const std::string &filename)
 
void write (MPI_Comm com, const std::string &filename, bool append=true) const
 
std::string filename () const
 Returns the name of the file used to initialize the database. More...
 
void read (const File &file)
 
void write (const File &file) const
 
bool is_set (const std::string &name) const
 
Doubles all_doubles () const
 
double get_number (const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
 
double get_number (const std::string &name, const std::string &units, UseFlag flag=REMEMBER_THIS_USE) const
 
std::vector< double > get_numbers (const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
 
std::vector< double > get_numbers (const std::string &name, const std::string &units, UseFlag flag=REMEMBER_THIS_USE) const
 
void set_number (const std::string &name, double value, ConfigSettingFlag flag=CONFIG_FORCE)
 
void set_numbers (const std::string &name, const std::vector< double > &values, ConfigSettingFlag flag=CONFIG_FORCE)
 
Strings all_strings () const
 
std::string get_string (const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
 
void set_string (const std::string &name, const std::string &value, ConfigSettingFlag flag=CONFIG_FORCE)
 
Flags all_flags () const
 
std::set< std::string > keys () const
 
bool get_flag (const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
 
void set_flag (const std::string &name, bool value, ConfigSettingFlag flag=CONFIG_FORCE)
 
std::string doc (const std::string &parameter) const
 
std::string units (const std::string &parameter) const
 
std::string type (const std::string &parameter) const
 
std::string option (const std::string &parameter) const
 
std::string choices (const std::string &parameter) const
 

Protected Member Functions

virtual void read_impl (const File &nc)=0
 
virtual void write_impl (const File &nc) const =0
 
virtual bool is_set_impl (const std::string &name) const =0
 
virtual Doubles all_doubles_impl () const =0
 
virtual double get_number_impl (const std::string &name) const =0
 
virtual std::vector< double > get_numbers_impl (const std::string &name) const =0
 
virtual void set_number_impl (const std::string &name, double value)=0
 
virtual void set_numbers_impl (const std::string &name, const std::vector< double > &values)=0
 
virtual Strings all_strings_impl () const =0
 
virtual std::string get_string_impl (const std::string &name) const =0
 
virtual void set_string_impl (const std::string &name, const std::string &value)=0
 
virtual Flags all_flags_impl () const =0
 
virtual bool get_flag_impl (const std::string &name) const =0
 
virtual void set_flag_impl (const std::string &name, bool value)=0
 

Private Attributes

Implm_impl
 

Detailed Description

A class for storing and accessing PISM configuration flags and parameters.

Definition at line 53 of file ConfigInterface.hh.


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