All Classes Namespaces Functions Variables Typedefs Enumerations Friends
Public Member Functions | Protected Member Functions | List of all members
ucxx::GenericDelayedSubmissionCollection Class Reference

A collection of delayed submissions of generic callbacks. More...

#include <delayed_submission.h>

Inheritance diagram for ucxx::GenericDelayedSubmissionCollection:
ucxx::BaseDelayedSubmissionCollection< DelayedSubmissionCallbackType >

Public Member Functions

 GenericDelayedSubmissionCollection (const std::string name)
 Constructor of a collection of delayed submissions of generic callbacks. More...
 
- Public Member Functions inherited from ucxx::BaseDelayedSubmissionCollection< DelayedSubmissionCallbackType >
 BaseDelayedSubmissionCollection (const std::string name, const bool enabled)
 Constructor for a thread-safe delayed submission collection. More...
 
 BaseDelayedSubmissionCollection (const BaseDelayedSubmissionCollection &)=delete
 
 BaseDelayedSubmissionCollection (BaseDelayedSubmissionCollection &&o)=delete
 
BaseDelayedSubmissionCollectionoperator= (BaseDelayedSubmissionCollection const &)=delete
 
BaseDelayedSubmissionCollectionoperator= (BaseDelayedSubmissionCollection &&o)=delete
 
virtual ItemIdType schedule (DelayedSubmissionCallbackType item)
 Register a callable or complex-type for delayed submission. More...
 
void process ()
 Process all pending callbacks. More...
 
void cancel (ItemIdType id)
 Cancel a pending callback. More...
 

Protected Member Functions

void scheduleLog (ItemIdType id, DelayedSubmissionCallbackType item) override
 Log message during schedule(). More...
 
void processItem (ItemIdType id, DelayedSubmissionCallbackType callback) override
 Process a single item during process(). More...
 

Additional Inherited Members

- Protected Attributes inherited from ucxx::BaseDelayedSubmissionCollection< DelayedSubmissionCallbackType >
std::string _name
 The human-readable name of the collection, used for logging.
 
bool _enabled
 Whether the resource required to process the collection is enabled.
 
ItemIdType _itemId
 The item ID counter, used to allow cancelation.
 
std::optional< ItemIdType > _processing
 The ID of the item being processed, if any.
 
std::deque< std::pair< ItemIdType, DelayedSubmissionCallbackType > > _collection
 The collection.
 
std::set< ItemIdType > _canceled
 IDs of canceled items.
 
std::mutex _mutex
 Mutex to provide access to _collection.
 

Detailed Description

A collection of delayed submissions of generic callbacks.

A collection of delayed submissions used specifically for execution of generic callbacks at pre-defined stages of the progress loop.

Constructor & Destructor Documentation

◆ GenericDelayedSubmissionCollection()

ucxx::GenericDelayedSubmissionCollection::GenericDelayedSubmissionCollection ( const std::string  name)
explicit

Constructor of a collection of delayed submissions of generic callbacks.

Construct a collection of delayed submissions used specifically for execution of generic callbacks at pre-defined stages of the progress loop.

Parameters
[in]namethe human-readable name of the type of delayed submission for debugging purposes.

Member Function Documentation

◆ processItem()

void ucxx::GenericDelayedSubmissionCollection::processItem ( ItemIdType  id,
DelayedSubmissionCallbackType  item 
)
overrideprotectedvirtual

Process a single item during process().

Method called by process() to process a single item of the collection.

Parameters
[in]idthe ID of the scheduled item, as returned by schedule().
[in]itemthe callback that was passed as argument to schedule() when the first registered.

Implements ucxx::BaseDelayedSubmissionCollection< DelayedSubmissionCallbackType >.

◆ scheduleLog()

void ucxx::GenericDelayedSubmissionCollection::scheduleLog ( ItemIdType  id,
DelayedSubmissionCallbackType  item 
)
overrideprotectedvirtual

Log message during schedule().

Log a specialized message while schedule() is being executed.

Parameters
[in]idthe ID of the scheduled item, as returned by schedule().
[in]itemthe callback that was passed as argument to schedule().

Implements ucxx::BaseDelayedSubmissionCollection< DelayedSubmissionCallbackType >.


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