Metadata Class Reference
Metadata is a container for storing metadata about the point cloud.
More...
#include <Metadata.h>
List of all members.
|
Public Member Functions |
| ~Metadata (void) |
| Metadata (void) |
size_t | getNumRecords (void) const |
| Get the number of key-value pairs.
|
bool | has (const char *key) const |
| Determine if there is a key-value pair with a given key.
|
void | get (size_t idx, const char *&key, const char *&description, MetadataDataType &datatype, const void *&value, size_t &length) const |
| Get the key-value pair at a given index.
|
bool | get (const char *key, const char *&description, MetadataDataType &datatype, const void *&value, size_t &length) const |
| Get the key-value pair with a given key.
|
size_t | getKeyIndex (const char *key) const |
| Find the index of the key-value pair with the given key.
|
const char * | getKey (size_t idx) const |
| Get the key name for the given index.
|
const char * | getDescription (size_t idx) const |
| Get the description for the given index.
|
MetadataDataType | getDataType (size_t idx) const |
| Get the datatype for the given index.
|
const void * | getValue (size_t idx) const |
| Get the data buffer for the given index.
|
size_t | getValueLength (size_t idx) const |
| Get the data buffer length for the given index.
|
void | add (const char *key, const char *description, MetadataDataType datatype, const void *value, size_t length) |
| Add a key-value pair.
|
void | add (const Metadata &meta) |
| Add all the key-value pairs from the given Metadata object.
|
void | remove (void) |
| Remove all key-value pairs.
|
void | remove (size_t idx) |
| Remove the key-value pair at a given index.
|
void | remove (const char *key) |
| Remove the first key-value pair with key.
|
void | sort (void) |
| Sort the pairs.
|
void | read (StreamReader &stream) |
| Wirte metadata to a stream.
|
void | write (StreamWriter &stream) const |
| Read metadata from a stream.
|
void | dump (FILE *file) const |
| Write the metadata in a human readable format.
|
Protected Attributes |
RecordStore * | m_records |
Detailed Description
The
Metadata class is a Key-Value container for storing metadata about the point cloud. It can hold three data types Strings, Arrays of Doubles and Raw binary data (Blobs).
- See also:
- See examples/src/DumpMG4Info.cpp dumpMetadata() for an example of using this class.
Definition at line 64 of file Metadata.h.
Constructor & Destructor Documentation
Metadata::~Metadata |
( |
void |
|
) |
|
Metadata::Metadata |
( |
void |
|
) |
|
Member Function Documentation
size_t Metadata::getNumRecords |
( |
void |
|
) |
const |
This method returns the number of key-value pairs.
bool Metadata::has |
( |
const char * |
key |
) |
const |
The method determines if this object has a pair with the given key.
- Parameters:
-
- Returns:
- true if the key was found
void Metadata::get |
( |
size_t |
idx, |
|
|
const char *& |
key, |
|
|
const char *& |
description, |
|
|
MetadataDataType & |
datatype, |
|
|
const void *& |
value, |
|
|
size_t & |
length | |
|
) |
| | const |
This method retrieves the idx'th key-value pair. The last 5 arguments are output parameters.
- Parameters:
-
| idx | the index of the key-value pair |
| key | the key name |
| description | a short description of the metadata (can by NULL) |
| datatype | the data type of the value array |
| value | the value array |
| length | number of elements in the value array. |
bool Metadata::get |
( |
const char * |
key, |
|
|
const char *& |
description, |
|
|
MetadataDataType & |
datatype, |
|
|
const void *& |
value, |
|
|
size_t & |
length | |
|
) |
| | const |
This method retrieves the named key-value pair. The last 4 arguments are output parameters.
- Parameters:
-
| key | the key name |
| description | a short description of the metadata (can by NULL) |
| datatype | the data type of the value array |
| value | the value array |
| length | number of elements in the value array. |
- Returns:
- true if the key was found
- Note:
- For stirngs the length includes the ''
size_t Metadata::getKeyIndex |
( |
const char * |
key |
) |
const |
This method returns the index of the first pair with the given key.
- Parameters:
-
- Returns:
- the index of the first key-value pair
const char* Metadata::getKey |
( |
size_t |
idx |
) |
const |
- Parameters:
-
| idx | the index of the key-value pair the key name |
const char* Metadata::getDescription |
( |
size_t |
idx |
) |
const |
- Parameters:
-
| idx | the index of the key-value pair the description (this may be NULL) |
- Parameters:
-
| idx | the index of the key-value pair the datatype |
const void* Metadata::getValue |
( |
size_t |
idx |
) |
const |
- Parameters:
-
| idx | the index of the key-value pair a pointer to the data array |
size_t Metadata::getValueLength |
( |
size_t |
idx |
) |
const |
- Parameters:
-
| idx | the index of the key-value pair the number of elements in the value array |
- Note:
- For stirngs the length includes the ''
void Metadata::add |
( |
const char * |
key, |
|
|
const char * |
description, |
|
|
MetadataDataType |
datatype, |
|
|
const void * |
value, |
|
|
size_t |
length | |
|
) |
| | |
This method adds a key-value pair to the metadata.
- Parameters:
-
| key | the key name |
| description | a short description of the metadata (can by NULL) |
| datatype | the data type of the value array |
| value | the value array |
| length | number of elements in the value array. This is ignored for METADATA_DATATYPE_STRING. |
void Metadata::add |
( |
const Metadata & |
meta |
) |
|
The method adds all the key-value pairs in meta.
- Parameters:
-
void Metadata::remove |
( |
void |
|
) |
|
This method removes all the key-value form the container.
void Metadata::remove |
( |
size_t |
idx |
) |
|
This method removes the idx'th key-value pair.
- Parameters:
-
| idx | the index of the key-value pair |
void Metadata::remove |
( |
const char * |
key |
) |
|
This method removes the first key-value pair with the given key.
- Parameters:
-
| key | the key name of the key-value pair |
void Metadata::sort |
( |
void |
|
) |
|
This method sorts the key-value pair list by key name.
This method reads the metadata from a stream in a binary format.
This method reads the metadata from a stream as a binary format.
void Metadata::dump |
( |
FILE * |
file |
) |
const |
The method writes the metadata in a human readable format.
- Parameters:
-
| file | the destination Standard C Library FILE object |
Member Data Documentation
The documentation for this class was generated from the following file: