EscriptParams.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2017 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014 by Centre for Geoscience Computing (GeoComp)
*
*****************************************************************************/
#ifndef __ESCRIPT_PARAMS_H__
#define __ESCRIPT_PARAMS_H__
#include <boost/python/list.hpp>
#include <string>
#include <unordered_set>
namespace escript
{
class EscriptParams
{
typedef std::unordered_set<std::string> FeatureSet;
public:
EscriptParams();
int getInt(const std::string& name, int sentinel = 0) const;
void setInt(const std::string& name, int value);
boost::python::list listEscriptParams() const;
inline int getAutoLazy() const { return autoLazy; }
inline int getLazyStrFmt() const { return lazyStrFmt; }
inline int getLazyVerbose() const { return lazyVerbose; }
inline int getResolveCollective() const { return resolveCollective; }
inline int getTooManyLevels() const { return tooManyLevels; }
inline int getTooManyLines() const { return tooManyLines; }
bool hasFeature(const std::string& name) const;
boost::python::list listFeatures() const;
private:
FeatureSet features;
// the number of parameters is small enough to avoid a map for performance
// reasons
int autoLazy;
int lazyStrFmt;
int lazyVerbose;
int resolveCollective;
int tooManyLevels;
int tooManyLines;
};
extern EscriptParams escriptParams;
inline void setEscriptParamInt(const std::string& name, int value)
{
escriptParams.setInt(name, value);
}
inline int getEscriptParamInt(const std::string& name, int sentinel=0)
{
return escriptParams.getInt(name, sentinel);
}
inline boost::python::list listEscriptParams()
{
return escriptParams.listEscriptParams();
}
inline bool hasFeature(const std::string& name)
{
return escriptParams.hasFeature(name);
}
inline boost::python::list listFeatures()
{
return escriptParams.listFeatures();
}
} // namespace escript
#endif // __ESCRIPT_PARAMS_H__
escript::EscriptParams::tooManyLines
int tooManyLines
Definition: EscriptParams.h:58
escript::EscriptParams::listEscriptParams
boost::python::list listEscriptParams() const
Definition: EscriptParams.cpp:154
escript::EscriptParams::getTooManyLevels
int getTooManyLevels() const
Definition: EscriptParams.h:43
escript::EscriptParams::autoLazy
int autoLazy
Definition: EscriptParams.h:53
escript
Definition: AbstractContinuousDomain.cpp:22
escript::EscriptParams::getInt
int getInt(const std::string &name, int sentinel=0) const
Definition: EscriptParams.cpp:117
escript::EscriptParams::EscriptParams
EscriptParams()
Definition: EscriptParams.cpp:31
escript::EscriptParams::hasFeature
bool hasFeature(const std::string &name) const
Definition: EscriptParams.cpp:166
escript::EscriptParams::getLazyStrFmt
int getLazyStrFmt() const
Definition: EscriptParams.h:40
escript::EscriptParams::tooManyLevels
int tooManyLevels
Definition: EscriptParams.h:57
escript::getEscriptParamInt
int getEscriptParamInt(const std::string &name, int sentinel=0)
get the value of a named parameter. See listEscriptParams() for available parameters.
Definition: EscriptParams.h:77
escript::EscriptParams::getLazyVerbose
int getLazyVerbose() const
Definition: EscriptParams.h:41
escript::EscriptParams::setInt
void setInt(const std::string &name, int value)
Definition: EscriptParams.cpp:136
escript::EscriptParams::listFeatures
boost::python::list listFeatures() const
Definition: EscriptParams.cpp:182
escript::EscriptParams
Definition: EscriptParams.h:28
escript::EscriptParams::getAutoLazy
int getAutoLazy() const
Definition: EscriptParams.h:39
escript::escriptParams
EscriptParams escriptParams
Definition: EscriptParams.cpp:28
escript::EscriptParams::resolveCollective
int resolveCollective
Definition: EscriptParams.h:56
escript::setEscriptParamInt
void setEscriptParamInt(const std::string &name, int value)
Set the value of a named parameter. See listEscriptParams() for available parameters.
Definition: EscriptParams.h:68
escript::EscriptParams::getResolveCollective
int getResolveCollective() const
Definition: EscriptParams.h:42
escript::EscriptParams::features
FeatureSet features
Definition: EscriptParams.h:50
escript::EscriptParams::FeatureSet
std::unordered_set< std::string > FeatureSet
Definition: EscriptParams.h:30
escript::EscriptParams::getTooManyLines
int getTooManyLines() const
Definition: EscriptParams.h:44
escript::EscriptParams::lazyVerbose
int lazyVerbose
Definition: EscriptParams.h:55
escript::EscriptParams::lazyStrFmt
int lazyStrFmt
Definition: EscriptParams.h:54