libucxx  0.37.00
All Classes Namespaces Functions Variables Typedefs Enumerations Friends
Public Member Functions | List of all members
ucxx::DelayedSubmissionCollection Class Reference

A collection of delayed submissions of multiple types. More...

#include <delayed_submission.h>

Public Member Functions

 DelayedSubmissionCollection (bool enableDelayedRequestSubmission=false)
 Default delayed submission collection constructor. More...
 
 DelayedSubmissionCollection (const DelayedSubmissionCollection &)=delete
 
DelayedSubmissionCollectionoperator= (DelayedSubmissionCollection const &)=delete
 
 DelayedSubmissionCollection (DelayedSubmissionCollection &&o)=delete
 
DelayedSubmissionCollectionoperator= (DelayedSubmissionCollection &&o)=delete
 
void processPre ()
 Process pending delayed request submission and generic-pre callback operations. More...
 
void processPost ()
 Process all pending generic-post callback operations. More...
 
void registerRequest (std::shared_ptr< Request > request, DelayedSubmissionCallbackType callback)
 Register a request for delayed submission. More...
 
void registerGenericPre (DelayedSubmissionCallbackType callback)
 Register a generic callback to execute during processPre(). More...
 
void registerGenericPost (DelayedSubmissionCallbackType callback)
 Register a generic callback to execute during processPost(). More...
 
bool isDelayedRequestSubmissionEnabled () const
 Inquire if delayed request submission is enabled. More...
 

Detailed Description

A collection of delayed submissions of multiple types.

A collection of delayed submissions of multiple types used by the owner to manage each of the delayed submission types via specialized methods.

Constructor & Destructor Documentation

◆ DelayedSubmissionCollection()

ucxx::DelayedSubmissionCollection::DelayedSubmissionCollection ( bool  enableDelayedRequestSubmission = false)
explicit

Default delayed submission collection constructor.

Construct an empty collection of delayed submissions. Despite its name, a delayed submission registration may be processed right after registration, thus effectively making it an immediate submission.

Parameters
[in]enableDelayedRequestSubmissionwhether request submission should be enabled, if false, only generic callbacks are enabled.

Member Function Documentation

◆ isDelayedRequestSubmissionEnabled()

bool ucxx::DelayedSubmissionCollection::isDelayedRequestSubmissionEnabled ( ) const

Inquire if delayed request submission is enabled.

Check whether delayed submission request is enabled, in which case registerRequest() may be used to register requests that will be executed during processPre().

Returns
true if a delayed request submission is enabled, false otherwise.

◆ processPost()

void ucxx::DelayedSubmissionCollection::processPost ( )

Process all pending generic-post callback operations.

Process all pending generic-post callbacks. Generic callbacks are deemed completed when their execution completes.

◆ processPre()

void ucxx::DelayedSubmissionCollection::processPre ( )

Process pending delayed request submission and generic-pre callback operations.

Process all pending delayed request submissions and generic callbacks. Generic callbacks are deemed completed when their execution completes. On the other hand, the execution of the delayed request submission callbacks does not imply completion of the operation, only that it has been submitted. The completion of each delayed request submission is handled externally by the implementation of the object being processed, for example by checking the result of ucxx::Request::isCompleted().

Generic callbacks may be used to to pass information between threads on the subject that requests have been in fact processed, therefore, requests are processed first, then generic callbacks are.

◆ registerGenericPost()

void ucxx::DelayedSubmissionCollection::registerGenericPost ( DelayedSubmissionCallbackType  callback)

Register a generic callback to execute during processPost().

Register a generic callback that will be executed when processPost() is called. Lifetime of the callback must be ensured by the caller.

Parameters
[in]callbackthe callback that will be executed by processPre().

◆ registerGenericPre()

void ucxx::DelayedSubmissionCollection::registerGenericPre ( DelayedSubmissionCallbackType  callback)

Register a generic callback to execute during processPre().

Register a generic callback that will be executed when processPre() is called. Lifetime of the callback must be ensured by the caller.

Parameters
[in]callbackthe callback that will be executed by processPre().

◆ registerRequest()

void ucxx::DelayedSubmissionCollection::registerRequest ( std::shared_ptr< Request request,
DelayedSubmissionCallbackType  callback 
)

Register a request for delayed submission.

Register a request for delayed submission with a callback that will be executed when the request is in fact submitted when processPre() is called.

Exceptions
std::runtime_errorif delayed request submission was disabled at construction.
Parameters
[in]requestthe request to which the callback belongs, ensuring it remains alive until the callback is invoked.
[in]callbackthe callback that will be executed by processPre() when the operation is submitted.

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