Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

parameterfile.h File Reference

This header declares some functions for reading from a parameter file. More...

#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <complex>
#include <cmath>
#include <typeinfo>
#include <simthetic/misc.h>
#include <simthetic/exceptions.h>
#include <simthetic/checkedvector.h>

Go to the source code of this file.

Namespaces

namespace  simth

Parameter file reading

template<class T>
bool isComment (const std::string &token)
void nextLine (std::istream &inputStream)
bool seekToToken (const std::string &token, std::istream &parameterStream, bool ignoreComments=true)
bool isToken (const std::string &token, std::istream &parameterStream, bool ignoreComments=true)
std::string getStream (const std::string &token, std::istream &is)
std::string getStream (const std::string &region, const std::string &token, std::istream &is)
std::string getString (const std::string &token, std::istream &parameterStream)
std::string getPathname (const std::string &token, std::istream &parameterStream)
simth::checkedVector< std::string > getPathnameSeq (const std::string &token, std::istream &istr)
bool getBool (const std::string &token, std::istream &parameterStream)
int getInt (const std::string &token, std::istream &parameterStream)
unsigned getOctal (const std::string &istring)
int getOctal (const std::string &token, std::istream &parameterStream)
double getDouble (const std::string &token, std::istream &parameterStream)
template<class T>
checkedVector< T > getDecSeq (const std::string &token, std::istream &is)
std::vector< int > getOctalSeq (const std::string &helpString)
checkedVector< int > getOctalSeq (const std::string &token, std::istream &is)
template<class T>
checkedVector< std::complex<
T > > 
getComplSeq (const std::string &token, std::istream &is)
std::string getString (const std::string &token, std::istream &parameterStream, std::string defaultStr)
std::string getLine (const std::string &token, std::istream &parameterStream, std::string defaultStr)
std::string getPathname (const std::string &token, std::istream &parameterStream, std::string defaultStr)
bool getBool (const std::string &token, std::istream &parameterStream, bool defaultStatus)
int getInt (const std::string &token, std::istream &parameterStream, int defaultVal)
int getOctal (const std::string &token, std::istream &parameterStream, int defaultVal)
double getDouble (const std::string &token, std::istream &parameterStream, double defaultVal)
bool seekToToken (const std::string &region, const std::string &token, std::istream &parameterStream, const std::string endQualifier="[end]")
bool isToken (const std::string &region, const std::string &token, std::istream &parameterStream)
std::string getString (const std::string &region, const std::string &token, std::istream &parameterStream)
std::string getPathname (const std::string &region, const std::string &token, std::istream &parameterStream)
bool getBool (const std::string &region, const std::string &token, std::istream &parameterStream)
int getInt (const std::string &region, const std::string &token, std::istream &parameterStream)
int getOctal (const std::string &region, const std::string &token, std::istream &parameterStream)
double getDouble (const std::string &region, const std::string &token, std::istream &parameterStream)
Complex getComplex (const std::string &region, const std::string &token, std::istream &is)
checkedVector< int > getDecSeq (const std::string &region, const std::string &token, std::istream &is)
checkedVector< int > getOctalSeq (const std::string &region, const std::string &token, std::istream &is)
template<class T>
std::vector< T > getSeq (const std::string &)
template<class T>
checkedVector< T > getSeq (const std::string &region, const std::string &token, std::istream &is)
template<class T>
checkedVector< T > getSeq (const std::string &region, const std::string &token, std::istream &is, checkedVector< T > defaultSeq)
template<class T>
checkedVector< std::complex<
T > > 
getComplSeq (const std::string &region, const std::string &token, std::istream &is)
std::string getString (const std::string &region, const std::string &token, std::istream &parameterStream, std::string defaultStr)
std::string getLine (const std::string &region, const std::string &token, std::istream &parameterStream, std::string defaultStr)
std::string getPathname (const std::string &region, const std::string &token, std::istream &parameterStream, std::string defaultStr)
bool getBool (const std::string &region, const std::string &token, std::istream &parameterStream, bool defaultStatus)
int getInt (const std::string &region, const std::string &token, std::istream &parameterStream, int defaultVal)
int getOctal (const std::string &region, const std::string &token, std::istream &parameterStream, int defaultVal)
double getDouble (const std::string &region, const std::string &token, std::istream &parameterStream, double defaultVal)
size_t getSequenceLength (const std::string &token, std::istream &parameterStream)
size_t getSequenceLength (const std::string &token, std::istream &parameterStream, int defaultVal)
size_t getSequenceLength (const std::string &region, const std::string &token, std::istream &parameterStream)
size_t getSequenceLength (const std::string &region, const std::string &token, std::istream &parameterStream, int defaultVal)
template<class T>
std::ostream & printParameter (const std::string &name, T value, std::ostream &os)
bool isFilemaskMatched (const char *mask, const char *s)

Functions

void readProperties (const std::string &region, std::istream &parameterStream, PropertyList &properties)


Detailed Description

This header declares some functions for reading from a parameter file.


Function Documentation

template<class T>
class bool isComment const std::string &  token  ) 
 

void nextLine std::istream &  inputStream  ) 
 

bool seekToToken const std::string &  token,
std::istream &  parameterStream,
bool  ignoreComments = true
 

bool isToken const std::string &  token,
std::istream &  parameterStream,
bool  ignoreComments = true
 

std::string getStream const std::string &  token,
std::istream &  is
 

std::string getStream const std::string &  region,
const std::string &  token,
std::istream &  is
 

std::string getString const std::string &  token,
std::istream &  parameterStream
 

std::string getPathname const std::string &  token,
std::istream &  parameterStream
 

