molecular
|
Loads files asynchronously using Grand Central Dispatch. More...
#include <GcdAsyncFileLoader.h>
Public Member Functions | |
GcdAsyncFileLoader (GcdTaskDispatcher &queue) | |
template<class TQueue > | |
void | ReadFile (const char *path, std::function< void(Blob &)> handler, TQueue &handlerQueue, size_t offset=0, size_t length=0) |
Asynchronously read entire file and pass contents to handler. More... | |
void | ReadFile (const char *path, std::function< void(Blob &)> handler, GcdTaskDispatcher &handlerQueue, GcdTaskDispatcher::FinishFlag &finishFlag, size_t offset=0, size_t length=0) |
ReadFile with FinishFlag. More... | |
Loads files asynchronously using Grand Central Dispatch.
|
inline |
void molecular::util::GcdAsyncFileLoader::ReadFile | ( | const char * | path, |
std::function< void(Blob &)> | handler, | ||
TQueue & | handlerQueue, | ||
size_t | offset = 0 , |
||
size_t | length = 0 |
||
) |
Asynchronously read entire file and pass contents to handler.
path | Path to file |
handler | Function to call when file is loaded. |
handlerQueue | Queue to run handler in. |
|
inline |
ReadFile with FinishFlag.
Only legal for GcdTaskDispatcher.