XRootD
Loading...
Searching...
No Matches
XrdCl::ZipCache Class Reference

Utility class for inflating a compressed buffer. More...

#include <XrdClZipCache.hh>

+ Collaboration diagram for XrdCl::ZipCache:

Public Types

typedef std::vector< char > buffer_t
 

Public Member Functions

 ZipCache ()
 
 ~ZipCache ()
 
void QueueReq (uint64_t offset, uint32_t length, void *buffer, ResponseHandler *handler)
 
void QueueRsp (const XRootDStatus &st, uint64_t offset, buffer_t &&buffer)
 

Detailed Description

Utility class for inflating a compressed buffer.

Definition at line 54 of file XrdClZipCache.hh.

Member Typedef Documentation

◆ buffer_t

typedef std::vector<char> XrdCl::ZipCache::buffer_t

Definition at line 58 of file XrdClZipCache.hh.

Constructor & Destructor Documentation

◆ ZipCache()

XrdCl::ZipCache::ZipCache ( )
inline

Definition at line 77 of file XrdClZipCache.hh.

77 : inabsoff( 0 )
78 {
79 strm.zalloc = Z_NULL;
80 strm.zfree = Z_NULL;
81 strm.opaque = Z_NULL;
82 strm.avail_in = 0;
83 strm.next_in = Z_NULL;
84 strm.avail_out = 0;
85 strm.next_out = Z_NULL;
86
87 // make sure zlib doesn't look for gzip headers, in order to do so
88 // pass negative window bits !!!
89 int rc = inflateInit2( &strm, -MAX_WBITS );
90 XrdCl::XRootDStatus st = ToXRootDStatus( rc, "inflateInit2" );
91 if( !st.IsOK() ) throw ZipError( st );
92 }
bool IsOK() const
We're fine.

References XrdCl::Status::IsOK().

+ Here is the call graph for this function:

◆ ~ZipCache()

XrdCl::ZipCache::~ZipCache ( )
inline

Definition at line 94 of file XrdClZipCache.hh.

95 {
96 inflateEnd( &strm );
97 }

Member Function Documentation

◆ QueueReq()

void XrdCl::ZipCache::QueueReq ( uint64_t  offset,
uint32_t  length,
void *  buffer,
ResponseHandler handler 
)
inline

Definition at line 99 of file XrdClZipCache.hh.

100 {
101 std::unique_lock<std::mutex> lck( mtx );
102 rdreqs.emplace( offset, length, buffer, handler );
103 Decompress();
104 }

◆ QueueRsp()

void XrdCl::ZipCache::QueueRsp ( const XRootDStatus st,
uint64_t  offset,
buffer_t &&  buffer 
)
inline

Definition at line 106 of file XrdClZipCache.hh.

107 {
108 std::unique_lock<std::mutex> lck( mtx );
109 rdrsps.emplace( st, offset, std::move( buffer ) );
110 Decompress();
111 }

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