GL Studio C++ Runtime API
VPFDataValue Class Reference

#include <vpf_data_value.h>

Public Member Functions

 ~VPFDataValue ()
 
bool IsValid (void) const
 
VPFUtil::DataType GetDataType (void) const
 
bool IsMultipleValues (void) const
 
unsigned int GetValueCount (void) const
 
const char * GetText (void) const
 
VPFUtil::Float32 GetShortFloat (void) const
 
const VPFUtil::Float32GetShortFloatValues (void) const
 
VPFUtil::Float64 GetLongFloat (void) const
 
const VPFUtil::Float64GetLongFloatValues (void) const
 
VPFUtil::UInt16 GetShortInteger (void) const
 
const VPFUtil::UInt16GetShortIntegerValues (void) const
 
VPFUtil::UInt32 GetLongInteger (void) const
 
const VPFUtil::UInt32GetLongIntegerValues (void) const
 
const VPFUtil::Coord2DShortGetCoord2DShort (void) const
 
const VPFUtil::Coord2DShortGetCoord2DShortValues (void) const
 
const VPFUtil::Coord2DLongGetCoord2DLong (void) const
 
const VPFUtil::Coord2DLongGetCoord2DLongValues (void) const
 
const VPFUtil::Coord3DShortGetCoord3DShort (void) const
 
const VPFUtil::Coord3DShortGetCoord3DShortValues (void) const
 
const VPFUtil::Coord3DLongGetCoord3DLong (void) const
 
const VPFUtil::Coord3DLongGetCoord3DLongValues (void) const
 
const VPFUtil::DateTimeGetDateTime (void) const
 
const VPFUtil::DateTimeGetDateTimeValues (void) const
 
const VPFUtil::TripletGetTriplet (void) const
 
const VPFUtil::TripletGetTripletValues (void) const
 

Static Public Member Functions

static VPFDataValueCreateDataValue (const VPFUtil::DataType dataType, const int numVals, VPFFile &infile)
 

Protected Member Functions

 VPFDataValue (const VPFUtil::DataType dataType)
 

Static Protected Member Functions

static VPFDataValueCreateText (const VPFUtil::DataType textType, const unsigned int textLen, VPFFile &infile)
 
static VPFDataValueCreateShortFloat (VPFFile &infile)
 
static VPFDataValueCreateShortFloatFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreateLongFloat (VPFFile &infile)
 
static VPFDataValueCreateLongFloatFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreateShortInt (VPFFile &infile)
 
static VPFDataValueCreateShortIntFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreateLongInt (VPFFile &infile)
 
static VPFDataValueCreateLongIntFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreate2DCoordShort (VPFFile &infile)
 
static VPFDataValueCreate2DCoordShortFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreate2DCoordLong (VPFFile &infile)
 
static VPFDataValueCreate2DCoordLongFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreate3DCoordShort (VPFFile &infile)
 
static VPFDataValueCreate3DCoordShortFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreate3DCoordLong (VPFFile &infile)
 
static VPFDataValueCreate3DCoordLongFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreateDateTime (VPFFile &infile)
 
static VPFDataValueCreateDateTimeFixed (const unsigned int num, VPFFile &infile)
 
static VPFDataValueCreateNull (void)
 
static VPFDataValueCreateTriplet (VPFFile &infile)
 
static VPFDataValueCreateTripletFixed (const unsigned int num, VPFFile &infile)
 
static bool ReadTriplet (VPFFile &infile, VPFUtil::Triplet &dst)
 
static bool ReadTripletValue (VPFFile &infile, const unsigned char type, VPFUtil::UInt32 &val, bool &isValid)
 

Protected Attributes

VPFUtil::WarningBool _isValid
 
VPFUtil::DataType _dataType
 
bool _isArray
 
unsigned int _varLen
 

Detailed Description

encapsulates a data value in a VPF table

Constructor & Destructor Documentation

Dtor

VPFDataValue ( const VPFUtil::DataType  dataType)
inlineprotected

Ctor - not called by user directly (use static Create* methods)

Parameters
dataTypedata type for new value

Member Function Documentation

