RVC::DBTABLE::FIELDINFO Class Reference

#include <rvc/dbtable.h>

List of all members.

Public Types

enum  FLAGS {
  FLAG_None = 0x0000, FLAG_PrimaryKey = 0x0001, FLAG_PK = FLAG_PrimaryKey, FLAG_ForeignKey = 0x0002,
  FLAG_Indexed = 0x0004, FLAG_ComputeOnRead = 0x0008, FLAG_NotNULL = 0x0010, FLAG_Unique = 0x0020,
  FLAG_ReadOnly = 0x0040, FLAG_SecondaryKey = 0x0080, FLAG_Invisible = 0x0100, FLAG_Closest = 0x0200,
  FLAG_RangeAbove = 0x0400, FLAG_RangeBelow = 0x0800, FLAG_ComputeOnWrite = 0x1000, FLAG_ComputedMASK = 0x1008,
  FLAG_LocalTime = 0x2000, FLAG_AutoIncrement = 0x4000, FLAG_SSIndex = 0x10000, FLAG_Searchable = (FLAG_Indexed | FLAG_SSIndex)
}
enum  FORMAT {
  FORMAT_Undefined = 0, FORMAT_OGC_WKB = 1, FORMAT_OGC_WKT, FORMAT_ImageJPG,
  FORMAT_ImagePNG
}
enum  NEXTFIELD { NEXTFIELD_ThisFieldName = 0xFFFF, NEXTFIELD_ThisTableName = 0xFFFE, NEXTFIELD_DomID = 0xFFFD, NEXTFIELD_PseudoField = 0xFFFC }
enum  TYPE {
  TYPE_Invalid = 0, TYPE_String = 1, TYPE_Char = 2, TYPE_UINT8 = 3,
  TYPE_SINT8 = 4, TYPE_UINT16 = 5, TYPE_SINT16 = 6, TYPE_UINT32 = 7,
  TYPE_SINT32 = 8, TYPE_Float = 9, TYPE_Double = 10, TYPE_Logical = 11,
  TYPE_Date = 12, TYPE_UINT64 = 13, TYPE_SINT64 = 14, TYPE_Color = 15,
  TYPE_Binary = 16, TYPE_Memo = 17, TYPE_Unicode = 18, TYPE_DateTime = 19,
  TYPE_NUMTYPES
}
enum  USAGE {
  USAGE_Undefined = 0, USAGE_XCoord = 1, USAGE_YCoord, USAGE_ZCoord,
  USAGE_Label, USAGE_Filename, USAGE_ObjName, USAGE_ImageBLOB,
  USAGE_ImageFile, USAGE_ImageURL, USAGE_ImageName, USAGE_Spatial,
  USAGE_HyperLink, USAGE_DataTip, USAGE_Heading, USAGE_Velocity,
  USAGE_CRS, USAGE_DateTime, USAGE_ImageThumbnail, USAGE_ImageDescription,
  USAGE_RecordModTime, USAGE_EnumLabel, USAGE_EnumToolTip, USAGE_ElementID,
  USAGE_ElementName, USAGE_ElementDesc, USAGE_LAST
}
typedef ENUMSET< USAGE,
USAGE_LAST > 
USAGESET

Public Member Functions

 FIELDINFO (const FIELDINFO &rhs)
 FIELDINFO ()
 ~FIELDINFO ()
