Class ISubBlock#

Class Documentation#

class ISubBlock#

Representation of a sub-block. A sub-block can contain three types of data: the bitmap-data, an attachment and metadata. The presence of an attachment is optional.

Public Types

enum MemBlkType#

Values that represent the three different data types found in a sub-block.

Values:

enumerator Metadata#

An enum constant representing the metadata.

enumerator Data#

An enum constant representing the bitmap-data.

enumerator Attachment#

An enum constant representing the attachment (of a sub-block).

Public Functions

virtual const SubBlockInfo &GetSubBlockInfo() const = 0#

Gets sub-block information.

Returns:

The sub-block information.

virtual void DangerousGetRawData(MemBlkType type, const void *&ptr, size_t &size) const = 0#

Get a pointer to the raw data. Note that the pointer returned is only valid during the lifetime of the sub-block-object.

Parameters:
  • type – The sub-block data-type.

  • ptr[out] The pointer to the data is stored here.

  • size[out] The size of the data.

virtual std::shared_ptr<const void> GetRawData(MemBlkType type, size_t *ptrSize) = 0#

Gets raw data.

Parameters:
  • type – The type.

  • ptrSize[out] If non-null, size of the data buffer is stored here.

Returns:

The raw data.

virtual std::shared_ptr<IBitmapData> CreateBitmap(const CreateBitmapOptions *options = nullptr) = 0#

Creates a bitmap (from the data of this sub-block).

Remark

Within this call the bitmap is decoded (if necessary). In current implementation, the sub-block does not hold a reference to the returned bitmap here (and, if called twice, a new bitmap is created). One should not rely on this behavior, it is conceivable that in a later version the sub-block will keep a reference (and return the same bitmap if called twice). In current version this method is equivalent to calling CreateBitmapFromSubBlock.

Returns:

The bitmap (contained in this sub-block).

virtual ~ISubBlock() = default#
template<class Q>
inline void DangerousGetRawData(MemBlkType type, const Q *&ptr, size_t &size) const#

A helper method used to cast the pointer to a specific type.

Parameters:
  • type – The sub-block data-type.

  • ptr[out] The pointer to the data is stored here.

  • size[out] The size of the data.