molecular
Classes | Public Member Functions | List of all members
molecular::util::GcdAsyncFileLoader Class Reference

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...
 

Detailed Description

Loads files asynchronously using Grand Central Dispatch.

Constructor & Destructor Documentation

molecular::util::GcdAsyncFileLoader::GcdAsyncFileLoader ( GcdTaskDispatcher queue)
inline

Member Function Documentation

template<class TQueue >
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.

Parameters
pathPath to file
handlerFunction to call when file is loaded.
handlerQueueQueue to run handler in.
void molecular::util::GcdAsyncFileLoader::ReadFile ( const char *  path,
std::function< void(Blob &)>  handler,
GcdTaskDispatcher handlerQueue,
GcdTaskDispatcher::FinishFlag finishFlag,
size_t  offset = 0,
size_t  length = 0 
)
inline

ReadFile with FinishFlag.

Only legal for GcdTaskDispatcher.


The documentation for this class was generated from the following file: