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

dbNumericField Class Reference
[OOFILE Database package]

#include <oof4.h>

Inheritance diagram for dbNumericField:

Inheritance graph
[legend]
Collaboration diagram for dbNumericField:

Collaboration graph
[legend]
List of all members.

Detailed Description

Persistent base for fields which can be represented as numbers.

Provides extra search and bases for common numeric operators.


Public Types

enum  FieldIsStandaloneT { eFieldIsStandalone }
enum  { kKeyLengthAutoCalculated = USHRT_MAX }

Public Member Functions

virtual unsigned long fieldMinWrapWidth () const
const oofStringformatMask () const
void formatMask (const char *)
virtual void clear ()
dbQueryBinary operator== (long) const
dbQueryBinary operator< (long) const
dbQueryBinary operator<= (long) const
dbQueryBinary operator>= (long) const
dbQueryBinary operator> (long) const
dbQueryBinary operator!= (long) const
dbQueryBinary equal (long) const
dbQueryBinary lessThan (long) const
dbQueryBinary lessThanOrEqual (long) const
dbQueryBinary greaterThanOrEqual (long) const
dbQueryBinary greaterThan (long) const
dbQueryBinary notEqual (long) const
dbQueryTrinary between (long, long) const
dbQueryTrinary outside (long, long) const
void operator+= (long)
void operator-= (long)
void operator *= (long)
void operator/= (long)
void operator+= (double)
void operator-= (double)
void operator *= (double)
void operator/= (double)
virtual dbQueryLiteralmakeQueryLiteral (long) const
virtual dbFieldclone () const=0
virtual void postCloneTableCleanup ()
virtual oofString name () const
void index (const OOF_IndexOptions=kIndexed)
void indexPartialKeyLen (unsigned short)
void setName (const char *name)
bool hasDefaultCalculator () const
void useCalculatorOnlyForDefaults ()
bool storesCalculatedValues () const
void storeCalculatedValues ()
bool usingCalculator () const
const char * tableName () const
bool fieldIsStandalone () const
virtual bool fieldIsSameTypeAs (const dbField *) const
virtual void describe (std::ostream &) const
 Provide human-readable information about object.

virtual OOF_fieldTypes fieldType () const=0
virtual OOF_fieldTypes nativeType () const
virtual unsigned long fieldStorageLen () const=0
virtual unsigned long fieldUsualWrapWidth () const
dbTablefieldTable () const
unsigned long fieldDataLen () const
virtual bool isEmpty () const
bool isDirty () const
fieldNumT fieldNumber () const
virtual const oofStringfieldName () const
OOF_IndexOptions fieldIndexOptions () const
bool fieldIndexIgnoresNulls () const
bool fieldIndexIsCompressLeading () const
bool fieldIndexIsCompressPadding () const
virtual bool fieldIsIndexed () const
bool fieldIsPartiallyIndexed () const
virtual bool fieldIsKeywordIndexed () const
virtual bool fieldIsUniqueIndexed () const
unsigned short fieldNumIndexes () const
unsigned short fieldKeyLen () const
bool caseSensitive () const
virtual bool fieldIsBlob () const
virtual bool fieldIsBinary () const
virtual bool fieldIsVirtual () const
dbFieldequivalentFieldFromTable (dbTable *) const
bool valueIsDuplicate () const
virtual dbQueryClausevalueAsQueryLiteral () const
bool fieldIsJoinKey () const
 Checks if any relationships in field's table use field as join key.

virtual void setString (const char *)
virtual void setNumber (long)
virtual oofString copyString () const
virtual void getChars (char *ioBuff, unsigned long &outLen) const
virtual const char * asChars () const
virtual void extract (std::ostream &) const
virtual bool insert (std::istream &, char fieldSep, char recSep)
virtual void copyValueFrom (const dbField *)
virtual void copyValueIfDifferent (const dbField *)
virtual bool validateContents ()
virtual oofWordParserwords () const
void saveDefaultCalculatedValue ()
void saveStoredCalculatedValue ()
virtual void generateTestData (bool, unsigned long)
bool hidden () const
void hide (bool hideIt=true)

