19 #ifndef __XRD_CL_SID_MANAGER_HH__
20 #define __XRD_CL_SID_MANAGER_HH__
25 #include <unordered_map>
53 #if __cplusplus < 201103L
112 return pTimeOutSIDs.size();
121 std::unordered_map<uint16_t, time_t> pAllocTime;
122 std::list<uint16_t> pFreeSIDs;
123 std::set<uint16_t> pTimeOutSIDs;
124 uint16_t pSIDCeiling;
126 mutable size_t pRefCount;
158 std::shared_ptr<SIDManager>
GetSIDMgr(
const URL &url );
187 SIDMgrPool(
const SIDMgrPool& ) =
delete;
188 SIDMgrPool( SIDMgrPool&& ) =
delete;
193 SIDMgrPool& operator=(
const SIDMgrPool& ) =
delete;
194 SIDMgrPool& operator=( SIDMgrPool&& ) =
delete;
197 std::unordered_map<std::string, SIDManager*> pool;
Handle XRootD stream IDs.
void ReleaseTimedOut(uint8_t sid[2])
Release a timed out SID.
uint16_t GetNumberOfAllocatedSIDs() const
Number of allocated streams.
void TimeOutSID(uint8_t sid[2])
Register a SID of a request that timed out.
bool IsAnySIDOldAs(const time_t tlim) const
Check if any SID was allocated at or before a given time.
bool IsTimedOut(uint8_t sid[2])
Check if a SID is timed out.
Status AllocateSID(uint8_t sid[2])
uint32_t NumberOfTimedOutSIDs() const
Number of timeout sids.
void ReleaseAllTimedOut()
Release all timed out SIDs.
void ReleaseSID(uint8_t sid[2])
Release the SID that is no longer needed.
Pool of SID manager objects.
static SIDMgrPool & Instance()
void Recycle(SIDManager *mgr)
std::shared_ptr< SIDManager > GetSIDMgr(const URL &url)
Procedure execution status.