Ptex: PtexReader::MetaData Class Reference

Ptex

Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
PtexReader::MetaData Class Reference

`#include <PtexReader.h>`

Inheritance diagram for PtexReader::MetaData:

## Classes
struct | Entry
class | LargeMetaData

## Public Member Functions
| MetaData (PtexReader *reader)
| ~MetaData ()
virtual void | release ()
| Release resources held by this pointer (pointer becomes invalid).
virtual int | numKeys ()
| Query number of meta data entries stored in file.
virtual void | getKey (int index, const char *&key, MetaDataType &type)
virtual bool | findKey (const char *key, int &index, MetaDataType &type)
virtual void | getValue (const char *key, const char *&value)
| Query the value of a given meta data entry.
virtual void | getValue (int index, const char *&value)
| Query the value of a given meta data entry by index.
template<typename T >
void | getValue (int index, MetaDataType requestedType, const T *&value, int &count)
template<typename T >
void | getValue (const char *key, MetaDataType requestedType, const T *&value, int &count)
virtual void | getValue (const char *key, const int8_t *&value, int &count)
| Query the value of a given meta data entry.
virtual void | getValue (int index, const int8_t *&value, int &count)
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const int16_t *&value, int &count)
| Query the value of a given meta data entry.
virtual void | getValue (int index, const int16_t *&value, int &count)
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const int32_t *&value, int &count)
| Query the value of a given meta data entry.
virtual void | getValue (int index, const int32_t *&value, int &count)
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const float *&value, int &count)
| Query the value of a given meta data entry.
virtual void | getValue (int index, const float *&value, int &count)
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const double *&value, int &count)
| Query the value of a given meta data entry.
virtual void | getValue (int index, const double *&value, int &count)
| Query the value of a given meta data entry by index.
void | addEntry (uint8_t keysize, const char *key, uint8_t datatype, uint32_t datasize, const void *data, size_t &metaDataMemUsed)
void | addLmdEntry (uint8_t keysize, const char *key, uint8_t datatype, uint32_t datasize, FilePos filepos, uint32_t zipsize, size_t &metaDataMemUsed)
size_t | selfDataSize ()
Public Member Functions inherited from PtexMetaData
virtual void | release ()=0
| Release resources held by this pointer (pointer becomes invalid).
virtual int | numKeys ()=0
| Query number of meta data entries stored in file.
virtual void | getKey (int index, const char *&key, Ptex::MetaDataType &type)=0
| Query the name and type of a meta data entry.
virtual bool | findKey (const char *key, int &index, Ptex::MetaDataType &type)=0
| Query the index and type of a meta data entry by name.
virtual void | getValue (const char *key, const char *&value)=0
| Query the value of a given meta data entry.
virtual void | getValue (int index, const char *&value)=0
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const int8_t *&value, int &count)=0
| Query the value of a given meta data entry.
virtual void | getValue (int index, const int8_t *&value, int &count)=0
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const int16_t *&value, int &count)=0
| Query the value of a given meta data entry.
virtual void | getValue (int index, const int16_t *&value, int &count)=0
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const int32_t *&value, int &count)=0
| Query the value of a given meta data entry.
virtual void | getValue (int index, const int32_t *&value, int &count)=0
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const float *&value, int &count)=0
| Query the value of a given meta data entry.
virtual void | getValue (int index, const float *&value, int &count)=0
| Query the value of a given meta data entry by index.
virtual void | getValue (const char *key, const double *&value, int &count)=0
| Query the value of a given meta data entry.
virtual void | getValue (int index, const double *&value, int &count)=0
| Query the value of a given meta data entry by index.

## Protected Types
typedef std::map< std::string, Entry > | MetaMap

## Protected Member Functions
Entry * | newEntry (uint8_t keysize, const char *key, uint8_t datatype, uint32_t datasize, size_t &metaDataMemUsed)
Entry * | getEntry (int index)
Protected Member Functions inherited from PtexMetaData
virtual | ~PtexMetaData ()
| Destructor not for public use. Use release() instead.

## Protected Attributes
PtexReader * | _reader
MetaMap | _map
std::vector< Entry * > | _entries

## Detailed Description

Definition at line 120 of file PtexReader.h.

## Member Typedef Documentation

## ◆ MetaMap

typedef std::map<std::string, Entry> PtexReader::MetaData::MetaMap
| protected

Definition at line 339 of file PtexReader.h.

