GL Studio C++ Runtime API
vpf_data_value.h
Go to the documentation of this file.
1 /*! \file
2  \brief The VPFDataValue class.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 #ifndef _VPF_DATA_VALUE_H
41 #define _VPF_DATA_VALUE_H
42 
43 #include "vpf_util.h"
44 
45 namespace disti
46 {
47 // forward ref
48 class VPFFile;
49 
50 /** encapsulates a data value in a VPF table */
52 {
53 public:
54  /** Create and load a data type of the given type and quantity from the given file
55  * \param dataType desired data type
56  * \param numVals number of values in data val (-1 for variable length)
57  * \param infile file to read
58  * \return new data value( Check IsValid() to ensure value was read
59  * successfully ) else NULL
60  */
61  static VPFDataValue* CreateDataValue( const VPFUtil::DataType dataType, const int numVals, VPFFile& infile );
62 
63  /** Dtor
64  */
65  ~VPFDataValue();
66 
67  /** Determine if the data value was created successfully
68  * \return true if created successfully else false
69  */
70  bool IsValid( void ) const { return ( _isValid ); }
71 
72  /** Get the type of the data value
73  * \return type of the data value
74  */
75  VPFUtil::DataType GetDataType( void ) const { return ( _dataType ); }
76 
77  /** Determine if this data value contains multiple values
78  * \return true if data value contains multiple values or is a text value else false
79  */
80  bool IsMultipleValues( void ) const { return ( _isArray ); }
81 
82  /** Get the number of data values contained ( if IsMultipleValues() )
83  * \return number of data values contained if IsMultipleValues() ( can be zero ).
84  * will also return 0u if !IsMultipleValues()
85  * NOTE: This value also represents the string length (not counting terminator) of the contained
86  * text value if _dataType is one of the DATA_TYPE_TEXT_<*> types. A 0u returned in this
87  * case indicates that GetText() will return a NULL pointer.
88  */
89  unsigned int GetValueCount( void ) const { return ( _varLen ); }
90 
91  /** Get text value.
92  * \pre IsValid(), data type is DATA_TYPE_TEXT, DATA_TYPE_TEXT_LATIN, DATA_TYPE_TEXT_FULL_LATIN
93  * or DATA_TYPE_TEXT_MULTILINGUAL
94  * \return text value ( NOTE: can be NULL if a zero length variable length string was read )
95  */
96  const char* GetText( void ) const
97  {
99  return ( _value.str );
100  }
101 
102  /** Get the single short float value
103  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_SHORT_FLOAT
104  * \return short float value
105  */
107  {
108  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_SHORT_FLOAT == _dataType ) );
109  return ( _value.shortFloat );
110  }
111 
112  /** Get multiple short float values
113  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_SHORT_FLOAT
114  * \return array of short float values 'GetValueCount()' long, else NULL if a zero
115  * length array was read.
116  */
118  {
119  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_SHORT_FLOAT == _dataType ) );
120  return ( _value.shortFloatArray );
121  }
122 
123  /** Get the single long float value
124  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_LONG_FLOAT
125  * \return long float value
126  */
128  {
129  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_LONG_FLOAT == _dataType ) );
130  return ( _value.longFloat );
131  }
132 
133  /** Get multiple long float values
134  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_LONG_FLOAT
135  * \return array of long float values 'GetValueCount()' long, else NULL if a zero
136  * length array was read.
137  */
139  {
140  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_LONG_FLOAT == _dataType ) );
141  return ( _value.longFloatArray );
142  }
143 
144  /** Get the single short integer value
145  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_SHORT_INTEGER
146  * \return short integer value
147  */
149  {
150  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_SHORT_INTEGER == _dataType ) );
151  return ( _value.shortInt );
152  }
153 
154  /** Get multiple short integer values
155  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_SHORT_INTEGER
156  * \return array of short integer values 'GetValueCount()' long, else NULL if a zero
157  * length array was read.
158  */
160  {
161  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_SHORT_INTEGER == _dataType ) );
162  return ( _value.shortIntArray );
163  }
164 
165  /** Get the single long integer value
166  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_LONG_INTEGER
167  * \return long integer value
168  */
170  {
171  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_LONG_INTEGER == _dataType ) );
172  return ( _value.longInt );
173  }
174 
175  /** Get multiple long integer values
176  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_LONG_INTEGER
177  * \return array of long integer values 'GetValueCount()' long, else NULL if a zero
178  * length array was read.
179  */
181  {
182  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_LONG_INTEGER == _dataType ) );
183  return ( _value.longIntArray );
184  }
185 
186  /** Get the 2D coordinate short value
187  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_2D_COORD_SHORT
188  * \return 2D coordinate short value
189  */
191  {
192  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_2D_COORD_SHORT == _dataType ) );
193  return ( _value.coord2DShort );
194  }
195 
196  /** Get multiple 2D coordinate short values
197  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_2D_COORD_SHORT
198  * \return array of 2D coordinate short values 'GetValueCount()' long, else NULL if a zero
199  * length array was read.
200  */
202  {
203  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_2D_COORD_SHORT == _dataType ) );
204  return ( _value.coord2DShortArray );
205  }
206 
207  /** Get the 2D coordinate long value
208  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_2D_COORD_LONG
209  * \return 2D coordinate long value
210  */
212  {
213  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_2D_COORD_LONG == _dataType ) );
214  return ( _value.coord2DLong );
215  }
216 
217  /** Get multiple 2D coordinate long values
218  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_2D_COORD_LONG
219  * \return array of 2D coordinate long values 'GetValueCount()' long, else NULL if a zero
220  * length array was read.
221  */
223  {
224  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_2D_COORD_LONG == _dataType ) );
225  return ( _value.coord2DLongArray );
226  }
227 
228  /** Get the 3D coordinate short value
229  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_3D_COORD_SHORT
230  * \return 3D coordinate short value
231  */
233  {
234  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_3D_COORD_SHORT == _dataType ) );
235  return ( _value.coord3DShort );
236  }
237 
238  /** Get multiple 3D coordinate short values
239  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_3D_COORD_SHORT
240  * \return array of 3D coordinate short values 'GetValueCount()' long, else NULL if a zero
241  * length array was read.
242  */
244  {
245  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_3D_COORD_SHORT == _dataType ) );
246  return ( _value.coord3DShortArray );
247  }
248 
249  /** Get the 3D coordinate long value
250  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_3D_COORD_LONG
251  * \return 3D coordinate long value
252  */
254  {
255  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_3D_COORD_LONG == _dataType ) );
256  return ( _value.coord3DLong );
257  }
258 
259  /** Get multiple 3D coordinate long values
260  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_3D_COORD_LONG
261  * \return array of 3D coordinate long values 'GetValueCount()' long, else NULL if a zero
262  * length array was read.
263  */
265  {
266  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_3D_COORD_LONG == _dataType ) );
267  return ( _value.coord3DLongArray );
268  }
269 
270  /** Get the date time value
271  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_DATE_TIME
272  * \return date time value
273  */
274  const VPFUtil::DateTime& GetDateTime( void ) const
275  {
276  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_DATE_TIME == _dataType ) );
277  return ( _value.dateTime );
278  }
279 
280  /** Get multiple date time values
281  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_DATE_TIME
282  * \return array of date time values 'GetValueCount()' long, else NULL if a zero
283  * length array was read.
284  */
286  {
287  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_DATE_TIME == _dataType ) );
288  return ( _value.dateTimeArray );
289  }
290 
291  /** Get the VPF triplet value
292  * \pre IsValid(), !IsMultipleValues(), data type is DATA_TYPE_TRIPLET
293  * \return triplet value
294  */
295  const VPFUtil::Triplet& GetTriplet( void ) const
296  {
297  DistiVPFAssert( _isValid && !_isArray && ( VPFUtil::DATA_TYPE_TRIPLET == _dataType ) );
298  return ( _value.triplet );
299  }
300 
301  /** Get multiple triplet values
302  * \pre IsValid(), IsMultipleValues(), data type is DATA_TYPE_TRIPLET
303  * \return array of triplet values 'GetValueCount()' long, else NULL if a zero
304  * length array was read.
305  */
306  const VPFUtil::Triplet* GetTripletValues( void ) const
307  {
308  DistiVPFAssert( _isValid && _isArray && ( VPFUtil::DATA_TYPE_TRIPLET == _dataType ) );
309  return ( _value.tripletArray );
310  }
311 
312 protected:
313  VPFUtil::WarningBool _isValid; /**< true if valid data value else false */
314  VPFUtil::DataType _dataType; /**< type of data value */
315  bool _isArray; /**< true if array of values else false if single val */
316  unsigned int _varLen; /**< length of text in bytes if data is a text value ( DATA_TYPE_TEXT_<*> ),
317  * else number of elements if multiple vals, 0u if single val */
318  union
319  {
320  char* str; /**< character data if DATA_TYPE_TEXT, DATA_TYPE_TEXT_LATIN,
321  * DATA_TYPE_TEXT_FULL_LATIN, DATA_TYPE_TEXT_MULTILINGUAL */
322  VPFUtil::Float32 shortFloat; /**< DATA_TYPE_SHORT_FLOAT single val */
323  VPFUtil::Float32* shortFloatArray; /**< DATA_TYPE_SHORT_FLOAT multiple vals */
324  VPFUtil::Float64 longFloat; /**< DATA_TYPE_LONG_FLOAT single val */
325  VPFUtil::Float64* longFloatArray; /**< DATA_TYPE_LONG_FLOAT multiple vals */
326  VPFUtil::UInt16 shortInt; /**< DATA_TYPE_SHORT_INTEGER single val */
327  VPFUtil::UInt16* shortIntArray; /**< DATA_TYPE_SHORT_INTEGER multiple vals */
328  VPFUtil::UInt32 longInt; /**< DATA_TYPE_LONG_INTEGER single val */
329  VPFUtil::UInt32* longIntArray; /**< DATA_TYPE_LONG_INTEGER multiple vals */
330  VPFUtil::Coord2DShort coord2DShort; /**< DATA_TYPE_2D_COORD_SHORT single val */
331  VPFUtil::Coord2DShort* coord2DShortArray; /**< DATA_TYPE_2D_COORD_SHORT multiple vals */
332  VPFUtil::Coord2DLong coord2DLong; /**< DATA_TYPE_2D_COORD_LONG single val */
333  VPFUtil::Coord2DLong* coord2DLongArray; /**< DATA_TYPE_2D_COORD_LONG multiple vals */
334  VPFUtil::Coord3DShort coord3DShort; /**< DATA_TYPE_3D_COORD_SHORT single val */
335  VPFUtil::Coord3DShort* coord3DShortArray; /**< DATA_TYPE_3D_COORD_SHORT multiple vals */
336  VPFUtil::Coord3DLong coord3DLong; /**< DATA_TYPE_3D_COORD_LONG single val */
337  VPFUtil::Coord3DLong* coord3DLongArray; /**< DATA_TYPE_3D_COORD_LONG multiple vals */
338  VPFUtil::DateTime dateTime; /**< DATA_TYPE_DATE_TIME single val */
339  VPFUtil::DateTime* dateTimeArray; /**< DATA_TYPE_DATE_TIME multiple vals */
340  VPFUtil::Triplet triplet; /**< DATA_TYPE_TRIPLET VPF triplet single val */
341  VPFUtil::Triplet* tripletArray; /**< DATA_TYPE_TRIPLET VPF triplet multiple vals */
342  } _value;
343 
344  /** Load and create a text value with the given length from the given file and assign the
345  * given data type
346  * \param textType DATA_TYPE_TEXT, DATA_TYPE_TEXT_LATIN, DATA_TYPE_TEXT_FULL_LATIN,
347  * or DATA_TYPE_TEXT_MULTILINGUAL
348  * \param textLen number of bytes of text
349  * \param infile file to read
350  * \return new text value with type DATA_TYPE_TEXT and buffer length (textLen)
351  * plus one for terminator ( Check IsValid() to ensure value was read
352  * successfully ) else NULL
353  */
354  static VPFDataValue* CreateText( const VPFUtil::DataType textType, const unsigned int textLen,
355  VPFFile& infile );
356 
357  /** Load and create a single short float value from the given file
358  * \param infile file to read
359  * \return new value with type DATA_TYPE_SHORT_FLOAT
360  * ( Check IsValid() to ensure value was read successfully ) else NULL
361  */
362  static VPFDataValue* CreateShortFloat( VPFFile& infile );
363 
364  /** Load and create a short float fixed array value from the given file
365  * \param num number of elements in the array
366  * \param infile file to read
367  * \return new value with type DATA_TYPE_SHORT_FLOAT
368  * ( Check IsValid() to ensure value was read successfully ) else NULL
369  */
370  static VPFDataValue* CreateShortFloatFixed( const unsigned int num, VPFFile& infile );
371 
372  /** Load and create a single long float value from the given file
373  * \param infile file to read
374  * \return new value with type DATA_TYPE_LONG_FLOAT
375  * ( Check IsValid() to ensure value was read successfully ) else NULL
376  */
377  static VPFDataValue* CreateLongFloat( VPFFile& infile );
378 
379  /** Load and create a long float fixed array value from the given file
380  * \param num number of elements in the array
381  * \param infile file to read
382  * \return new value with type DATA_TYPE_LONG_FLOAT
383  * ( Check IsValid() to ensure value was read successfully ) else NULL
384  */
385  static VPFDataValue* CreateLongFloatFixed( const unsigned int num, VPFFile& infile );
386 
387  /** Load and create a single short int value from the given file
388  * \param infile file to read
389  * \return new value with type DATA_TYPE_SHORT_INTEGER
390  * ( Check IsValid() to ensure value was read successfully ) else NULL
391  */
392  static VPFDataValue* CreateShortInt( VPFFile& infile );
393 
394  /** Load and create a short int fixed array value from the given file
395  * \param num number of elements in the array
396  * \param infile file to read
397  * \return new value with type DATA_TYPE_SHORT_INTEGER
398  * ( Check IsValid() to ensure value was read successfully ) else NULL
399  */
400  static VPFDataValue* CreateShortIntFixed( const unsigned int num, VPFFile& infile );
401 
402  /** Load and create a single long int value from the given file
403  * \param infile file to read
404  * \return new value with type DATA_TYPE_LONG_INTEGER
405  * ( Check IsValid() to ensure value was read successfully ) else NULL
406  */
407  static VPFDataValue* CreateLongInt( VPFFile& infile );
408 
409  /** Load and create a long int fixed array value from the given file
410  * \param num number of elements in the array
411  * \param infile file to read
412  * \return new value with type DATA_TYPE_LONG_INTEGER
413  * ( Check IsValid() to ensure value was read successfully ) else NULL
414  */
415  static VPFDataValue* CreateLongIntFixed( const unsigned int num, VPFFile& infile );
416 
417  /** Load and create a single 2D coord short value from the given file
418  * \param infile file to read
419  * \return new value with type DATA_TYPE_2D_COORD_SHORT
420  * ( Check IsValid() to ensure value was read successfully ) else NULL
421  */
422  static VPFDataValue* Create2DCoordShort( VPFFile& infile );
423 
424  /** Load and create a 2D coord short fixed array value from the given file
425  * \param num number of elements in the array
426  * \param infile file to read
427  * \return new value with type DATA_TYPE_2D_COORD_SHORT
428  * ( Check IsValid() to ensure value was read successfully ) else NULL
429  */
430  static VPFDataValue* Create2DCoordShortFixed( const unsigned int num, VPFFile& infile );
431 
432  /** Load and create a single 2D coord long value from the given file
433  * \param infile file to read
434  * \return new value with type DATA_TYPE_2D_COORD_LONG
435  * ( Check IsValid() to ensure value was read successfully ) else NULL
436  */
437  static VPFDataValue* Create2DCoordLong( VPFFile& infile );
438 
439  /** Load and create a 2D coord long fixed array value from the given file
440  * \param num number of elements in the array
441  * \param infile file to read
442  * \return new value with type DATA_TYPE_2D_COORD_LONG
443  * ( Check IsValid() to ensure value was read successfully ) else NULL
444  */
445  static VPFDataValue* Create2DCoordLongFixed( const unsigned int num, VPFFile& infile );
446 
447  /** Load and create a single 3D coord short value from the given file
448  * \param infile file to read
449  * \return new value with type DATA_TYPE_3D_COORD_SHORT
450  * ( Check IsValid() to ensure value was read successfully ) else NULL
451  */
452  static VPFDataValue* Create3DCoordShort( VPFFile& infile );
453 
454  /** Load and create a 3D coord short fixed array value from the given file
455  * \param num number of elements in the array
456  * \param infile file to read
457  * \return new value with type DATA_TYPE_3D_COORD_SHORT
458  * ( Check IsValid() to ensure value was read successfully ) else NULL
459  */
460  static VPFDataValue* Create3DCoordShortFixed( const unsigned int num, VPFFile& infile );
461 
462  /** Load and create a single 3D coord long value from the given file
463  * \param infile file to read
464  * \return new value with type DATA_TYPE_3D_COORD_LONG
465  * ( Check IsValid() to ensure value was read successfully ) else NULL
466  */
467  static VPFDataValue* Create3DCoordLong( VPFFile& infile );
468 
469  /** Load and create a 3D coord long fixed array value from the given file
470  * \param num number of elements in the array
471  * \param infile file to read
472  * \return new value with type DATA_TYPE_3D_COORD_LONG
473  * ( Check IsValid() to ensure value was read successfully ) else NULL
474  */
475  static VPFDataValue* Create3DCoordLongFixed( const unsigned int num, VPFFile& infile );
476 
477  /** Load and create a single date time value from the given file
478  * \param infile file to read
479  * \return new value with type DATA_TYPE_DATE_TIME
480  * ( Check IsValid() to ensure value was read successfully ) else NULL
481  */
482  static VPFDataValue* CreateDateTime( VPFFile& infile );
483 
484  /** Load and create a date time fixed array value from the given file
485  * \param num number of elements in the array
486  * \param infile file to read
487  * \return new value with type DATA_TYPE_DATE_TIME
488  * ( Check IsValid() to ensure value was read successfully ) else NULL
489  */
490  static VPFDataValue* CreateDateTimeFixed( const unsigned int num, VPFFile& infile );
491 
492  /** Create a null data value
493  * \return new value with type DATA_TYPE_NULL else (NULL)
494  */
495  static VPFDataValue* CreateNull( void );
496 
497  /** Load and create a VPF triplet value from the given file
498  * \param infile file to read
499  * \return new value with type DATA_TYPE_TRIPLET
500  * ( Check IsValid() to ensure value was read successfully ) else NULL
501  */
502  static VPFDataValue* CreateTriplet( VPFFile& infile );
503 
504  /** Load and create a VPF triplet fixed array value from the given file
505  * \param num number of elements in the array
506  * \param infile file to read
507  * \return new value with type DATA_TYPE_TRIPLET
508  * ( Check IsValid() to ensure value was read successfully ) else NULL
509  */
510  static VPFDataValue* CreateTripletFixed( const unsigned int num, VPFFile& infile );
511 
512  /** Read a VPF triplet from the given file
513  * \param infile file to read
514  * \param dst [out] gets read triplet on success
515  * \return true if success else false
516  */
517  static bool ReadTriplet( VPFFile& infile, VPFUtil::Triplet& dst );
518 
519  /** Read one value in a triplet value from the given file
520  * \param infile file to read
521  * \param type indicates number of bits in field to read ( 0 = 0bits, 1 = 8bits, 2 = 16bits, 3=32bits )
522  * \param val [out] receives value read from file on success else 0u
523  * \param isValid [out] receives true if a non zero bits value was read into 'val' else false
524  * \return true on success else false
525  */
526  static bool ReadTripletValue( VPFFile& infile, const unsigned char type, VPFUtil::UInt32& val, bool& isValid );
527 
528  /** Ctor - not called by user directly (use static Create* methods)
529  * \param dataType data type for new value
530  */
531  VPFDataValue( const VPFUtil::DataType dataType )
532  : _isValid( false )
533  , _dataType( dataType )
534  , _isArray( false )
535  , _varLen( 0u )
536  {}
537 
538 private:
539  // Disable implicit generated members
540  VPFDataValue& operator=( const VPFDataValue& rhs );
541  VPFDataValue( const VPFDataValue& src );
542 };
543 
544 } // end namespace disti
545 
546 #endif // _VPF_DATA_VALUE_H
VPFUtil::Float32 * shortFloatArray
Definition: vpf_data_value.h:323
VPFUtil::UInt16 shortInt
Definition: vpf_data_value.h:326
static VPFDataValue * CreateLongIntFixed(const unsigned int num, VPFFile &infile)
Definition: vpf_util.h:217
Definition: vpf_util.h:151
Definition: vpf_util.h:147
unsigned int UInt32
Definition: vpf_util.h:135
VPFUtil::DataType GetDataType(void) const
Definition: vpf_data_value.h:75
VPFUtil::Float32 GetShortFloat(void) const
Definition: vpf_data_value.h:106
VPFUtil::Triplet * tripletArray
Definition: vpf_data_value.h:341
VPFUtil::UInt32 longInt
Definition: vpf_data_value.h:328
VPFUtil::Coord2DShort coord2DShort
Definition: vpf_data_value.h:330
Definition: vpf_util.h:230
const VPFUtil::DateTime & GetDateTime(void) const
Definition: vpf_data_value.h:274
VPFUtil::Coord3DLong * coord3DLongArray
Definition: vpf_data_value.h:337
VPFUtil::Coord2DLong * coord2DLongArray
Definition: vpf_data_value.h:333
static VPFDataValue * Create3DCoordShortFixed(const unsigned int num, VPFFile &infile)
const VPFUtil::Coord2DLong & GetCoord2DLong(void) const
Definition: vpf_data_value.h:211
static VPFDataValue * CreateLongFloatFixed(const unsigned int num, VPFFile &infile)
Definition: vpf_util.h:159
unsigned short UInt16
Definition: vpf_util.h:134
const VPFUtil::Coord2DShort * GetCoord2DShortValues(void) const
Definition: vpf_data_value.h:201
VPFDataValue(const VPFUtil::DataType dataType)
Definition: vpf_data_value.h:531
Definition: vpf_util.h:161
Util functions for VPF.
VPFUtil::DataType _dataType
Definition: vpf_data_value.h:314
VPFUtil::UInt16 GetShortInteger(void) const
Definition: vpf_data_value.h:148
static bool ReadTripletValue(VPFFile &infile, const unsigned char type, VPFUtil::UInt32 &val, bool &isValid)
char * str
Definition: vpf_data_value.h:320
VPFUtil::UInt16 * shortIntArray
Definition: vpf_data_value.h:327
static VPFDataValue * CreateShortInt(VPFFile &infile)
const VPFUtil::Coord3DLong * GetCoord3DLongValues(void) const
Definition: vpf_data_value.h:264
static VPFDataValue * Create2DCoordShortFixed(const unsigned int num, VPFFile &infile)
static VPFDataValue * CreateShortIntFixed(const unsigned int num, VPFFile &infile)
static VPFDataValue * CreateShortFloat(VPFFile &infile)
Definition: vpf_util.h:154
VPFUtil::Coord3DShort * coord3DShortArray
Definition: vpf_data_value.h:335
Definition: vpf_util.h:199
VPFUtil::Float64 * longFloatArray
Definition: vpf_data_value.h:325
VPFUtil::DateTime dateTime
Definition: vpf_data_value.h:338
static VPFDataValue * CreateNull(void)
static VPFDataValue * Create2DCoordLong(VPFFile &infile)
VPFUtil::Coord2DShort * coord2DShortArray
Definition: vpf_data_value.h:331
const VPFUtil::Triplet * GetTripletValues(void) const
Definition: vpf_data_value.h:306
const VPFUtil::Coord2DLong * GetCoord2DLongValues(void) const
Definition: vpf_data_value.h:222
const VPFUtil::Coord2DShort & GetCoord2DShort(void) const
Definition: vpf_data_value.h:190
double Float64
Definition: vpf_util.h:133
unsigned int GetValueCount(void) const
Definition: vpf_data_value.h:89
static VPFDataValue * CreateDateTime(VPFFile &infile)
DataType
Definition: vpf_util.h:145
Definition: vpf_util.h:152
bool _isArray
Definition: vpf_data_value.h:315
VPFUtil::Coord3DShort coord3DShort
Definition: vpf_data_value.h:334
VPFUtil::WarningBool _isValid
Definition: vpf_data_value.h:313
Definition: vpf_data_value.h:51
Definition: vpf_util.h:158
Definition: vpf_util.h:153
VPFUtil::Float64 longFloat
Definition: vpf_data_value.h:324
Definition: vpf_util.h:148
static VPFDataValue * Create3DCoordShort(VPFFile &infile)
VPFUtil::Float32 shortFloat
Definition: vpf_data_value.h:322
VPFUtil::Coord3DLong coord3DLong
Definition: vpf_data_value.h:336
const VPFUtil::Float32 * GetShortFloatValues(void) const
Definition: vpf_data_value.h:117
const VPFUtil::UInt16 * GetShortIntegerValues(void) const
Definition: vpf_data_value.h:159
Definition: vpf_util.h:193
const VPFUtil::DateTime * GetDateTimeValues(void) const
Definition: vpf_data_value.h:285
static VPFDataValue * CreateTriplet(VPFFile &infile)
static VPFDataValue * CreateLongFloat(VPFFile &infile)
bool IsValid(void) const
Definition: vpf_data_value.h:70
static VPFDataValue * Create3DCoordLong(VPFFile &infile)
float Float32
Definition: vpf_util.h:132
const char * GetText(void) const
Definition: vpf_data_value.h:96
unsigned int _varLen
Definition: vpf_data_value.h:316
VPFUtil::DateTime * dateTimeArray
Definition: vpf_data_value.h:339
static VPFDataValue * CreateDateTimeFixed(const unsigned int num, VPFFile &infile)
static VPFDataValue * CreateLongInt(VPFFile &infile)
const VPFUtil::Float64 * GetLongFloatValues(void) const
Definition: vpf_data_value.h:138
static VPFDataValue * Create2DCoordShort(VPFFile &infile)
static VPFDataValue * CreateTripletFixed(const unsigned int num, VPFFile &infile)
Definition: vpf_util.h:211
static VPFDataValue * Create2DCoordLongFixed(const unsigned int num, VPFFile &infile)
static VPFDataValue * Create3DCoordLongFixed(const unsigned int num, VPFFile &infile)
VPFUtil::UInt32 GetLongInteger(void) const
Definition: vpf_data_value.h:169
const VPFUtil::UInt32 * GetLongIntegerValues(void) const
Definition: vpf_data_value.h:180
const VPFUtil::Coord3DShort & GetCoord3DShort(void) const
Definition: vpf_data_value.h:232
static VPFDataValue * CreateText(const VPFUtil::DataType textType, const unsigned int textLen, VPFFile &infile)
const VPFUtil::Triplet & GetTriplet(void) const
Definition: vpf_data_value.h:295
Definition: vpf_util.h:205
static VPFDataValue * CreateShortFloatFixed(const unsigned int num, VPFFile &infile)
VPFUtil::Float64 GetLongFloat(void) const
Definition: vpf_data_value.h:127
static VPFDataValue * CreateDataValue(const VPFUtil::DataType dataType, const int numVals, VPFFile &infile)
const VPFUtil::Coord3DLong & GetCoord3DLong(void) const
Definition: vpf_data_value.h:253
VPFUtil::Triplet triplet
Definition: vpf_data_value.h:340
VPFUtil::UInt32 * longIntArray
Definition: vpf_data_value.h:329
static bool ReadTriplet(VPFFile &infile, VPFUtil::Triplet &dst)
bool IsMultipleValues(void) const
Definition: vpf_data_value.h:80
VPFUtil::Coord2DLong coord2DLong
Definition: vpf_data_value.h:332
Definition: bmpimage.h:46
const VPFUtil::Coord3DShort * GetCoord3DShortValues(void) const
Definition: vpf_data_value.h:243
Definition: vpf_util.h:156