MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
LTIMetadataRecord Class Reference

representation of a metadata record More...

#include <lti_metadataRecord.h>

Public Member Functions

 LTIMetadataRecord (LTIMetadataTag tag, LTIMetadataDataType type, const void *data)
 default constructor for scalar data More...
 
 LTIMetadataRecord (const char *tagName, LTIMetadataDataType type, const void *data)
 default constructor for scalar data More...
 
 LTIMetadataRecord (LTIMetadataTag tag, LTIMetadataDataType type, const void *data, lt_uint32 vecLen)
 default constructor for vector data More...
 
 LTIMetadataRecord (const char *tagName, LTIMetadataDataType type, const void *data, lt_uint32 vecLen)
 default constructor for vector data More...
 
 LTIMetadataRecord (LTIMetadataTag tag, LTIMetadataDataType type, const void *data, lt_uint32 numDims, const lt_uint32 *dims)
 default constructor for array data More...
 
 LTIMetadataRecord (const char *tagName, LTIMetadataDataType type, const void *data, lt_uint32 numDims, const lt_uint32 *dims)
 default constructor for array data More...
 
 LTIMetadataRecord (const LTIMetadataRecord &)
 copy constructor More...
 
 ~LTIMetadataRecord ()
 destructor More...
 
LTIMetadataTag getTag () const
 get tag More...
 
const char * getTagName () const
 get tag name More...
 
LTIMetadataDataType getDataType () const
 get datatype More...
 
lt_uint32 getNumDims () const
 get number of dimensions of the data set More...
 
const lt_uint32getDims () const
 get dimensionality of the data set More...
 
lt_uint32 getNumValues (void) const
 
bool isScalar () const
 is dataset a scalar? More...
 
bool isVector () const
 is dataset a vector? More...
 
bool isArray () const
 is dataset an array? More...
 
const void * getScalarData () const
 get scalar data value More...
 
const void * getVectorData (lt_uint32 &vecLen) const
 get vector data values More...
 
const void * getArrayData (lt_uint32 &numDims, const lt_uint32 *&dims) const
 get array data values More...
 
lt_int32 getApproximateSize () const
 get size of metadata record More...
 

Detailed Description

This class stores the data associated with a single record in the database. The data consists of:

  • the tag (a string), used to uniquely identify the record
  • the type of the data, e.g. string, byte, etc
  • the dimensionality of the data, e.g. scalar, 2x3 array, etc
  • the actual data