Static Public Member Functions

TOKEN get_token (const char **s, const OOF_TOKENTYPE *m, unsigned int len)
void parseMask (const char *s, TOKEN *r, const OOF_TOKENTYPE *map, unsigned int len)

Public Attributes

OOF_String mFormatMask

Protected Member Functions

 dbNumericField (const OOF_IndexOptions)
 dbNumericField (const char *fieldName=0)
 dbNumericField (const char *fieldName, const OOF_IndexOptions)
 dbNumericField (dbField::FieldIsStandaloneT k)
virtual ~dbNumericField ()
void CalculateWith (dbCalculator *adoptedCalculator, bool useOnlyForDefaults)
virtual void CopyCalculatedValueToBuffer ()

Static Protected Member Functions

void CheckRange (double d, long minL, long maxL, const char *file, int line)
void CheckRange (long l, long minL, long maxL, const char *file, int line)
void CheckRange (unsigned long l, unsigned long max, const char *file, int line)

Protected Attributes

OOF_tableBackendmBackend
dbTablemTable
fieldNumT mFieldNumber
dbCalculatormCalculator
bool mHidden


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumeration values:
kKeyLengthAutoCalculated 

enum dbField::FieldIsStandaloneT [inherited]
 

Enumeration values:
eFieldIsStandalone 


Constructor & Destructor Documentation

dbNumericField::dbNumericField const  OOF_IndexOptions  )  [protected]
 

dbNumericField::dbNumericField const char *  fieldName = 0  )  [protected]
 

dbNumericField::dbNumericField const char *  fieldName,
const  OOF_IndexOptions
[protected]
 

dbNumericField::dbNumericField dbField::FieldIsStandaloneT  k  )  [inline, protected]
 

virtual dbNumericField::~dbNumericField  )  [inline, protected, virtual]
 


Member Function Documentation

const char * dbField::asChars  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

dbQueryTrinary dbNumericField::between long  ,
long 
const
 

void dbField::CalculateWith dbCalculator adoptedCalculator,
bool  useOnlyForDefaults
[protected, inherited]
 

bool dbField::caseSensitive  )  const [inline, inherited]
 

void dbNumericField::CheckRange unsigned long  l,
unsigned long  max,
const char *  file,
int  line
[static, protected]
 

void dbNumericField::CheckRange long  l,
long  minL,
long  maxL,
const char *  file,
int  line
[static, protected]
 

void dbNumericField::CheckRange double  d,
long  minL,
long  maxL,
const char *  file,
int  line
[static, protected]
 

void dbNumericField::clear  )  [virtual]
 

Reimplemented from dbField.

virtual dbField* dbField::clone  )  const [pure virtual, inherited]
 

Implemented in dbChar, dbBLOB, dbText, dbFixedBinary, dbCompoundField, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, dbDateTime, oofChar, oofText, oofBLOB, oofDate, oofLong, oofUlong, oofShort, oofUshort, oofReal, oofBool, oofTime, oofDateTime, and dbRelRefBase.

void dbField::CopyCalculatedValueToBuffer  )  [protected, virtual, inherited]
 

Reimplemented in dbChar, dbText, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, and dbDateTime.

oofString dbField::copyString  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

virtual void dbField::copyValueFrom const dbField  )  [inline, virtual, inherited]
 

Reimplemented in dbChar, dbText, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, and dbDateTime.

virtual void dbField::copyValueIfDifferent const dbField  )  [inline, virtual, inherited]
 

Reimplemented in dbChar, dbText, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, and dbDateTime.

void dbField::describe std::ostream &  os  )  const [virtual, inherited]
 

Provide human-readable information about object.

Overriden to provide much more detail particularly for dbTable::describe() which provides full schema.

Reimplemented from OOF_PublicBase.

