QuantumLibrary
Bloomberg::quantum::Util Struct Reference

Utility to bind a user callable function unto a coroutine or an IO task. More...

#include <quantum_util.h>

Static Public Member Functions

template<class RET , class FUNC , class ... ARGS>
static Function< int(Traits::Yield &)> bindCaller (std::shared_ptr< Context< RET >> ctx, FUNC &&func0, ARGS &&...args0)
 
template<class RET , class FUNC , class ... ARGS>
static Function< int()> bindIoCaller (std::shared_ptr< Promise< RET >> promise, FUNC &&func0, ARGS &&...args0)
 
template<class RET , class INPUT_IT >
static int forEachCoro (CoroContextPtr< std::vector< RET >> ctx, INPUT_IT inputIt, size_t num, const Functions::ForEachFunc< RET, INPUT_IT > &func)
 
template<class RET , class INPUT_IT >
static int forEachBatchCoro (CoroContextPtr< std::vector< std::vector< RET >>> ctx, INPUT_IT inputIt, size_t num, const Functions::ForEachFunc< RET, INPUT_IT > &func, size_t numCoroutineThreads)
 
template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT >
static int mapReduceCoro (CoroContextPtr< std::map< KEY, REDUCED_TYPE >> ctx, INPUT_IT inputIt, size_t num, const Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT > &mapper, const Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE > &reducer)
 
template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT >
static int mapReduceBatchCoro (CoroContextPtr< std::map< KEY, REDUCED_TYPE >> ctx, INPUT_IT inputIt, size_t num, const Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT > &mapper, const Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE > &reducer)
 

Detailed Description

Utility to bind a user callable function unto a coroutine or an IO task.

Note
For internal use only.

Member Function Documentation

◆ bindCaller()

template<class RET , class FUNC , class ... ARGS>
Function< int(Traits::Yield &)> Bloomberg::quantum::Util::bindCaller ( std::shared_ptr< Context< RET >>  ctx,
FUNC &&  func0,
ARGS &&...  args0 
)
static

◆ bindIoCaller()

template<class RET , class FUNC , class ... ARGS>
Function< int()> Bloomberg::quantum::Util::bindIoCaller ( std::shared_ptr< Promise< RET >>  promise,
FUNC &&  func0,
ARGS &&...  args0 
)
static

◆ forEachBatchCoro()

template<class RET , class INPUT_IT >
int Bloomberg::quantum::Util::forEachBatchCoro ( CoroContextPtr< std::vector< std::vector< RET >>>  ctx,
INPUT_IT  inputIt,
size_t  num,
const Functions::ForEachFunc< RET, INPUT_IT > &  func,
size_t  numCoroutineThreads 
)
static

◆ forEachCoro()

template<class RET , class INPUT_IT >
int Bloomberg::quantum::Util::forEachCoro ( CoroContextPtr< std::vector< RET >>  ctx,
INPUT_IT  inputIt,
size_t  num,
const Functions::ForEachFunc< RET, INPUT_IT > &  func 
)
static

◆ mapReduceBatchCoro()

template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT >
int Bloomberg::quantum::Util::mapReduceBatchCoro ( CoroContextPtr< std::map< KEY, REDUCED_TYPE >>  ctx,
INPUT_IT  inputIt,
size_t  num,
const Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT > &  mapper,
const Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE > &  reducer 
)
static

◆ mapReduceCoro()

template<class KEY , class MAPPED_TYPE , class REDUCED_TYPE , class INPUT_IT >
int Bloomberg::quantum::Util::mapReduceCoro ( CoroContextPtr< std::map< KEY, REDUCED_TYPE >>  ctx,
INPUT_IT  inputIt,
size_t  num,
const Functions::MapFunc< KEY, MAPPED_TYPE, INPUT_IT > &  mapper,
const Functions::ReduceFunc< KEY, MAPPED_TYPE, REDUCED_TYPE > &  reducer 
)
static