void Clear ()
void ClearFlag (FLAGS flag)
void ClearLink ()
void ClearNextLinkField ()
TYPE CompareFieldTypes (const FIELDINFO &rhs, bool &ExactMatch) const
UINT32 GetAutoIncrement () const
const RVC::DBTABLE::CONSTRAINTGetConstraint () const
int GetDecimalPlaces () const
const RVC::DESCRIPTORGetDescriptor () const
int GetDispUnits () const
int GetDispWidth () const
const RVC::OBJECTNAMEGetDomainID () const
FLAGS GetFlags () const
FORMAT GetFormat () const
const MISTRINGGetFullName () const
DEPRECATED const RVC::OBJECTNAMEGetName () const
INT32 GetNextLinkField () const
INT32 GetOffset () const
NEXTFIELD GetPseudoNextLinkField () const
INT32 GetRelatedField () const
INT32 GetRelatedTable () const
const RVC::OBJECTNAMEGetShortName () const
INT32 GetSize () const
TYPE GetType () const
UOM::UNIT GetUnits (bool bGetUnitsShown=false) const
void GetUnits (UNITCONV &conv, bool bGetUnitsShown=false) const
int GetUnitType () const
USAGE GetUsage () const
bool HasNextKey () const
bool HasPseudoNextKey () const
bool HasRelation () const
bool IsNumeric () const
bool IsString () const
FIELDINFOoperator= (const FIELDINFO &rhs)
void ResetPosition ()
void SetAutoIncrement (UINT32 count)
void SetConstraint (const RVC::DBTABLE::CONSTRAINT &Constraint)
void SetDecimalPlaces (int decplaces)
void SetDescription (const MISTRING &Description)
void SetDescriptor (const RVC::DESCRIPTOR &Descriptor)
void SetDispUnits (int unit)
void SetDispWidth (int width)
void SetDomainID (const RVC::OBJECTNAME &name)
void SetFlag (FLAGS flag)
void SetFlags (FLAGS flags)
void SetFormat (FORMAT format)
void SetLink (INT32 TableNum, INT32 FieldNum, NEXTFIELD NextFieldNum)
void SetLink (INT32 TableNum, INT32 FieldNum, INT32 NextFieldNum=-1)
void SetName (TEXTID name)
void SetName (const MISTRING &name)
void SetName (const RVC::OBJECTNAME &name)
void SetNextLinkField (NEXTFIELD NextFieldNum)
void SetNextLinkField (INT32 NextFieldNum)
void SetOffset (int offset)
void SetSize (INT32 size)
void SetType (TYPE type)
void SetUnits (UOM::IDNUM units, bool bSetUnitsStored=true, bool bSetUnitsShown=true)
void SetUnits (const UOM::UNIT &units, bool bSetUnitsStored=true, bool bSetUnitsShown=true)
void SetUnits (const UNITCONV &conv)
void SetUnitsShown (const UNITCONV &conv)
void SetUsage (USAGE usage)

Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
FLAG_None 
FLAG_PrimaryKey 

Field is a primary key (force index).

FLAG_PK 
FLAG_ForeignKey 

Field is a foreign key related to field in another table.

FLAG_Indexed 

Field has index.

FLAG_ComputeOnRead 

Field is computed.

FLAG_NotNULL 

Value cannot be null/empty.

FLAG_Unique 

value must be unique

FLAG_ReadOnly 

User can't change value.

FLAG_SecondaryKey 

Secondary (or higher) key.

FLAG_Invisible 

Don't show the field at all.

FLAG_Closest 

Related to "closest" value.

FLAG_RangeAbove 

Related to value above or equal.

FLAG_RangeBelow 

Related to value below or equal.

FLAG_ComputeOnWrite 

Compute field on write.

FLAG_ComputedMASK 
FLAG_LocalTime 

TYPE_DateTime field is stored in local time.

FLAG_AutoIncrement 

Assignes the "AutoIncrement" value to the field and then increments "AutoIncrement" (default start is '1').

FLAG_SSIndex 

Field has index (in ODBC), but we can't change it.

FLAG_Searchable 
Enumerator:
FORMAT_Undefined 
FORMAT_OGC_WKB 

OGC Well Known Binary.

FORMAT_OGC_WKT 

OGC Well Known Text.

FORMAT_ImageJPG 

A JPEG file stored in a blob.

FORMAT_ImagePNG 

A PNG file stored in a blob.

pseudo fields for FIELDINFO.next_field.

Some database schemas require a 2 part key where the primary key is made up of 2 fields but the foreign key is made up of 1 field and the name of the field or one field and a "domid" which is looked up from a 3rd table by using the table/field name. We look those up on import and record them in the FIELDINFO.domid. I don't know of anything that would use the table name, but I added it for completeness

Enumerator:
NEXTFIELD_ThisFieldName 

Name of this field is the key data.

NEXTFIELD_ThisTableName 

Name of this table is the key data.

NEXTFIELD_DomID 

Key data is the "domid" field of this field.

NEXTFIELD_PseudoField 

If next_field is > this, it's one of these.

Enumerator:
TYPE_Invalid 

Invalid field type.

TYPE_String 

ASCII character string, null-terminated.

TYPE_Char 

Single ASCII character.

TYPE_UINT8 

Unsigned 1-byte integer (0-255).

TYPE_SINT8 

Signed 1-byte integer (-128-128).

TYPE_UINT16 

Unsigned 2-byte integer (0-65535).

TYPE_SINT16 

Signed 2-byte integer (-32768-32767).

TYPE_UINT32 

Unsigned 4-byte integer (0 - 2^32-1).

TYPE_SINT32 

Signed 4-byte integer (-2^31 - 2^31-1).

TYPE_Float 

4-byte floating-point number

TYPE_Double 

8-byte floating-point number

TYPE_Logical 

1-byte logical (?/Y/y/N/n/T/t/F/f/0/1)

TYPE_Date 

4-byte integer date YYYYMMDD

TYPE_UINT64 

Unsigned 8-byte integer (0 - 2^64-1).

TYPE_SINT64 

Signed 8-byte integer (-2^63 - 2^63-1).

TYPE_Color 

Color spec. Always 8 bytes (COLOR).

TYPE_Binary 

Binary field.

TYPE_Memo 

Memo field.

TYPE_Unicode 

MIUNICODE string, null-terminated.

TYPE_DateTime 

Date/Time field, 100-nanosecond intervals from 1-Jan-1601.

TYPE_NUMTYPES 

Number of defined field types.

Enumerator:
USAGE_Undefined 
USAGE_XCoord 
USAGE_YCoord 
USAGE_ZCoord 
USAGE_Label 
USAGE_Filename 
USAGE_ObjName 
USAGE_ImageBLOB 
USAGE_ImageFile 
USAGE_ImageURL 
USAGE_ImageName 
USAGE_Spatial 
USAGE_HyperLink 
USAGE_DataTip 
USAGE_Heading 
USAGE_Velocity 

Units member will specify the units.

USAGE_CRS 
USAGE_DateTime 
USAGE_ImageThumbnail 

Image thumbnail in a blob. Thumbnail is for preceding USAGE_ImageBLOB or USAGE_ImageFile field.

USAGE_ImageDescription 

Fields holds the description of the image.

USAGE_RecordModTime 

Time the record was last written -- automatically updated.

USAGE_EnumLabel 
USAGE_EnumToolTip 
USAGE_ElementID 

Initially from GML 2.0. Each element can have a built in name, description and ID values.

USAGE_ElementName 
USAGE_ElementDesc 
USAGE_LAST 

Constructor & Destructor Documentation

RVC::DBTABLE::FIELDINFO::FIELDINFO (  ) 

Default constructor.

RVC::DBTABLE::FIELDINFO::FIELDINFO ( const FIELDINFO rhs  ) 

Copy constructor.

RVC::DBTABLE::FIELDINFO::~FIELDINFO (  ) 

Member Function Documentation

void RVC::DBTABLE::FIELDINFO::Clear (  ) 

Clear the field info of current values.

void RVC::DBTABLE::FIELDINFO::ClearFlag ( FLAGS  flag  ) 

Clear a single flag.

void RVC::DBTABLE::FIELDINFO::ClearLink (  ) 

Clear a link from this field to another table.

void RVC::DBTABLE::FIELDINFO::ClearNextLinkField (  ) 

Clear the next field number that this field is linked to.

TYPE RVC::DBTABLE::FIELDINFO::CompareFieldTypes ( const FIELDINFO rhs,
bool &  ExactMatch 
) const

Compare two field types and return best field type to convert to.

Returns:
this->GetType() if exact match, TYPE_??? depending if the types are not the best match but still matchable, TYPE_Invalid if types do not match
Parameters:
ExactMatch Set to 'true' if the two fields match exactly, 'false' if they do not
UINT32 RVC::DBTABLE::FIELDINFO::GetAutoIncrement (  )  const

Get the AutoIncrement number for the next added record.

Returns:
Next AutoIncrement number
const RVC::DBTABLE::CONSTRAINT& RVC::DBTABLE::FIELDINFO::GetConstraint (  )  const [inline]
int RVC::DBTABLE::FIELDINFO::GetDecimalPlaces (  )  const

Get number of decimal places to display for floating point fields.

Returns:
Number of decimal places to display
const RVC::DESCRIPTOR& RVC::DBTABLE::FIELDINFO::GetDescriptor (  )  const [inline]
int RVC::DBTABLE::FIELDINFO::GetDispUnits (  )  const

Get the display units for this field.

Returns:
Display unit
int RVC::DBTABLE::FIELDINFO::GetDispWidth (  )  const

Get number of columns to display.