Reimplemented in dbChar, dbFixedBinary, and dbRelRefBase.

dbQueryBinary dbNumericField::equal long   )  const
 

dbField * dbField::equivalentFieldFromTable dbTable  )  const [inherited]
 

void dbField::extract std::ostream &   )  const [virtual, inherited]
 

Reimplemented in dbChar, dbBLOB, dbText, dbFixedBinary, dbCompoundField, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, dbDateTime, and dbRelRefBase.

unsigned long dbField::fieldDataLen  )  const [inline, inherited]
 

bool dbField::fieldIndexIgnoresNulls  )  const [inline, inherited]
 

bool dbField::fieldIndexIsCompressLeading  )  const [inline, inherited]
 

bool dbField::fieldIndexIsCompressPadding  )  const [inline, inherited]
 

OOF_IndexOptions dbField::fieldIndexOptions  )  const [inline, inherited]
 

bool dbField::fieldIsBinary  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

bool dbField::fieldIsBlob  )  const [virtual, inherited]
 

Reimplemented in dbBLOB.

bool dbField::fieldIsIndexed  )  const [virtual, inherited]
 

bool dbField::fieldIsJoinKey  )  const [inherited]
 

Checks if any relationships in field's table use field as join key.

Relatively expensive because it's iterating over all fields but all the function calls below are inline queries so will compile down well in release mode.

WARNING Doesn't fan out - if any other tables use this field as a join key then they are doing really weird stuff and the application programmer must add their own checks.

This feature originally added to support OOF_repEditSetupVisitor::VisitViewBandBody

bool dbField::fieldIsKeywordIndexed  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

bool dbField::fieldIsPartiallyIndexed  )  const [inline, inherited]
 

bool dbField::fieldIsSameTypeAs const dbField  )  const [virtual, inherited]
 

Reimplemented in dbChar, dbFixedBinary, dbCompoundField, and dbRelRefBase.

bool dbField::fieldIsStandalone  )  const [inline, inherited]
 

bool dbField::fieldIsUniqueIndexed  )  const [virtual, inherited]
 

bool dbField::fieldIsVirtual  )  const [virtual, inherited]
 

Reimplemented in dbCompoundField, and dbRelRefBase.

unsigned short dbField::fieldKeyLen  )  const [inherited]
 

unsigned long dbNumericField::fieldMinWrapWidth  )  const [virtual]
 

Reimplemented from dbField.

const oofString & dbField::fieldName  )  const [inline, virtual, inherited]
 

Reimplemented in dbRelRefBase.

fieldNumT dbField::fieldNumber  )  const [inline, inherited]
 

unsigned short dbField::fieldNumIndexes  )  const [inline, inherited]
 

virtual unsigned long dbField::fieldStorageLen  )  const [pure virtual, inherited]
 

Implemented in dbChar, dbBLOB, dbFixedBinary, dbCompoundField, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, dbDateTime, and dbRelRefBase.

dbTable * dbField::fieldTable  )  const [inherited]
 

virtual OOF_fieldTypes dbField::fieldType  )  const [pure virtual, inherited]
 

Implemented in dbChar, dbBLOB, dbText, dbFixedBinary, dbCompoundField, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, dbDateTime, and dbRelRefBase.

unsigned long dbField::fieldUsualWrapWidth  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

void dbNumericField::formatMask const char *   )  [inline]
 

const oofString & dbNumericField::formatMask  )  const [inline]
 

virtual void dbField::generateTestData bool  ,
unsigned  long
[inline, virtual, inherited]
 

Reimplemented in dbChar, dbBLOB, dbText, dbFixedBinary, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, and dbDateTime.

TOKEN dbNumericField::get_token const char **  s,
const OOF_TOKENTYPE m,
unsigned int  len
[static]
 

void dbField::getChars char *  ioBuff,
unsigned long &  outLen
const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

dbQueryBinary dbNumericField::greaterThan long   )  const
 

