![]() |
libimgdoc2
|
interface for outputting binary data More...
#include <IBlobOutput.h>
Public Member Functions | |
virtual bool | Reserve (size_t s)=0 |
virtual bool | SetData (size_t offset, size_t size, const void *data)=0 |
IBlobOutput (const IBlobOutput &)=delete | |
IBlobOutput & | operator= (const IBlobOutput &)=delete |
IBlobOutput (IBlobOutput &&)=delete | |
IBlobOutput & | operator= (IBlobOutput &&)=delete |
interface for outputting binary data
This interface is used to output binary data from libimgdoc2. It is passed in to the corresponding operation, then the "Reserve"-method is called for advertising the size of the data. Then (multiple) calls to "SetData" follow, where the object is requested to copy data into its internal storage.
|
pure virtual |
Notifies about the size of data to be returned. This method must only be called once, additional calls should result in an exception. If this method returns false, it is interpreted as "the client is not interested in the data" and there will not be subsequent calls to "SetData".
s | The size of the data being returned. |
Implemented in imgdoc2::BlobOutputOnHeap.
|
pure virtual |
Data is passed to the "blob-output"-object with this call. The pointer "data" is only assumed to be valid for the duration of this call - in other words, the object needs to access the memory only within the call (and e.g. make a copy of the data). The address (indicated by offset and size) must be completely within the size as advertised with the "Reserve"-call. The method should validate this condition and throw an exception in case of a violation. If the method returns "false", it is interpreted "the object is not interested in any additional data", and subsequent calls may be suppressed.
offset | The offset. |
size | The size. |
data | The data. |
Implemented in imgdoc2::BlobOutputOnHeap.