Returns:
Number of columns to display
const RVC::OBJECTNAME& RVC::DBTABLE::FIELDINFO::GetDomainID (  )  const

Get the domain ID for this field.

Returns:
Domain ID
FLAGS RVC::DBTABLE::FIELDINFO::GetFlags (  )  const

Get the flags for this field.

Returns:
Field flags (FIELDINFO::FLAGS_...)
FORMAT RVC::DBTABLE::FIELDINFO::GetFormat (  )  const

Get the format of the field.

Currently only used for BLOB fields to record what kind of data is stored in the blob.

Returns:
Field usage (FIELDINFO::FORMAT_...)
const MISTRING& RVC::DBTABLE::FIELDINFO::GetFullName (  )  const [inline]

Get the name of this field.

Deprecated:
Call GetDescriptor().GetShortName()
Returns:
Field name
DEPRECATED const RVC::OBJECTNAME& RVC::DBTABLE::FIELDINFO::GetName (  )  const [inline]

Get the name of this field.

Deprecated:
Use GetShortName()
Returns:
Field name
INT32 RVC::DBTABLE::FIELDINFO::GetNextLinkField (  )  const

Get the next field number that this field is linked to.

Returns:
Next link field number
INT32 RVC::DBTABLE::FIELDINFO::GetOffset (  )  const
NEXTFIELD RVC::DBTABLE::FIELDINFO::GetPseudoNextLinkField (  )  const

Get the next field pseudo number that this field is linked to.

Returns:
Next link field pseudo number (FIELDINFO::NEXTFIELD_...)
INT32 RVC::DBTABLE::FIELDINFO::GetRelatedField (  )  const

Get the field number that this field is linked to, use HasRelation() to determine if the field is related to another table / field.

Returns:
Linked field number
INT32 RVC::DBTABLE::FIELDINFO::GetRelatedTable (  )  const

Get the table number that this field is linked to, use HasRelation() to determine if the field is related to another table / field.

Returns:
Related table number
const RVC::OBJECTNAME& RVC::DBTABLE::FIELDINFO::GetShortName (  )  const

Get the name of this field.

Deprecated:
Call GetDescriptor().GetShortName()
Returns:
Field name
INT32 RVC::DBTABLE::FIELDINFO::GetSize (  )  const

Get the size of the field in bytes.

Returns:
Size of field in bytes
TYPE RVC::DBTABLE::FIELDINFO::GetType (  )  const

Get the type of the field.

Returns:
Type of field (FIELDINFO::TYPE_...)
UOM::UNIT RVC::DBTABLE::FIELDINFO::GetUnits ( bool  bGetUnitsShown = false  )  const

Get the numeric units for this field.

By default this method returns the units stored in the database. You can also get user's preferred units to view the field in, but that's mostly for historical reasons, as this preference is usually stored in a subobject of the table, not in the field info.

void RVC::DBTABLE::FIELDINFO::GetUnits ( UNITCONV conv,
bool  bGetUnitsShown = false 
) const

Get the numeric units for this field for unit conversion.

int RVC::DBTABLE::FIELDINFO::GetUnitType (  )  const
USAGE RVC::DBTABLE::FIELDINFO::GetUsage (  )  const

Get the usage of the field.

Returns:
Field usage (FIELDINFO::USAGE_...)
bool RVC::DBTABLE::FIELDINFO::HasNextKey (  )  const

Does the field have a next key field link?

Returns:
'True' if field has a next key field
bool RVC::DBTABLE::FIELDINFO::HasPseudoNextKey (  )  const

Does the field have a next key pseudo field link?

Returns:
'True' if field has a next pseudo key field
bool RVC::DBTABLE::FIELDINFO::HasRelation (  )  const

Is the field related to another table / field.

Returns:
'True' if field is related
bool RVC::DBTABLE::FIELDINFO::IsNumeric (  )  const

Is the field numeric? (not a string that can be converted to a number).

Returns:
'True' if field is a numeric field
bool RVC::DBTABLE::FIELDINFO::IsString (  )  const

Is the field a string?

Returns:
'True' if field is a string.
FIELDINFO& RVC::DBTABLE::FIELDINFO::operator= ( const FIELDINFO rhs  ) 

Assignment.

void RVC::DBTABLE::FIELDINFO::ResetPosition (  ) 

Reset position information about the field.

void RVC::DBTABLE::FIELDINFO::SetAutoIncrement ( UINT32  count  ) 

