MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
LTIMetadataRecord Class Reference

representation of a metadata record More...

#include <lti_metadataRecord.h>

List of all members.

Public Member Functions

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

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

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

Member Function Documentation

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.

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

Returns:
the datatype
Examples:
MetadataDump.cpp.

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.

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.
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.

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.

This function always returns true.

Returns:
true
Examples:
MetadataDump.cpp.

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.

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: