Class cwipc_metadata

Class Documentation

class cwipc_metadata

A collection of metadata.

This collection (which is freed along with the cwipc point cloud it belongs to) contains all the information needed to access and parse the metadata items. It is the return value of cwipc->access_metadata().

Public Types

typedef void (*deallocfunc)(void*)

Public Functions

inline virtual ~cwipc_metadata()
virtual int count() = 0

Returns number of metadata items.

Returns:

Number of metadata items.

virtual const std::string &name(int idx) = 0

Return name of an item.

Parameters:

idx – The item index

Returns:

the name

virtual const std::string &description(int idx) = 0

Return descrption of an item.

The description is intended to be machine-readable for code that understands it. For example, it will contain image width and height and such.

Parameters:

idx – The item index

Returns:

the description

virtual void *pointer(int idx) = 0

Return data pointer of an item.

Parameters:

idx – The item index

Returns:

the data pointer

virtual size_t size(int idx) = 0

Return size of an item.

Parameters:

idx – The item index

Returns:

the size in bytes

virtual void _add(const std::string &name, const std::string &description, void *pointer, size_t size, deallocfunc dealloc) = 0

Add an metadata item (internal use only)

Parameters:
  • name – The item name

  • description – String describing the item format

  • pointer – The item pointer

  • size – The size of the item

  • dealloc – The item deallocator function

virtual void _move(cwipc_metadata *other) = 0

Move all metadata items to another collection (internal use only)

All metadata items moved to another collection, and the current collection is cleared, so ownership of the items is passed to the other collection.

Parameters:

other – The collection to move the items to.