23 #ifndef AlpsParameters_h
24 #define AlpsParameters_h
41 #if defined(__GNUC__) && (__GNUC__ >= 3)
44 # define ALPS_STRINGSTREAM std::istringstream
48 # define ALPS_STRINGSTREAM std::istrstream
140 std::vector< std::pair<std::string, AlpsParameter> >
keys_;
183 throw CoinError(
"can't call pack()",
"pack",
" AlpsParameterSet");
188 throw CoinError(
"can't call unpack()",
"unpack",
" AlpsParameterSet");
247 dpar_(new double[d]),
248 spar_(new std::string[s]),
249 sapar_(new std::vector<std::string>[sa])
virtual void unpack(AlpsEncoded &buf)
Unpack the parameter set from the buffer.
AlpsParameter()
The default constructor creates a phony parameter.
This is the class serves as a holder for a set of parameters.
AlpsParameterT type_
The type of the parameter (e.g., AlpsIntPar).
void writeToStream(std::ostream &outstream) const
Write keyword-value pairs to the stream specified in the argument.
AlpsParameterT type() const
Return the type of the parameter.
int * ipar_
The integer parameters.
void readFromFile(const char *paramfile)
Read parameters from a file.
int numSa_
The "vector of string" parameters.
This parameter indeintifies a single parameter entry.
virtual void createKeywordList()=0
Method for creating the list of keyword looked for in the parameter file.
int index_
The index of this parameter within all parameters of the same type.
This data structure is to contain the packed form of an encodable knowledge.
String parameter (E.g., data file name.).
void readFromStream(std::istream &parstream)
Read the parameters from the stream specified in the argument.
AlpsParameterT
This enumerative constant describes the possible parameter types.
std::string * spar_
The string (actually, std::string) parameters.
virtual void setDefaultEntries()=0
Method for setting the default values for the parameters.
std::vector< std::pair< std::string, AlpsParameter > > keys_
The keyword, parameter pairs.
void readFromArglist(const int argnum, const char *const *arglist)
Read parameters from the command line.
std::vector< std::string > * sapar_
The keyword, parameter pairs.
virtual ~AlpsParameterSet()
The destructor deletes all data members.
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.
AlpsParameterSet(int c, int i, int d, int s, int sa)
The constructor allocate memory for parameters.
std::vector< std::string > obsoleteKeys_
list of obsolete keywords.
AlpsParameter(const AlpsParameterT t, const int i)
Constructor where members are specified.
Error Class thrown by an exception.
The parameter is an array of strings.
~AlpsParameter()
The destructor.
double * dpar_
The double parameters.
virtual void pack(AlpsEncoded &buf)
Pack the parameter set into the buffer.
int index() const
Return the index of the parameter within all parameters of the same type.
The type is not yet specified.