Foxit PDF SDK
|
Public Member Functions | |
CFX_PrivateData (IFX_Allocator *pAllocator=0) | |
Construct with allocator. More... | |
~CFX_PrivateData () | |
The destructor. | |
void | ClearAll () |
Release all remaining data. More... | |
FX_LPVOID | GetPrivateData (FX_LPVOID module_id) |
Get previously stored private data. Returns NULL for not stored. More... | |
FX_BOOL | LookupPrivateData (FX_LPVOID module_id, FX_LPVOID &pData) const |
Lookup a private data. More... | |
FX_BOOL | RemovePrivateData (FX_LPVOID module_id) |
Remove previously stored private data. FPDFAPI assumes the module has deallocated the data, so the free data callback will NOT be called. More... | |
void | SetPrivateData (FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback) |
Set private data. More... | |
void | SetPrivateObj (FX_LPVOID module_id, CFX_DestructObject *pObj) |
Set private object. More... | |
The class represents the private data storage.
|
inline |
Construct with allocator.
[in] | pAllocator | An allocator. Default value: NULL. |
void CFX_PrivateData::ClearAll | ( | ) |
Release all remaining data.
Get previously stored private data. Returns NULL for not stored.
This function works for private data set by function CFX_PrivateData::SetPrivateData CFX_PrivateData::SetPrivateObj.
[in] | module_id | The module id. |
Lookup a private data.
[in] | module_id | The module id. |
[out] | pData | Private data. |
Remove previously stored private data. FPDFAPI assumes the module has deallocated the data, so the free data callback will NOT be called.
[in] | module_id | The module id. |
void CFX_PrivateData::SetPrivateData | ( | FX_LPVOID | module_id, |
FX_LPVOID | pData, | ||
PD_CALLBACK_FREEDATA | callback | ||
) |
Set private data.
If the data points to an object that will belong to the attached object (which means when the attached object is destroyed, the private data should be destroyed too), then the caller must provide a callback for freeing the data. If the private data is just a number, or some external pointer, then the callback can be NULL. This function will free any previously stored data for with same module ID. The caller can not set same data twice(this will cause a crash).
[in] | module_id | The module id. |
[in] | pData | The private data. |
[in] | callback | The callback function for deallocating provided private data. |
void CFX_PrivateData::SetPrivateObj | ( | FX_LPVOID | module_id, |
CFX_DestructObject * | pObj | ||
) |
Set private object.
The private object will become a part of the attached object, so when the attached object is destroyed, the private object will be destroyed too. This function will free any previously stored data for with same module ID.The caller can not set same object twice(this will cause a crash).
[in] | module_id | The module id. |
[in] | pObj | The private data in fact a CFX_DestructObject derived object. |