PLearn 0.1
|
#include <SimpleDB.h>
Public Member Functions | |
Field () | |
Field (string name, FieldType t, int p=0) | |
bool | operator== (const Field &x) const |
Public Attributes | |
string | name |
mainly for debugging purposes | |
FieldType | field_type |
int | precision |
Definition at line 115 of file SimpleDB.h.
PLearn::Field::Field | ( | ) | [inline] |
Definition at line 116 of file SimpleDB.h.
: name(), field_type(Unknown), precision() {}
We listen to the precision argument solely when the field type is a string
Definition at line 117 of file SimpleDB.h.
References PLearn::CharacterType, PLearn::DateType, PLearn::DoubleType, PLearn::FloatType, PLearn::IntType, PLERROR, PLearn::ShortType, PLearn::SignedCharType, PLearn::StringType, and PLearn::Unknown.
: name(name), field_type(t) { switch(field_type) { case Unknown: precision=0; break; case StringType: precision=p; break; case CharacterType: precision=1; break; case SignedCharType: precision=1; break; case ShortType: precision=2; break; case IntType: precision=4; break; case FloatType: precision=4; break; case DoubleType: precision=8; break; case DateType: precision=4; break; default: PLERROR("Unknown field type %d with name %s", int(field_type), name.c_str()); } if (sizeof(PDate) != 4) PLERROR("A PLearn PDate must have sizeof equal to 4"); }
Definition at line 140 of file SimpleDB.h.
References field_type, name, and precision.
Definition at line 147 of file SimpleDB.h.
Referenced by operator==().
string PLearn::Field::name |
mainly for debugging purposes
Definition at line 146 of file SimpleDB.h.
Referenced by operator==().
Definition at line 148 of file SimpleDB.h.
Referenced by operator==().