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

ParseOptions.h File Reference

#include "common.h"
#include "Vector.h"

Go to the source code of this file.

Classes

class  ParseOptions
class  ParseOptions::DataElement

Defines

#define PARSE_FLOAT   (BigReal *) NULL
#define PARSE_BIGREAL   (BigReal *) NULL
#define PARSE_VECTOR   (Vector *) NULL
#define PARSE_INT   (int *) NULL
#define PARSE_BOOL   (int *) NULL
#define PARSE_STRING   (char *) NULL
#define PARSE_ANYTHING   (StringList **) NULL
#define PARSE_MULTIPLES   (StringList **) NULL, TRUE

Enumerations

enum  Range {
  FREE_RANGE, POSITIVE, NOT_NEGATIVE, NEGATIVE,
  NOT_POSITIVE
}
enum  Units {
  N_UNIT, N_FSEC, N_NSEC, N_SEC,
  N_MIN, N_HOUR, N_ANGSTROM, N_NANOMETER,
  N_METER, N_KCAL, N_KJOULE, N_EV,
  N_KELVIN, N_UNITS_UNDEFINED
}

Functions

BigReal convert (Units to, Units from)


Define Documentation

#define PARSE_ANYTHING   (StringList **) NULL
 

Definition at line 39 of file ParseOptions.h.

#define PARSE_BIGREAL   (BigReal *) NULL
 

Definition at line 34 of file ParseOptions.h.

#define PARSE_BOOL   (int *) NULL
 

Definition at line 37 of file ParseOptions.h.

#define PARSE_FLOAT   (BigReal *) NULL
 

Definition at line 33 of file ParseOptions.h.

#define PARSE_INT   (int *) NULL
 

Definition at line 36 of file ParseOptions.h.

#define PARSE_MULTIPLES   (StringList **) NULL, TRUE
 

Definition at line 40 of file ParseOptions.h.

#define PARSE_STRING   (char *) NULL
 

Definition at line 38 of file ParseOptions.h.

#define PARSE_VECTOR   (Vector *) NULL
 

Definition at line 35 of file ParseOptions.h.


Enumeration Type Documentation

enum Range
 

Enumeration values:
FREE_RANGE 
POSITIVE 
NOT_NEGATIVE 
NEGATIVE 
NOT_POSITIVE 

Definition at line 26 of file ParseOptions.h.

Referenced by ParseOptions::range().

00026 { FREE_RANGE, POSITIVE, NOT_NEGATIVE , NEGATIVE, NOT_POSITIVE };

enum Units
 

Enumeration values:
N_UNIT 
N_FSEC 
N_NSEC 
N_SEC 
N_MIN 
N_HOUR 
N_ANGSTROM 
N_NANOMETER 
N_METER 
N_KCAL 
N_KJOULE 
N_EV 
N_KELVIN 
N_UNITS_UNDEFINED 

Definition at line 28 of file ParseOptions.h.

Referenced by next(), and ReadTimeUnits().

00028            { N_UNIT, N_FSEC, N_NSEC, N_SEC, N_MIN, N_HOUR, N_ANGSTROM, N_NANOMETER, N_METER, 
00029              N_KCAL, N_KJOULE, N_EV, N_KELVIN, N_UNITS_UNDEFINED};


Function Documentation

BigReal convert Units  to,
Units  from
 

Definition at line 85 of file ParseOptions.C.

References BigReal, N_FSEC, N_KCAL, N_KELVIN, N_KJOULE, N_METER, N_MIN, N_NANOMETER, N_NSEC, N_SEC, N_UNIT, and scaling_factors.

00086 {
00087 // cout << "Converting from " << string(from) << " to " << string(to) << std::endl;
00088 // cout << scaling_factors[from] << " <--> " << scaling_factors[to] << std::endl;
00089    if (from == N_UNIT && to == N_UNIT) { return 1.0; }
00090    if ((from == N_NSEC || from == N_FSEC || from == N_SEC || from == N_MIN || 
00091         from == N_HOUR) &&
00092        (to   == N_NSEC || to   == N_FSEC || to   == N_SEC || to   == N_MIN || 
00093         to   == N_HOUR)) {
00094       return scaling_factors[from]/scaling_factors[to];
00095    }
00096    if ((from == N_METER || from == N_NANOMETER || from == N_ANGSTROM) &&
00097        (to   == N_METER || to   == N_NANOMETER || to   == N_ANGSTROM)) {
00098       return scaling_factors[from]/scaling_factors[to];
00099    }
00100    if ((from == N_KCAL || from == N_KJOULE || from == N_EV) &&
00101        (to   == N_KCAL || to   == N_KJOULE || to   == N_EV)) {
00102       return scaling_factors[from]/scaling_factors[to];
00103    }
00104    if (from == N_KELVIN && to == N_KELVIN) {
00105       return scaling_factors[from]/scaling_factors[to];
00106    }
00107    return 0.0;
00108 }


Generated on Wed Jun 19 04:08:20 2013 for NAMD by  doxygen 1.3.9.1