Typedef cras::GenericCloudIter

Typedef Documentation

typedef ::cras::impl::GenericCloudIterator cras::GenericCloudIter

GenericCloudIter and GenericCloudConstIter are iterators of fields of types unknown at compile time.

The iterators allow you to dereference them into an unsigned char, which doesn’t however need to be the actual data, as they may span multiple bytes.

It adds function rawData() which returns a pointer to the current position in the uchar data stream. You can use reinterpret_cast to transform the data into some desired type and get or set the value. Any kind of data safety is on you.

Another provided function is dataAs<Type>() which returns the current iterator position as a pointer to data of the requested type. This function does a basic check that the requested data type has the same size as the type of the iterated field.

The non-const iterator also provides method copyData() which can copy the field data from another generic iterator. This can be used to copy fields of types which are not known at compile time.