Main Page | Namespace List | Alphabetical List | Class List | Directories | File List | Class Members | File Members

Utilities Class Reference

#include <Utilities.h>

List of all members.

Static Public Member Functions

static int absVal (const int &num)
static double absVal (const double &num)
static bool cStringEquals (const char *cString1, const char *cString2, int length)
static double getDouble (const char *cString)
static double getDouble (string s)
static int getInt (const char *cString)
static int getInt (string s)
static unsigned int getNeuronGrpID (string neurGrpStr)
static unsigned int getRandomUInt (unsigned int rangeHigh)
static short getShort (const char *cString)
static short getShort (string str)
static unsigned int getUInt (const char *cString)
static unsigned int getUInt (string s)
static unsigned short getUShort (const char *cString)
static unsigned short getUShort (string s)
static double round (double number, unsigned int numPlaces)
static void roundTwoDecimalPlaces (double &)
static void safeCStringCat (char target[], const char source[], int targetSize)
static void safeCStringCopy (char target[], const char source[], int targetSize)


Detailed Description

Collection of static convenience methods for converting and other tasks.

Definition at line 36 of file Utilities.h.


Member Function Documentation

double Utilities::absVal const double &  num  )  [static]
 

Returns the absolute value of the number.

Definition at line 77 of file Utilities.cpp.

int Utilities::absVal const int &  num  )  [static]
 

Returns the absolute value of the number.

Definition at line 69 of file Utilities.cpp.

bool Utilities::cStringEquals const char *  cString1,
const char *  cString2,
int  length
[static]
 

Returns true if string1 = string2 without the possibility of a buffer overflow.

Definition at line 86 of file Utilities.cpp.

double Utilities::getDouble string  s  )  [static]
 

Converts string to double.

Definition at line 155 of file Utilities.cpp.

References getDouble().

double Utilities::getDouble const char *  cString  )  [static]
 

Converts cstring to double.

Definition at line 101 of file Utilities.cpp.

References numConversionException.

Referenced by getDouble().

int Utilities::getInt string  s  )  [static]
 

Converts string to integer.

Definition at line 182 of file Utilities.cpp.

References getInt().

int Utilities::getInt const char *  cString  )  [static]
 

Converts cstring to signed integer.

Definition at line 161 of file Utilities.cpp.

References numConversionException.

Referenced by getInt(), and getShort().

unsigned int Utilities::getNeuronGrpID string  neurGrpStr  )  [static]
 

Extracts NeuronGrpID from string of the form "layerName[NeuronGrpID]".

Definition at line 188 of file Utilities.cpp.

References genUtilitiesException, and getUInt().

unsigned int Utilities::getRandomUInt unsigned int  rangeHigh  )  [static]
 

Returns a random unsigned integer betwen 0 and rangeHigh. rand() returns a number between 0 and RANGE_MAX, so dividing this by RANGE MAX gives a number between 0 and 1.0

Definition at line 208 of file Utilities.cpp.

short Utilities::getShort string  str  )  [static]
 

Converts string to short.

Definition at line 225 of file Utilities.cpp.

References getShort().

short Utilities::getShort const char *  cString  )  [static]
 

Converts cstring to short.

Definition at line 214 of file Utilities.cpp.

References getInt(), MAX_SHORT_VALUE, MIN_SHORT_VALUE, and numConversionException.

Referenced by getShort().

unsigned int Utilities::getUInt string  s  )  [static]
 

Converts string to unsigned integer.

Definition at line 245 of file Utilities.cpp.

References getUInt().

unsigned int Utilities::getUInt const char *  cString  )  [static]
 

Converts cstring to unsigned integer.

Definition at line 231 of file Utilities.cpp.

References numConversionException.

Referenced by getNeuronGrpID(), and getUInt().

unsigned short Utilities::getUShort string  s  )  [static]
 

Converts string to unsigned short.

Definition at line 268 of file Utilities.cpp.

References getUShort().

unsigned short Utilities::getUShort const char *  cString  )  [static]
 

Converts cstring to unsigned short.

Definition at line 251 of file Utilities.cpp.

References MAX_USHORT_VALUE, and numConversionException.

Referenced by getUShort().

double Utilities::round double  tempDoub,
unsigned int  numPlaces
[static]
 

Rounds the given double to the specified number of decimal places.

Definition at line 274 of file Utilities.cpp.

void Utilities::roundTwoDecimalPlaces double &  tempDoub  )  [static]
 

Rounds the given double to two decimal places.

Definition at line 292 of file Utilities.cpp.

void Utilities::safeCStringCat char  target[],
const char  source[],
int  targetSize
[static]
 

Adds source onto the end of target without potential buffer overflow.

Definition at line 300 of file Utilities.cpp.

References genUtilitiesException.

void Utilities::safeCStringCopy char  target[],
const char  source[],
int  targetSize
[static]
 

Carries out a safe copy of source cstring to target cstring that is no larger than targetSize.

Definition at line 336 of file Utilities.cpp.

References genUtilitiesException.

Referenced by DBInterface::DBInterface(), and LogWriter::setLogPath().


The documentation for this class was generated from the following files:
Generated on Mon Sep 3 22:18:50 2007 for SpikeStream Library by  doxygen 1.4.4