ServiceIOJobQueueRef Class Reference

#include <jobqueue.h>

Inheritance diagram for ServiceIOJobQueueRef:

Detailed Description

Reference to a queue for IO purposes. Serial execution does not guarantee the order of execution. The queue may reorder jobs if necessary.

Public Member Functions

 ServiceIOJobQueueRef ()
 
 ServiceIOJobQueueRef (ServiceIOJobQueueInterface *q)
 
ServiceIOJobQueueRefoperator= (ServiceIOJobQueueInterface *q)
 
ServiceIOJobQueueRefoperator= (const JobQueueInterface::None &none)
 
Result< UIntInit (JOBQUEUETYPE type, Int threadCnt, JOBQUEUEMODE mode, const Char *name)=delete
 
- Public Member Functions inherited from JobQueueRef
 MAXON_DEFAULT_REFERENCE_CONSTRUCTORS (JobQueueRef, Reference)
 
MAXON_IMPLICIT JobQueueRef (const JobQueueInterface::Current &)
 
MAXON_IMPLICIT JobQueueRef (const JobQueueInterface::None &)
 
JobQueueRefoperator= (const JobQueueInterface::Current &)
 
JobQueueRefoperator= (const JobQueueInterface::None &)
 

Static Public Member Functions

static Result< ServiceIOJobQueueRefCreate ()
 
static Result< ServiceIOJobQueueRefCreate (Int threadCnt, JOBQUEUEMODE mode=JOBQUEUEMODE::SLEEP_ON_IDLE, const Char *name="Local Service IO Job Queue", UInt *ownerId=nullptr)
 

Private Types

using Super = JobQueueRef
 

Member Typedef Documentation

◆ Super

using Super = JobQueueRef
private

Constructor & Destructor Documentation

◆ ServiceIOJobQueueRef() [1/2]

◆ ServiceIOJobQueueRef() [2/2]

Member Function Documentation

◆ Create() [1/2]

static Result<ServiceIOJobQueueRef> Create ( )
static

Creates a local queue for asynchronous I/O and service jobs. Usually GetServiceIOQueue() is all you need but sometimes you might have to guarantee that all requests are handled by one thread (e.g. when dealing with some OS functions). In this case you can create a local IO queue with just one thread.

Returns
OK on success.

◆ Create() [2/2]

static Result<ServiceIOJobQueueRef> Create ( Int  threadCnt,
JOBQUEUEMODE  mode = JOBQUEUEMODE::SLEEP_ON_IDLE,
const Char name = "Local Service IO Job Queue",
UInt ownerId = nullptr 
)
static

Creates a local queue for asynchronous I/O and service jobs. Usually GetServiceIOQueue() is all you need but sometimes you might have to guarantee that all requests are handled by one thread (e.g. when dealing with some OS functions). In this case you can create a local IO queue with just one thread.

Parameters
[in]threadCntThe number of threads used by the queue, 1 by default.
[in]modeScheduling options for the queue. Most of the time there's no need to specify something else than JOBQUEUEMODE::DEFAULT.
[in]nameThe queue name, by default "Local Service IO Job Queue".
[out]ownerIdOwner id of the queue (can be used for CancelAndWait).
Returns
OK on success.

◆ operator=() [1/2]

◆ operator=() [2/2]

ServiceIOJobQueueRef& operator= ( const JobQueueInterface::None &  none)

◆ Init()

Result<UInt> Init ( JOBQUEUETYPE  type,
Int  threadCnt,
JOBQUEUEMODE  mode,
const Char name 
)
delete