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

phbib.h File Reference

This header declares some functions and structures that might be usefull to program a new device block. More...

#include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <typeinfo>
#include <simthetic/misc.h>
#include <simthetic/exceptions.h>
#include <simthetic/parameterfile.h>

Go to the source code of this file.

Namespaces

namespace  simth

Functions

std::string i2string (int value)
std::string oct2string (int value)
int oct2int (int oct)
std::string demangle (const char *symbol)
template<typename T>
std::string stringify (const T &x)
template<typename T>
convertTo (const std::string &s, bool failIfLeftoverChars=true)
double arg (const Complex &comp)
int inversePower2 (int x)
double db2linearPowerRatio (double snr)
double db2reciprocalLinearPowerRatio (double snr)
void computeSplittedSizes (size_t inSize, size_t inBits1, size_t inBits2, size_t &outSize1, size_t &outSize2)
template<class T>
void splitSequence (const T &in, T *out1, T *out2, size_t bits1, size_t bits2)
template<class T>
void mergeSequences (const T &out1, const T &out2, size_t bits1, size_t bits2, T *outSeq)
void computeSplittedSizes (size_t inSize, size_t inBits1, size_t inBits2, size_t *outSize1, size_t *outSize2)


Detailed Description

This header declares some functions and structures that might be usefull to program a new device block.

Especially, one can use the simth::checkedVector classes to implement sequences. These classes act like an std::vector but offer an additional range check depending whether the macro DEBUG is defined or not. In order to enhance the runtime speed this check mechanism can de disabled by setting the macro DEBUG (defined in misc.h) to false.

Note: The file name was given according to Peter Haase's initials since he's the one who collected all these functions.


Function Documentation

std::string i2string int  value  ) 
 

std::string oct2string int  value  ) 
 

int oct2int int  oct  ) 
 

std::string demangle const char *  symbol  ) 
 

Returns a string describing the (demangled) type of the given mangled type symbol.

Note: To get the demangled type name for some class, you would call simth::demangle(typeid(MyClass).name())

template<typename T>
std::string stringify const T &  x  )  [inline]
 

Converts an arbitrary type T to a std::string, provided T supports syntax like std::cout << x. (Copied from Marshall Cline's FAQ list.)

template<typename T>
T convertTo const std::string &  s,
bool  failIfLeftoverChars = true
[inline]
 

Converts a string to any type that supports iostream input. (Copied from Marshall Cline's FAQ list.)

void simth::computeSplittedSizes size_t  inSize,
size_t  inBits1,
size_t  inBits2,
size_t &  outSize1,
size_t &  outSize2
[inline]
 

template<class T>
void splitSequence const T &  in,
T *  out1,
T *  out2,
size_t  bits1,
size_t  bits2
 

Split one sequence into two sequences. The size of the sequence must be a multiple of bits1+bits2.

FIXME: This can better be moved to signals.h, doesn't it?

Then the bits with index (n $\times$ (bits1+bits)) to (n $\times$ (bits1+bits)+bits1) for n=0$\ldots$ are splitted to sequence 1 and the bits with index (n $\times$ (bits1+bits) + bits1) to (n $\times$ (bits1+bits)+ bits1+bits2) are splitted to squence 2.

template<class T>
void mergeSequences const T &  out1,
const T &  out2,
size_t  bits1,
size_t  bits2,
T *  outSeq
 

void computeSplittedSizes size_t  inSize,
size_t  inBits1,
size_t  inBits2,
size_t *  outSize1,
size_t *  outSize2
[inline]
 


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