It is assumed each record has only a single set of data of a single datatype. (That is, a record can't contain both a float and two ints.)

Some of the functions for operating on records are cast in the guise of scalar, vector, or array data. This is for notational convenience only; the internal representation does not distinguish and treats everything as a (possibly degenerate) array.

Examples:
MetadataDump.cpp.

Definition at line 47 of file lti_metadataRecord.h.

Constructor & Destructor Documentation

LTIMetadataRecord::LTIMetadataRecord ( LTIMetadataTag  tag,
LTIMetadataDataType  type,
const void *  data 
)

The constructor creates a record containing a scalar data value.

Note that the object makes a local copy of the data passed into the record.

Parameters
tagthe tag number of the record
typedatatype of the data in the record
datapointer to the data to insert into the record
LTIMetadataRecord::LTIMetadataRecord ( const char *  tagName,
LTIMetadataDataType  type,
const void *  data 
)

The constructor creates a record containing a scalar data value.

Note that the object makes a local copy of the data passed into the record.

Parameters
tagNamethe tag number of the record
typedatatype of the data in the record
datapointer to the data to insert into the record
LTIMetadataRecord::LTIMetadataRecord ( LTIMetadataTag  tag,
LTIMetadataDataType  type,
const void *  data,
lt_uint32  vecLen 
)

The constructor creates a record containing a vector of data values.

Note that the object makes a local copy of the data passed into the record.

Parameters
tagthe tag number of the record
typedatatype of the data in the record
datapointer to the data to insert into the record
vecLenthe length of the data vector
LTIMetadataRecord::LTIMetadataRecord ( const char *  tagName,
LTIMetadataDataType  type,
const void *  data,
lt_uint32  vecLen 
)

The constructor creates a record containing a vector of data values.

Note that the object makes a local copy of the data passed into the record.

Parameters
tagNamethe tag number of the record
typedatatype of the data in the record
datapointer to the data to insert into the record
vecLenthe length of the data vector
LTIMetadataRecord::LTIMetadataRecord ( LTIMetadataTag  tag,
LTIMetadataDataType  type,
const void *  data,
lt_uint32  numDims,
const lt_uint32 dims 
)

The constructor creates a record containing an array of data values.

Note that the object makes a local copy of the data passed into the record.

Parameters
tagthe tag number of the record
typedatatype of the data in the record
datapointer to the data to insert into the record
numDimsthe length of the dims array
dimsthe dimensionality of the data
LTIMetadataRecord::LTIMetadataRecord ( const char *  tagName,
LTIMetadataDataType  type,
const void *  data,
lt_uint32  numDims,
const lt_uint32 dims 
)

The constructor creates a record containing an array of data values.

Note that the object makes a local copy of the data passed into the record.

Parameters
tagNamethe tag number of the record
typedatatype of the data in the record
datapointer to the data to insert into the record
numDimsthe length of the dims array
dimsthe dimensionality of the data
LTIMetadataRecord::LTIMetadataRecord ( const LTIMetadataRecord )
LTIMetadataRecord::~LTIMetadataRecord ( )

Member Function Documentation

lt_int32 LTIMetadataRecord::getApproximateSize ( ) const

This function will return a close-enough estimate of the size of the record, as if it were to be written directly to disk.

Returns
size in bytes of the record
const void* LTIMetadataRecord::getArrayData ( lt_uint32 numDims,
const lt_uint32 *&  dims 
) const

This function returns the record's data as an array of values.

Note the function returns via its parameters the same information as getNumDims() and getDims().

The user is responsible for casting the returned value to an array of the correct datatype.

Parameters
numDimsthe number of dimensions in the dims parameter
dimsthe dimensionality array
Returns
a pointer to the array of data values
Examples:
MetadataDump.cpp.
LTIMetadataDataType LTIMetadataRecord::getDataType ( ) const

This function returns the datatype of the data in the record.

Returns
the datatype
Examples:
MetadataDump.cpp.
const lt_uint32* LTIMetadataRecord::getDims ( ) const

This function returns an array with the length of each dimension of the dataset.

For example, a 2x3 dataset would return an array of length two with the values {2,3}.

This is the length of the returned array is equal to getNumDims().

Returns
the number of dimensions
Examples:
MetadataDump.cpp.
lt_uint32 LTIMetadataRecord::getNumDims ( ) const

This function returns the number of dimensions in the dimensionality of the dataset.

This is the length of the array returned by the getDims() function.

Returns
the number of dimensions
Examples:
MetadataDump.cpp.
lt_uint32 LTIMetadataRecord::getNumValues ( void  ) const
const void* LTIMetadataRecord::getScalarData ( ) const

This function returns the record's data as a scalar value. It is the caller's responsibility to assure that the record does indeed contain a scalar dataset.

The user is responsible for casting the returned value to the correct datatype.

Returns
a pointer to the scalar data value
Examples:
MetadataDump.cpp.
LTIMetadataTag LTIMetadataRecord::getTag ( ) const

This function returns the tag number (enum) associated with the record.

Returns
the tag
const char* LTIMetadataRecord::getTagName ( ) const

This function returns the tag name (string) associated with the record.

Returns
the tag name
Examples:
MetadataDump.cpp.
const void* LTIMetadataRecord::getVectorData ( lt_uint32 vecLen) const

This function returns the record's data as a vector of values. It is the caller's responsibility to assure that the record does indeed contain a vector dataset.

The user is responsible for casting the returned value to an array of the correct datatype.

Parameters
vecLenthe length of the returned vector
Returns
a pointer to the vector of data values
Examples:
MetadataDump.cpp.
bool LTIMetadataRecord::isArray ( ) const

This function always returns true.

Returns
true
Examples:
MetadataDump.cpp.
bool LTIMetadataRecord::isScalar ( ) const

This function returns true iff the record's dataset consists only of a single element.

Returns
true if record data is a scalar value
Examples:
MetadataDump.cpp.
bool LTIMetadataRecord::isVector ( ) const

This function returns true iff the record's dataset is a 1-D array.

Returns
true if record data is a vector of values
Examples:
MetadataDump.cpp.

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

LizardTech