Go to the documentation of this file.
27 #ifndef AlpsParameterBase_h_
28 #define AlpsParameterBase_h_
43 #include "CoinError.hpp"
45 #if defined(__GNUC__) && (__GNUC__ >= 3)
48 # define ALPS_STRINGSTREAM std::istringstream
52 # define ALPS_STRINGSTREAM std::istrstream
144 std::vector< std::pair<std::string, AlpsParameter> >
keys_;
191 throw CoinError(
"can't call pack()",
"pack",
" AlpsParameterSet");
196 throw CoinError(
"can't call unpack()",
"unpack",
" AlpsParameterSet");
256 dpar_(new double[d]),
257 spar_(new std::string[s]),
258 sapar_(new std::vector<std::string>[sa])
int numSa_
The "vector of string" parameters.
void readFromFile(const char *paramfile)
Read parameters from a file.
@ AlpsStringPar
String parameter (E.g., data file name.).
@ AlpsBoolPar
Bool parameter.
AlpsParameterT
This enumerative constant describes the possible parameter types.
void writeToStream(std::ostream &outstream) const
Write keyword-value pairs to the stream specified in the argument.
double * dpar_
The double parameters.
This is the class serves as a holder for a set of parameters.
void readFromArglist(const int argnum, const char *const *arglist)
Read parameters from the command line.
AlpsParameter(const AlpsParameterT t, const int i)
Constructor where members are specified.
@ AlpsNoPar
The type is not yet specified.
std::string * spar_
The string (actually, std::string) parameters.
@ AlpsIntPar
Integer parameter.
AlpsParameterT type() const
Return the type of the parameter.
virtual void pack(AlpsEncoded &buf)
Pack the parameter set into the buffer.
AlpsParameterT type_
The type of the parameter (e.g., AlpsIntPar).
void readFromStream(std::istream &parstream)
Read the parameters from the stream specified in the argument.
int index() const
Return the index of the parameter within all parameters of the same type.
int * ipar_
The integer parameters.
std::vector< std::pair< std::string, AlpsParameter > > keys_
The keyword, parameter pairs.
AlpsParameter()
The default constructor creates a phony parameter.
virtual ~AlpsParameterSet()
The destructor deletes all data members.
virtual void createKeywordList()=0
Method for creating the list of keyword looked for in the parameter file.
@ AlpsDoublePar
Double parameter.
void setEntry(const AlpsParameter key, const char *val)
First, there is the assignment operator that sets the whole parameter set at once.
bool * bpar_
The bool parameters.
virtual void setDefaultEntries()=0
Method for setting the default values for the parameters.
int index_
The index of this parameter within all parameters of the same type.
virtual void unpack(AlpsEncoded &buf)
Unpack the parameter set from the buffer.
AlpsParameterSet(int c, int i, int d, int s, int sa)
The constructor allocate memory for parameters.
std::string prefix_
Prefix to be used for looking up parameters.
std::vector< std::string > obsoleteKeys_
list of obsolete keywords.
This parameter indeintifies a single parameter entry.
~AlpsParameter()
The destructor.
@ AlpsStringArrayPar
The parameter is an array of strings.
std::vector< std::string > * sapar_