dbQueryBinary dbNumericField::greaterThanOrEqual long   )  const
 

bool dbField::hasDefaultCalculator  )  const [inline, inherited]
 

bool OOF_PublicBase::hidden  )  const [inline, inherited]
 

void OOF_PublicBase::hide bool  hideIt = true  )  [inline, inherited]
 

void dbField::index const  OOF_IndexOptions = kIndexed  )  [inherited]
 

void dbField::indexPartialKeyLen unsigned  short  )  [inline, inherited]
 

bool dbField::insert std::istream &  ,
char  fieldSep,
char  recSep
[virtual, inherited]
 

Reimplemented in dbChar, dbText, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, dbTime, and dbDateTime.

bool dbField::isDirty  )  const [inherited]
 

Reimplemented in dbBLOB.

bool dbField::isEmpty  )  const [virtual, inherited]
 

Reimplemented in dbChar, dbBLOB, dbDate, and dbDateTime.

dbQueryBinary dbNumericField::lessThan long   )  const
 

dbQueryBinary dbNumericField::lessThanOrEqual long   )  const
 

dbQueryLiteral * dbNumericField::makeQueryLiteral long   )  const [virtual]
 

Reimplemented in dbShort, dbUshort, dbBool, dbUlong, and dbReal.

oofString dbField::name  )  const [virtual, inherited]
 

Reimplemented from OOF_PublicBase.

OOF_fieldTypes dbField::nativeType  )  const [virtual, inherited]
 

Reimplemented in dbText, dbBool, dbDate, dbTime, dbDateTime, and dbRelRefBase.

dbQueryBinary dbNumericField::notEqual long   )  const
 

void dbNumericField::operator *= double   ) 
 

void dbNumericField::operator *= long   ) 
 

dbQueryBinary dbNumericField::operator!= long   )  const
 

void dbNumericField::operator+= double   ) 
 

void dbNumericField::operator+= long   ) 
 

Reimplemented in dbDate, dbTime, and dbDateTime.

void dbNumericField::operator-= double   ) 
 

void dbNumericField::operator-= long   ) 
 

Reimplemented in dbDate, dbTime, and dbDateTime.

void dbNumericField::operator/= double   ) 
 

void dbNumericField::operator/= long   ) 
 

dbQueryBinary dbNumericField::operator< long   )  const
 

dbQueryBinary dbNumericField::operator<= long   )  const
 

dbQueryBinary dbNumericField::operator== long   )  const
 

dbQueryBinary dbNumericField::operator> long   )  const
 

dbQueryBinary dbNumericField::operator>= long   )  const
 

dbQueryTrinary dbNumericField::outside long  ,
long 
const
 

void dbNumericField::parseMask const char *  s,
TOKEN r,
const OOF_TOKENTYPE map,
unsigned int  len
[static]
 

virtual void dbField::postCloneTableCleanup  )  [inline, virtual, inherited]
 

Reimplemented in dbRelRefBase.

void dbField::saveDefaultCalculatedValue  )  [inherited]
 

void dbField::saveStoredCalculatedValue  )  [inherited]
 

void dbField::setName const char *  name  )  [inherited]
 

virtual void dbField::setNumber long   )  [inline, virtual, inherited]
 

Reimplemented in dbChar, dbText, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, and dbDateTime.

virtual void dbField::setString const char *   )  [inline, virtual, inherited]
 

Reimplemented in dbChar, dbText, dbFixedBinary, dbShort, dbUshort, dbBool, dbLong, dbUlong, dbReal, dbDate, and dbDateTime.

void dbField::storeCalculatedValues  )  [inline, inherited]
 

bool dbField::storesCalculatedValues  )  const [inline, inherited]
 

const char * dbField::tableName  )  const [inherited]
 

void dbField::useCalculatorOnlyForDefaults  )  [inline, inherited]
 

bool dbField::usingCalculator  )  const [inherited]
 

bool dbField::validateContents  )  [virtual, inherited]