simth::checkedVector<std::string> getPathnameSeq const std::string &  token,
std::istream &  istr
 

bool getBool const std::string &  token,
std::istream &  parameterStream
 

int getInt const std::string &  token,
std::istream &  parameterStream
 

unsigned getOctal const std::string &  istring  ) 
 

int getOctal const std::string &  token,
std::istream &  parameterStream
 

double getDouble const std::string &  token,
std::istream &  parameterStream
 

template<class T>
checkedVector< int > simth::getDecSeq const std::string &  token,
std::istream &  is
 

std::vector<int> getOctalSeq const std::string &  helpString  ) 
 

checkedVector<int> getOctalSeq const std::string &  token,
std::istream &  is
 

template<class T>
checkedVector<std::complex<T> > getComplSeq const std::string &  token,
std::istream &  is
 

std::string getString const std::string &  token,
std::istream &  parameterStream,
std::string  defaultStr
 

std::string getLine const std::string &  token,
std::istream &  parameterStream,
std::string  defaultStr
 

std::string getPathname const std::string &  token,
std::istream &  parameterStream,
std::string  defaultStr
 

bool getBool const std::string &  token,
std::istream &  parameterStream,
bool  defaultStatus
 

int getInt const std::string &  token,
std::istream &  parameterStream,
int  defaultVal
 

int getOctal const std::string &  token,
std::istream &  parameterStream,
int  defaultVal
 

double getDouble const std::string &  token,
std::istream &  parameterStream,
double  defaultVal
 

bool seekToToken const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
const std::string  endQualifier = "[end]"
 

bool isToken const std::string &  region,
const std::string &  token,
std::istream &  parameterStream
 

std::string getString const std::string &  region,
const std::string &  token,
std::istream &  parameterStream
 

std::string getPathname const std::string &  region,
const std::string &  token,
std::istream &  parameterStream
 

bool getBool const std::string &  region,
const std::string &  token,
std::istream &  parameterStream
 

int getInt const std::string &  region,
const std::string &  token,
std::istream &  parameterStream
 

int getOctal const std::string &  region,
const std::string &  token,
std::istream &  parameterStream
 

double getDouble const std::string &  region,
const std::string &  token,
std::istream &  parameterStream
 

Complex getComplex const std::string &  region,
const std::string &  token,
std::istream &  is
 

checkedVector<int> getDecSeq const std::string &  region,
const std::string &  token,
std::istream &  is
 

checkedVector<int> getOctalSeq const std::string &  region,
const std::string &  token,
std::istream &  is
 

template<class T>
std::vector<T> getSeq const std::string &   ) 
 

template<class T>
checkedVector<T> getSeq const std::string &  region,
const std::string &  token,
std::istream &  is
 

template<class T>
checkedVector<T> getSeq const std::string &  region,
const std::string &  token,
std::istream &  is,
checkedVector< T >  defaultSeq
 

template<class T>
checkedVector<std::complex<T> > getComplSeq const std::string &  region,
const std::string &  token,
std::istream &  is
 

std::string getString const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
std::string  defaultStr
 

std::string getLine const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
std::string  defaultStr
 

std::string getPathname const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
std::string  defaultStr
 

bool getBool const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
bool  defaultStatus
 

int getInt const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
int  defaultVal
 

int getOctal const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
int  defaultVal
 

double getDouble const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
double  defaultVal
 

size_t getSequenceLength const std::string &  token,
std::istream &  parameterStream
 

Reads a parameter value from the given stream. It works as simth::getInt(...) save it encounters a negative value. In that case the return value equals DataInterface::undefinedLength(). If the sequence length of an InputInterface is set to this length and the firts input sequence arrives the sequence length will be set to the length of that very first input length.

size_t getSequenceLength const std::string &  token,
std::istream &  parameterStream,
int  defaultVal
 

Same as getSequenceLength(const std::string& token, std::istream& parameterStream) but takes an default value. Note that the default value can be negative. In that case the default sequence length will be set to DataInterface::undefinedLength().

size_t getSequenceLength const std::string &  region,
const std::string &  token,
std::istream &  parameterStream
 

Same as getSequenceLength(const std::string& token, std::istream& parameterStream) save it only looks within the input stream region marked by the argument 'region', i.e. within '[region]' and '[end]'.

size_t getSequenceLength const std::string &  region,
const std::string &  token,
std::istream &  parameterStream,
int  defaultVal
 

Same as getSequenceLength(const std::string& token, std::istream& parameterStream, int defaultVal) save it only looks within the input stream region marked by the argument 'region', i.e. within '[region]' and '[end]'.

template<class T>
std::ostream& printParameter const std::string &  name,
value,
std::ostream &  os
[inline]
 

This function should be used for the output of a parameter value to an output stream, e.g. simth::printParameter("channel type","WSSUS Typical Urban",os). Do not forget to put an 'endl' after that function if you want a newline.

bool isFilemaskMatched const char *  mask,
const char *  s
 

Returns 'True' if the string 's' matches the pattern 'mask'. 'mask' may contain meta characters '?', match against one character, and '*' match from 0 to n characters. (Code from http://sourceforge.net/snippet)

class void readProperties const std::string &  region,
std::istream &  parameterStream,
PropertyList &  properties
 

Helper function to fill in the values in a PropertyList from the conventional "parameter file" of simthetic.

Note: The PropertyList is completely independent from this function. The way how the PropertyList is filled with values can be chosen absolutely independently from the implementation of the PropertyList.


Generated on Mon Apr 24 21:19:19 2006 for simthetic by  doxygen 1.4.1