Loading...
Searching...
No Matches
XrdXrootdFileHP Class Reference

`#include <XrdXrootdFile.hh>`

Collaboration diagram for XrdXrootdFileHP:

## Public Member Functions

| XrdXrootdFileHP (int rsv=2)
void | Avail (int fHandle)
void | Delete ()
int | Get ()
void | Ref ()

## Detailed Description

Definition at line 44 of file XrdXrootdFile.hh.

## Constructor & Destructor Documentation

## XrdXrootdFileHP()

XrdXrootdFileHP::XrdXrootdFileHP | ( | int | rsv = 2 | ) |

inline

Definition at line 76 of file XrdXrootdFile.hh.

: refs(1), noMore(false)
{fhAvail.reserve(rsv);}

## Member Function Documentation

## Avail()

void XrdXrootdFileHP::Avail | ( | int | fHandle | ) |

inline

Definition at line 48 of file XrdXrootdFile.hh.

{fhMutex.Lock();
bool done = (1 == refs--);
if (noMore)
{fhMutex.UnLock();
if (done) delete this;
} else {
fhAvail.push_back(fHandle);
fhMutex.UnLock();
}
}

## Delete()

void XrdXrootdFileHP::Delete | ( |  | ) |

inline

Definition at line 59 of file XrdXrootdFile.hh.

{fhMutex.Lock();
if (!refs) {fhMutex.UnLock(); delete this;}
else {noMore = true; fhMutex.UnLock();}
}

## Get()

int XrdXrootdFileHP::Get | ( |  | ) |

inline

Definition at line 64 of file XrdXrootdFile.hh.

{int fh;
fhMutex.Lock();
if (fhAvail.empty()) fh = -1;
else {fh = fhAvail.back();
fhAvail.pop_back();
}
fhMutex.UnLock();
return fh;
}

## Ref()

void XrdXrootdFileHP::Ref | ( |  | ) |

inline

Definition at line 74 of file XrdXrootdFile.hh.

{fhMutex.Lock(); refs++; fhMutex.UnLock();}

Referenced by XrdXrootdFileTable::Del().

Here is the caller graph for this function:

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

- XrdXrootdFile.hh