## Constructor & Destructor Documentation

## ◆ MetaData()

PtexReader::MetaData::MetaData | ( | PtexReader * | reader | ) |
| inline

Definition at line 122 of file PtexReader.h.

## ◆ ~MetaData()

PtexReader::MetaData::~MetaData | ( |  | ) |
| inline

Definition at line 124 of file PtexReader.h.

## Member Function Documentation

## ◆ addEntry()

void PtexReader::MetaData::addEntry | ( | uint8_t | keysize,
|  | const char * | key,
|  | uint8_t | datatype,
|  | uint32_t | datasize,
|  | const void * | data,
|  | size_t & | metaDataMemUsed
| ) |  |
| inline

Definition at line 246 of file PtexReader.h.

References PtexReader::MetaData::Entry::data, PtexReader::datatype(), and newEntry().

Referenced by PtexReader::readMetaDataBlock().

## ◆ addLmdEntry()

void PtexReader::MetaData::addLmdEntry | ( | uint8_t | keysize,
|  | const char * | key,
|  | uint8_t | datatype,
|  | uint32_t | datasize,
|  | FilePos | filepos,
|  | uint32_t | zipsize,
|  | size_t & | metaDataMemUsed
| ) |  |
| inline

Definition at line 255 of file PtexReader.h.

References PtexReader::datatype(), PtexReader::MetaData::Entry::isLmd, PtexReader::MetaData::Entry::lmdData, PtexReader::MetaData::Entry::lmdPos, PtexReader::MetaData::Entry::lmdZipSize, and newEntry().

Referenced by PtexReader::readLargeMetaDataHeaders().

## ◆ findKey()

virtual bool PtexReader::MetaData::findKey | ( | const char * | key,
|  | int & | index,
|  | MetaDataType & | type
| ) |  |
| inlinevirtual

Definition at line 138 of file PtexReader.h.

References _map.

Referenced by getValue().

## ◆ getEntry()

PtexReader::MetaData::Entry * PtexReader::MetaData::getEntry | ( | int | index | ) |
| protected

Definition at line 343 of file PtexReader.cpp.

References _entries, _reader, PtexReader::MetaData::LargeMetaData::data(), PtexReader::MetaData::Entry::data, PtexReader::MetaData::Entry::datasize, PtexReader::increaseMemUsed(), PtexReader::MetaData::Entry::isLmd, PtexReader::MetaData::Entry::lmdData, PtexReader::MetaData::Entry::lmdPos, PtexReader::MetaData::Entry::lmdZipSize, PtexReader::readlock, PtexReader::readZipBlock(), and PtexReader::seek().

Referenced by getValue().

## ◆ getKey()

virtual void PtexReader::MetaData::getKey | ( | int | index,
|  | const char *& | key,
|  | MetaDataType & | type
| ) |  |
| inlinevirtual

Definition at line 128 of file PtexReader.h.

References _entries, PtexReader::MetaData::Entry::key, and PtexReader::MetaData::Entry::type.

## ◆ getValue() [1/14]

virtual void PtexReader::MetaData::getValue | ( | const char * | key,
|  | const char *& | value
| ) |  |
| inlinevirtual

Query the value of a given meta data entry.

If the key doesn't exist or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 150 of file PtexReader.h.

References PtexReader::MetaData::Entry::data, findKey(), getEntry(), and PtexReader::MetaData::Entry::type.

## ◆ getValue() [2/14]

