xrootd
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdCl::RequestSync Class Reference

A helper running a fixed number of requests at a given time. More...

#include <XrdClRequestSync.hh>

Collaboration diagram for XrdCl::RequestSync:
Collaboration graph
[legend]

Public Member Functions

 RequestSync (uint32_t reqTotal, uint32_t reqQuota)
 
 ~RequestSync ()
 Destructor.
 
void WaitForQuota ()
 Wait for the request quota.
 
void WaitForAll ()
 Wait for all the requests to be finished.
 
void TaskDone (bool success=true)
 Report the request finish.
 
uint32_t FailureCount () const
 Number of tasks finishing with an error.
 

Private Member Functions

 RequestSync (const RequestSync &other)
 
RequestSyncoperator= (const RequestSync &other)
 

Private Attributes

XrdSysMutex pMutex
 
XrdSysSemaphorepQuotaSem
 
XrdSysSemaphorepTotalSem
 
uint32_t pRequestsLeft
 
uint32_t pFailureCounter
 

Detailed Description

A helper running a fixed number of requests at a given time.

Constructor & Destructor Documentation

◆ RequestSync() [1/2]

XrdCl::RequestSync::RequestSync ( uint32_t  reqTotal,
uint32_t  reqQuota 
)
inline

Constructor

Parameters
reqTotaltotal number of requests
reqQuotanumber of requests to be run in parallel

References XrdSysSemaphore::Post(), and pTotalSem.

◆ ~RequestSync()

XrdCl::RequestSync::~RequestSync ( )
inline

Destructor.

References pQuotaSem, and pTotalSem.

◆ RequestSync() [2/2]

XrdCl::RequestSync::RequestSync ( const RequestSync other)
private

Member Function Documentation

◆ FailureCount()

uint32_t XrdCl::RequestSync::FailureCount ( ) const
inline

Number of tasks finishing with an error.

References pFailureCounter.

◆ operator=()

RequestSync & XrdCl::RequestSync::operator= ( const RequestSync other)
private

◆ TaskDone()

void XrdCl::RequestSync::TaskDone ( bool  success = true)
inline

Report the request finish.

References pFailureCounter, pMutex, XrdSysSemaphore::Post(), pQuotaSem, pRequestsLeft, and pTotalSem.

◆ WaitForAll()

void XrdCl::RequestSync::WaitForAll ( )
inline

Wait for all the requests to be finished.

References pTotalSem, and XrdSysSemaphore::Wait().

◆ WaitForQuota()

void XrdCl::RequestSync::WaitForQuota ( )
inline

Wait for the request quota.

References pQuotaSem, and XrdSysSemaphore::Wait().

Member Data Documentation

◆ pFailureCounter

uint32_t XrdCl::RequestSync::pFailureCounter
private

Referenced by FailureCount(), and TaskDone().

◆ pMutex

XrdSysMutex XrdCl::RequestSync::pMutex
private

Referenced by TaskDone().

◆ pQuotaSem

XrdSysSemaphore* XrdCl::RequestSync::pQuotaSem
private

◆ pRequestsLeft

uint32_t XrdCl::RequestSync::pRequestsLeft
private

Referenced by TaskDone().

◆ pTotalSem

XrdSysSemaphore* XrdCl::RequestSync::pTotalSem
private

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