CYCLUS
Static Public Member Functions | List of all members
cyclus::Env Class Reference

Detailed Description

An environment utility to help locate files and find environment settings.

The environment for a given simulation can be accessed via the simulation's Context.

Definition at line 23 of file env.h.

#include <env.h>

Static Public Member Functions

static const bool allow_milps ()
 
static const std::vector< std::string > cyclus_path ()
 
static const std::string EnvDelimiter ()
 
static std::string FindModule (std::string path)
 
static const std::string GetBuildPath ()
 
static std::string GetEnv (std::string var)
 
static const std::string GetInstallPath ()
 
static const std::string nuc_data ()
 
static std::string PathBase (std::string path)
 
static const std::string PathDelimiter ()
 
static const std::string rng_schema (bool flat=false)
 
static const void SetNucDataPath ()
 
static const void SetNucDataPath (std::string p)
 
static void SplitPath (const std::string &s, char delim, std::vector< std::string > &elems)
 
static std::vector< std::string > SplitPath (const std::string &s, char delim)
 

Member Function Documentation

const bool cyclus::Env::allow_milps ( )
static
Returns
whether or not Cyclus should allow Mixed-Integer Linear Programs The default depends on a compile time option DEFAULT_ALLOW_MILPS, but may be specified at run time with the ALLOW_MILPS environment variable

Definition at line 160 of file env.cc.

const std::vector< std::string > cyclus::Env::cyclus_path ( )
static
Returns
the current value of the module environment variable CYCLUS_PATH

Definition at line 151 of file env.cc.

const std::string cyclus::Env::EnvDelimiter ( )
static
Returns
the correct environment variable delimiter based on the file system

Definition at line 78 of file env.cc.

std::string cyclus::Env::FindModule ( std::string  path)
static

Returns the full path to a module by searching through default install and CYCLUS_PATH directories.

Definition at line 175 of file env.cc.

const std::string cyclus::Env::GetBuildPath ( )
static

The relative path to the root build directory (containing bin, lib, etc.)

Returns
the absolute path to the build directory

Definition at line 58 of file env.cc.

std::string cyclus::Env::GetEnv ( std::string  var)
static

Method to check the existence of and return an environment variable.

Parameters
varis the variable to check and return

Definition at line 70 of file env.cc.

const std::string cyclus::Env::GetInstallPath ( )
static

The relative path to the root install directory (containing bin, lib, etc.) This first checks the path of the cyclus executable itself and then tries the install directory given at run time.

Returns
the absolute path to the install directory

Definition at line 33 of file env.cc.

const std::string cyclus::Env::nuc_data ( )
static
Returns
the current value of the data environment variable CYCLUS_NUC_DATA

Definition at line 94 of file env.cc.

std::string cyclus::Env::PathBase ( std::string  path)
static

the path basis

Returns
path with the last item removed

Definition at line 24 of file env.cc.

const std::string cyclus::Env::PathDelimiter ( )
static
Returns
the correct path delimiter based on the file system

Definition at line 86 of file env.cc.

const std::string cyclus::Env::rng_schema ( bool  flat = false)
static

Returns the current rng schema.

Uses CYCLUS_RNG_SCHEMA env var if set; otherwise uses the default install location. If using the default location, set flat=true for the default flat schema.

Definition at line 116 of file env.cc.

static const void cyclus::Env::SetNucDataPath ( )
inlinestatic

Initializes the path to the cyclus_nuc_data.h5 file.

By default, it is assumed to be located in the path given by GetInstallPath()/share; however, paths in environment variable CYCLUS_NUC_DATA are checked first.

Definition at line 98 of file env.h.

static const void cyclus::Env::SetNucDataPath ( std::string  p)
inlinestatic

Initializes the path to the nuclear data library to p.

Definition at line 103 of file env.h.

static void cyclus::Env::SplitPath ( const std::string &  s,
char  delim,
std::vector< std::string > &  elems 
)
inlinestatic

splits a string of paths by a delimeter

Parameters
sstring of paths
delimthe delimeter character
elemsthe vector of split strings

Definition at line 30 of file env.h.

static std::vector<std::string> cyclus::Env::SplitPath ( const std::string &  s,
char  delim 
)
inlinestatic

splits a string of paths by a delimeter

Parameters
sstring of paths
delimthe delimeter character
Returns
the vector of split strings

Definition at line 45 of file env.h.


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