virtual void PtexReader::MetaData::getValue | ( | const char * | key,
|  | const double *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry.

If the key doesn't exist or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 236 of file PtexReader.h.

## ◆ getValue() [3/14]

virtual void PtexReader::MetaData::getValue | ( | const char * | key,
|  | const float *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry.

If the key doesn't exist or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 226 of file PtexReader.h.

## ◆ getValue() [4/14]

virtual void PtexReader::MetaData::getValue | ( | const char * | key,
|  | const int16_t *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry.

If the key doesn't exist or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 206 of file PtexReader.h.

## ◆ getValue() [5/14]

virtual void PtexReader::MetaData::getValue | ( | const char * | key,
|  | const int32_t *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry.

If the key doesn't exist or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 216 of file PtexReader.h.

## ◆ getValue() [6/14]

virtual void PtexReader::MetaData::getValue | ( | const char * | key,
|  | const int8_t *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry.

If the key doesn't exist or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 196 of file PtexReader.h.

## ◆ getValue() [7/14]

template<typename T >

void PtexReader::MetaData::getValue | ( | const char * | key,
|  | MetaDataType | requestedType,
|  | const T *& | value,
|  | int & | count
| ) |  |
| inline

Definition at line 188 of file PtexReader.h.

References findKey().

## ◆ getValue() [8/14]

virtual void PtexReader::MetaData::getValue | ( | int | index,
|  | const char *& | value
| ) |  |
| inlinevirtual

Query the value of a given meta data entry by index.

If the index is out of range or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 163 of file PtexReader.h.

References _entries, PtexReader::MetaData::Entry::data, getEntry(), and PtexReader::MetaData::Entry::type.

## ◆ getValue() [9/14]

virtual void PtexReader::MetaData::getValue | ( | int | index,
|  | const double *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry by index.

If the index is out of range or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 241 of file PtexReader.h.

## ◆ getValue() [10/14]

virtual void PtexReader::MetaData::getValue | ( | int | index,
|  | const float *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry by index.

If the index is out of range or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 231 of file PtexReader.h.

## ◆ getValue() [11/14]

virtual void PtexReader::MetaData::getValue | ( | int | index,
|  | const int16_t *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry by index.

If the index is out of range or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 211 of file PtexReader.h.

## ◆ getValue() [12/14]

virtual void PtexReader::MetaData::getValue | ( | int | index,
|  | const int32_t *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry by index.

If the index is out of range or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 221 of file PtexReader.h.

## ◆ getValue() [13/14]

virtual void PtexReader::MetaData::getValue | ( | int | index,
|  | const int8_t *& | value,
|  | int & | count
| ) |  |
| inlinevirtual

Query the value of a given meta data entry by index.

If the index is out of range or the type doesn't match, value is set to null

Implements PtexMetaData.

Definition at line 201 of file PtexReader.h.

## ◆ getValue() [14/14]

template<typename T >

void PtexReader::MetaData::getValue | ( | int | index,
|  | MetaDataType | requestedType,
|  | const T *& | value,
|  | int & | count
| ) |  |
| inline

Definition at line 172 of file PtexReader.h.

References _entries, PtexReader::MetaData::Entry::data, PtexReader::MetaData::Entry::datasize, getEntry(), and PtexReader::MetaData::Entry::type.

## ◆ newEntry()

Entry * PtexReader::MetaData::newEntry | ( | uint8_t | keysize,
|  | const char * | key,
|  | uint8_t | datatype,
|  | uint32_t | datasize,
|  | size_t & | metaDataMemUsed
| ) |  |
| inlineprotected

Definition at line 313 of file PtexReader.h.

References _entries, _map, PtexReader::MetaData::Entry::clear(), PtexReader::MetaData::Entry::datasize, PtexReader::datatype(), PtexReader::MetaData::Entry::index, PtexReader::MetaData::Entry::key, and PtexReader::MetaData::Entry::type.

Referenced by addEntry(), and addLmdEntry().

## ◆ numKeys()

virtual int PtexReader::MetaData::numKeys | ( |  | ) |
| inlinevirtual

Query number of meta data entries stored in file.

Implements PtexMetaData.

Definition at line 127 of file PtexReader.h.

References _entries.

## ◆ release()

virtual void PtexReader::MetaData::release | ( |  | ) |
| inlinevirtual

Release resources held by this pointer (pointer becomes invalid).

Implements PtexMetaData.

Definition at line 125 of file PtexReader.h.

## ◆ selfDataSize()

size_t PtexReader::MetaData::selfDataSize | ( |  | ) |
| inline

Definition at line 266 of file PtexReader.h.

References _entries.

Referenced by PtexReader::readMetaData().

## Member Data Documentation

## ◆ _entries

std::vector<Entry*> PtexReader::MetaData::_entries
| protected

Definition at line 341 of file PtexReader.h.

Referenced by getEntry(), getKey(), getValue(), newEntry(), numKeys(), and selfDataSize().

## ◆ _map

MetaMap PtexReader::MetaData::_map
| protected

Definition at line 340 of file PtexReader.h.

Referenced by findKey(), and newEntry().

## ◆ _reader

PtexReader* PtexReader::MetaData::_reader
| protected

Definition at line 338 of file PtexReader.h.

Referenced by getEntry().

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

- PtexReader.h
- PtexReader.cpp