Set the AutoIncrement number for the next added record.

void RVC::DBTABLE::FIELDINFO::SetConstraint ( const RVC::DBTABLE::CONSTRAINT Constraint  )  [inline]
void RVC::DBTABLE::FIELDINFO::SetDecimalPlaces ( int  decplaces  ) 

Set the number of decimal places for floating point fields.

void RVC::DBTABLE::FIELDINFO::SetDescription ( const MISTRING Description  )  [inline]
void RVC::DBTABLE::FIELDINFO::SetDescriptor ( const RVC::DESCRIPTOR Descriptor  )  [inline]
void RVC::DBTABLE::FIELDINFO::SetDispUnits ( int  unit  ) 

Set the display units for this field.

void RVC::DBTABLE::FIELDINFO::SetDispWidth ( int  width  ) 

Set the display width (number of columns) for the field.

void RVC::DBTABLE::FIELDINFO::SetDomainID ( const RVC::OBJECTNAME name  ) 

Set the Domain ID for this field.

void RVC::DBTABLE::FIELDINFO::SetFlag ( FLAGS  flag  ) 

Set a single flag.

void RVC::DBTABLE::FIELDINFO::SetFlags ( FLAGS  flags  ) 

Set field flags.

void RVC::DBTABLE::FIELDINFO::SetFormat ( FORMAT  format  ) 

get the format of the field.

Currently only used for BLOB fields to record what kind of data is stored in the blob.

void RVC::DBTABLE::FIELDINFO::SetLink ( INT32  TableNum,
INT32  FieldNum,
NEXTFIELD  NextFieldNum 
)

Set this field to link to a field in another table.

void RVC::DBTABLE::FIELDINFO::SetLink ( INT32  TableNum,
INT32  FieldNum,
INT32  NextFieldNum = -1 
)

Set this field to link to a field in another table.

void RVC::DBTABLE::FIELDINFO::SetName ( TEXTID  name  ) 

Set the name of this field The TEXTID version is necessary to resolve an abmiguious function call since MISTRING and RVC::OBJECTNAME both have implicit ctors from TEXTID.

void RVC::DBTABLE::FIELDINFO::SetName ( const MISTRING name  ) 

Set the name of this field.

void RVC::DBTABLE::FIELDINFO::SetName ( const RVC::OBJECTNAME name  ) 

Set the name of this field.

void RVC::DBTABLE::FIELDINFO::SetNextLinkField ( NEXTFIELD  NextFieldNum  ) 

Set this field to link to a field in another table.

void RVC::DBTABLE::FIELDINFO::SetNextLinkField ( INT32  NextFieldNum  ) 

Set the next field number that this field is linked to.

void RVC::DBTABLE::FIELDINFO::SetOffset ( int  offset  ) 

Set the offset into the buffer for data of this field.

You don't normally have to set this. It will be set for you when you create the table.

void RVC::DBTABLE::FIELDINFO::SetSize ( INT32  size  ) 

Set the size of this field in bytes.

void RVC::DBTABLE::FIELDINFO::SetType ( TYPE  type  ) 

Set the field type.

void RVC::DBTABLE::FIELDINFO::SetUnits ( UOM::IDNUM  units,
bool  bSetUnitsStored = true,
bool  bSetUnitsShown = true 
)

Set the field units This method allows you to choose to set only the units stored or the units shown.

The "units shown" is mostly for historical reasons.

void RVC::DBTABLE::FIELDINFO::SetUnits ( const UOM::UNIT units,
bool  bSetUnitsStored = true,
bool  bSetUnitsShown = true 
)

Set the field units This method allows you to choose to set only the units stored or the units shown.

The "units shown" is mostly for historical reasons.

void RVC::DBTABLE::FIELDINFO::SetUnits ( const UNITCONV conv  ) 

Set the field units Note: this sets the unit type and the "Units Stored" but leaves the "Units Shown" alone.

void RVC::DBTABLE::FIELDINFO::SetUnitsShown ( const UNITCONV conv  ) 

Set the field units Note: This will only set the "Units Shown", which is only used by Single Record View.

And it will refuse to change it if the UnitType of the conv parameter does not match the field's unit type.

void RVC::DBTABLE::FIELDINFO::SetUsage ( USAGE  usage  ) 

Set the field usage.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:37:01 2012 for TNTsdk 2012 by  doxygen 1.6.1