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

Enumerator:
FREE_RANGE 
POSITIVE 
NOT_NEGATIVE 
NEGATIVE 
NOT_POSITIVE 

Definition at line 26 of file ParseOptions.h.

enum Units

Enumerator:
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.


Function Documentation

BigReal convert ( Units  to,
Units  from 
)

Definition at line 90 of file ParseOptions.C.

References N_ANGSTROM, N_EV, N_FSEC, N_HOUR, N_KCAL, N_KELVIN, N_KJOULE, N_METER, N_MIN, N_NANOMETER, N_NSEC, N_SEC, and N_UNIT.

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


Generated on Tue Sep 19 01:17:15 2017 for NAMD by  doxygen 1.4.7