static VPFDataValue* Create2DCoordLong ( VPFFile &  infile)
staticprotected

Load and create a single 2D coord long value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_2D_COORD_LONG ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* Create2DCoordLongFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a 2D coord long fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_2D_COORD_LONG ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* Create2DCoordShort ( VPFFile &  infile)
staticprotected

Load and create a single 2D coord short value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_2D_COORD_SHORT ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* Create2DCoordShortFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a 2D coord short fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_2D_COORD_SHORT ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* Create3DCoordLong ( VPFFile &  infile)
staticprotected

Load and create a single 3D coord long value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_3D_COORD_LONG ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* Create3DCoordLongFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a 3D coord long fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_3D_COORD_LONG ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* Create3DCoordShort ( VPFFile &  infile)
staticprotected

Load and create a single 3D coord short value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_3D_COORD_SHORT ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* Create3DCoordShortFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a 3D coord short fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_3D_COORD_SHORT ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateDataValue ( const VPFUtil::DataType  dataType,
const int  numVals,
VPFFile &  infile 
)
static

Create and load a data type of the given type and quantity from the given file

Parameters
dataTypedesired data type
numValsnumber of values in data val (-1 for variable length)
infilefile to read
Returns
new data value( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateDateTime ( VPFFile &  infile)
staticprotected

Load and create a single date time value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_DATE_TIME ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateDateTimeFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a date time fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_DATE_TIME ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateLongFloat ( VPFFile &  infile)
staticprotected

Load and create a single long float value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_LONG_FLOAT ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateLongFloatFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a long float fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_LONG_FLOAT ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateLongInt ( VPFFile &  infile)
staticprotected

Load and create a single long int value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_LONG_INTEGER ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateLongIntFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a long int fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_LONG_INTEGER ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateNull ( void  )
staticprotected

Create a null data value

Returns
new value with type DATA_TYPE_NULL else (NULL)
static VPFDataValue* CreateShortFloat ( VPFFile &  infile)
staticprotected

Load and create a single short float value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_SHORT_FLOAT ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateShortFloatFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a short float fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_SHORT_FLOAT ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateShortInt ( VPFFile &  infile)
staticprotected

Load and create a single short int value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_SHORT_INTEGER ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateShortIntFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a short int fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_SHORT_INTEGER ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateText ( const VPFUtil::DataType  textType,
const unsigned int  textLen,
VPFFile &  infile 
)
staticprotected

Load and create a text value with the given length from the given file and assign the given data type

Parameters
textTypeDATA_TYPE_TEXT, DATA_TYPE_TEXT_LATIN, DATA_TYPE_TEXT_FULL_LATIN, or DATA_TYPE_TEXT_MULTILINGUAL
textLennumber of bytes of text
infilefile to read
Returns
new text value with type DATA_TYPE_TEXT and buffer length (textLen) plus one for terminator ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateTriplet ( VPFFile &  infile)
staticprotected

Load and create a VPF triplet value from the given file

Parameters
infilefile to read
Returns
new value with type DATA_TYPE_TRIPLET ( Check IsValid() to ensure value was read successfully ) else NULL
static VPFDataValue* CreateTripletFixed ( const unsigned int  num,
VPFFile &  infile 
)
staticprotected

Load and create a VPF triplet fixed array value from the given file

Parameters
numnumber of elements in the array
infilefile to read
Returns
new value with type DATA_TYPE_TRIPLET ( Check IsValid() to ensure value was read successfully ) else NULL
const VPFUtil::Coord2DLong& GetCoord2DLong ( void  ) const
inline

Get the 2D coordinate long value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_2D_COORD_LONG
Returns
2D coordinate long value
const VPFUtil::Coord2DLong* GetCoord2DLongValues ( void  ) const
inline

Get multiple 2D coordinate long values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_2D_COORD_LONG
Returns
array of 2D coordinate long values 'GetValueCount()' long, else NULL if a zero length array was read.
const VPFUtil::Coord2DShort& GetCoord2DShort ( void  ) const
inline

Get the 2D coordinate short value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_2D_COORD_SHORT
Returns
2D coordinate short value
const VPFUtil::Coord2DShort* GetCoord2DShortValues ( void  ) const
inline

Get multiple 2D coordinate short values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_2D_COORD_SHORT
Returns
array of 2D coordinate short values 'GetValueCount()' long, else NULL if a zero length array was read.
const VPFUtil::Coord3DLong& GetCoord3DLong ( void  ) const
inline

Get the 3D coordinate long value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_3D_COORD_LONG
Returns
3D coordinate long value
const VPFUtil::Coord3DLong* GetCoord3DLongValues ( void  ) const
inline

Get multiple 3D coordinate long values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_3D_COORD_LONG
Returns
array of 3D coordinate long values 'GetValueCount()' long, else NULL if a zero length array was read.
const VPFUtil::Coord3DShort& GetCoord3DShort ( void  ) const
inline

Get the 3D coordinate short value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_3D_COORD_SHORT
Returns
3D coordinate short value
const VPFUtil::Coord3DShort* GetCoord3DShortValues ( void  ) const
inline

Get multiple 3D coordinate short values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_3D_COORD_SHORT
Returns
array of 3D coordinate short values 'GetValueCount()' long, else NULL if a zero length array was read.
VPFUtil::DataType GetDataType ( void  ) const
inline

Get the type of the data value

Returns
type of the data value
const VPFUtil::DateTime& GetDateTime ( void  ) const
inline

Get the date time value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_DATE_TIME
Returns
date time value
const VPFUtil::DateTime* GetDateTimeValues ( void  ) const
inline

Get multiple date time values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_DATE_TIME
Returns
array of date time values 'GetValueCount()' long, else NULL if a zero length array was read.
VPFUtil::Float64 GetLongFloat ( void  ) const
inline

Get the single long float value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_LONG_FLOAT
Returns
long float value
const VPFUtil::Float64* GetLongFloatValues ( void  ) const
inline

Get multiple long float values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_LONG_FLOAT
Returns
array of long float values 'GetValueCount()' long, else NULL if a zero length array was read.
VPFUtil::UInt32 GetLongInteger ( void  ) const
inline

Get the single long integer value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_LONG_INTEGER
Returns
long integer value
const VPFUtil::UInt32* GetLongIntegerValues ( void  ) const
inline

Get multiple long integer values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_LONG_INTEGER
Returns
array of long integer values 'GetValueCount()' long, else NULL if a zero length array was read.
VPFUtil::Float32 GetShortFloat ( void  ) const
inline

Get the single short float value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_SHORT_FLOAT
Returns
short float value
const VPFUtil::Float32* GetShortFloatValues ( void  ) const
inline

Get multiple short float values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_SHORT_FLOAT
Returns
array of short float values 'GetValueCount()' long, else NULL if a zero length array was read.
VPFUtil::UInt16 GetShortInteger ( void  ) const
inline

Get the single short integer value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_SHORT_INTEGER
Returns
short integer value
const VPFUtil::UInt16* GetShortIntegerValues ( void  ) const
inline

Get multiple short integer values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_SHORT_INTEGER
Returns
array of short integer values 'GetValueCount()' long, else NULL if a zero length array was read.
const char* GetText ( void  ) const
inline

Get text value.

Precondition
IsValid(), data type is DATA_TYPE_TEXT, DATA_TYPE_TEXT_LATIN, DATA_TYPE_TEXT_FULL_LATIN or DATA_TYPE_TEXT_MULTILINGUAL
Returns
text value ( NOTE: can be NULL if a zero length variable length string was read )
const VPFUtil::Triplet& GetTriplet ( void  ) const
inline

Get the VPF triplet value

Precondition
IsValid(), !IsMultipleValues(), data type is DATA_TYPE_TRIPLET
Returns
triplet value
const VPFUtil::Triplet* GetTripletValues ( void  ) const
inline

Get multiple triplet values

Precondition
IsValid(), IsMultipleValues(), data type is DATA_TYPE_TRIPLET
Returns
array of triplet values 'GetValueCount()' long, else NULL if a zero length array was read.
unsigned int GetValueCount ( void  ) const
inline

Get the number of data values contained ( if IsMultipleValues() )

Returns
number of data values contained if IsMultipleValues() ( can be zero ). will also return 0u if !IsMultipleValues() NOTE: This value also represents the string length (not counting terminator) of the contained text value if dataType is one of the DATA_TYPE_TEXT<*> types. A 0u returned in this case indicates that GetText() will return a NULL pointer.
bool IsMultipleValues ( void  ) const
inline

Determine if this data value contains multiple values

Returns
true if data value contains multiple values or is a text value else false
bool IsValid ( void  ) const
inline

Determine if the data value was created successfully

Returns
true if created successfully else false
static bool ReadTriplet ( VPFFile &  infile,
VPFUtil::Triplet dst 
)
staticprotected

Read a VPF triplet from the given file

Parameters
infilefile to read
dst[out] gets read triplet on success
Returns
true if success else false
static bool ReadTripletValue ( VPFFile &  infile,
const unsigned char  type,
VPFUtil::UInt32 val,
bool &  isValid 
)
staticprotected

Read one value in a triplet value from the given file

Parameters
infilefile to read
typeindicates number of bits in field to read ( 0 = 0bits, 1 = 8bits, 2 = 16bits, 3=32bits )
val[out] receives value read from file on success else 0u
isValid[out] receives true if a non zero bits value was read into 'val' else false
Returns
true on success else false

Member Data Documentation

VPFUtil::DataType _dataType
protected

type of data value

bool _isArray
protected

true if array of values else false if single val

VPFUtil::WarningBool _isValid
protected

true if valid data value else false

unsigned int _varLen
protected

length of text in bytes if data is a text value ( DATA_TYPE_TEXT_<*> ), else number of elements if multiple vals, 0u if single val

VPFUtil::Coord2DLong coord2DLong

DATA_TYPE_2D_COORD_LONG single val

VPFUtil::Coord2DLong* coord2DLongArray

DATA_TYPE_2D_COORD_LONG multiple vals

VPFUtil::Coord2DShort coord2DShort

DATA_TYPE_2D_COORD_SHORT single val

VPFUtil::Coord2DShort* coord2DShortArray

DATA_TYPE_2D_COORD_SHORT multiple vals

VPFUtil::Coord3DLong coord3DLong

DATA_TYPE_3D_COORD_LONG single val

VPFUtil::Coord3DLong* coord3DLongArray

DATA_TYPE_3D_COORD_LONG multiple vals

VPFUtil::Coord3DShort coord3DShort

DATA_TYPE_3D_COORD_SHORT single val

VPFUtil::Coord3DShort* coord3DShortArray

DATA_TYPE_3D_COORD_SHORT multiple vals

DATA_TYPE_DATE_TIME single val

VPFUtil::DateTime* dateTimeArray

DATA_TYPE_DATE_TIME multiple vals

VPFUtil::Float64 longFloat

DATA_TYPE_LONG_FLOAT single val

VPFUtil::Float64* longFloatArray

DATA_TYPE_LONG_FLOAT multiple vals

VPFUtil::UInt32 longInt

DATA_TYPE_LONG_INTEGER single val

VPFUtil::UInt32* longIntArray

DATA_TYPE_LONG_INTEGER multiple vals

VPFUtil::Float32 shortFloat

DATA_TYPE_SHORT_FLOAT single val

VPFUtil::Float32* shortFloatArray

DATA_TYPE_SHORT_FLOAT multiple vals

VPFUtil::UInt16 shortInt

DATA_TYPE_SHORT_INTEGER single val

VPFUtil::UInt16* shortIntArray

DATA_TYPE_SHORT_INTEGER multiple vals

char* str

character data if DATA_TYPE_TEXT, DATA_TYPE_TEXT_LATIN, DATA_TYPE_TEXT_FULL_LATIN, DATA_TYPE_TEXT_MULTILINGUAL

DATA_TYPE_TRIPLET VPF triplet single val

VPFUtil::Triplet* tripletArray

DATA_TYPE_TRIPLET VPF triplet multiple vals


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