CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{cache_stream.cc}::StreamingSink Class Reference
Inheritance diagram for anonymous_namespace{cache_stream.cc}::StreamingSink:
Collaboration diagram for anonymous_namespace{cache_stream.cc}::StreamingSink:

Public Member Functions

 StreamingSink (void *buf, uint64_t size, uint64_t offset)
 
virtual ~StreamingSink ()
 
virtual int64_t Write (const void *buf, uint64_t sz)
 
virtual int Reset ()
 
virtual int Purge ()
 
virtual bool IsValid ()
 
virtual int Flush ()
 
virtual bool Reserve (size_t)
 
virtual bool RequiresReserve ()
 
virtual std::string Describe ()
 
int64_t GetNBytesStreamed () const
 
- Public Member Functions inherited from cvmfs::Sink
virtual ~Sink ()
 
void Release ()
 

Private Attributes

uint64_t pos_
 
void * window_buf_
 
uint64_t window_size_
 
uint64_t window_offset_
 

Additional Inherited Members

- Protected Member Functions inherited from cvmfs::Sink
 Sink (bool is_owner)
 
- Protected Attributes inherited from cvmfs::Sink
bool is_owner_
 

Detailed Description

Definition at line 22 of file cache_stream.cc.

Constructor & Destructor Documentation

anonymous_namespace{cache_stream.cc}::StreamingSink::StreamingSink ( void *  buf,
uint64_t  size,
uint64_t  offset 
)
inline

Definition at line 24 of file cache_stream.cc.

virtual anonymous_namespace{cache_stream.cc}::StreamingSink::~StreamingSink ( )
inlinevirtual

Definition at line 32 of file cache_stream.cc.

Member Function Documentation

virtual std::string anonymous_namespace{cache_stream.cc}::StreamingSink::Describe ( )
inlinevirtual

Return a string representation describing the type of sink and its status

Implements cvmfs::Sink.

Definition at line 72 of file cache_stream.cc.

virtual int anonymous_namespace{cache_stream.cc}::StreamingSink::Flush ( )
inlinevirtual

Commit data to the sink

Returns
Success = 0 Failure = -errno

Implements cvmfs::Sink.

Definition at line 69 of file cache_stream.cc.

int64_t anonymous_namespace{cache_stream.cc}::StreamingSink::GetNBytesStreamed ( ) const
inline

Definition at line 78 of file cache_stream.cc.

virtual bool anonymous_namespace{cache_stream.cc}::StreamingSink::IsValid ( )
inlinevirtual
Returns
true if the object is correctly initialized.

Implements cvmfs::Sink.

Definition at line 66 of file cache_stream.cc.

virtual int anonymous_namespace{cache_stream.cc}::StreamingSink::Purge ( )
inlinevirtual

Purges all resources leaving the sink in an invalid state. More aggressive version of Reset(). For some sinks and depending on owner status it might do the same as Reset().

Returns
Success = 0 Failure = -errno

Implements cvmfs::Sink.

Definition at line 65 of file cache_stream.cc.

virtual bool anonymous_namespace{cache_stream.cc}::StreamingSink::RequiresReserve ( )
inlinevirtual

Returns if the specific sink type needs reservation of (data) space

Returns
true - reservation is needed false - no reservation is needed

Implements cvmfs::Sink.

Definition at line 71 of file cache_stream.cc.

virtual bool anonymous_namespace{cache_stream.cc}::StreamingSink::Reserve ( size_t  size)
inlinevirtual

Reserves new space in sinks that require reservation (see RequiresReserve)

Successful if the requested size is smaller than already space reserved, or if the sink is the owner of the data and can allocate enough new space.

Note
If successful, always resets the current position to 0.

Fails if 1) sink is not the owner of the data and more than the current size is requested 2) more space is requested than allowed (max_size_)

Returns
success = true failure = false

Implements cvmfs::Sink.

Definition at line 70 of file cache_stream.cc.

virtual int anonymous_namespace{cache_stream.cc}::StreamingSink::Reset ( )
inlinevirtual

Truncate all written data and start over at position zero.

Returns
Success = 0 Failure = -errno

Implements cvmfs::Sink.

Definition at line 60 of file cache_stream.cc.

virtual int64_t anonymous_namespace{cache_stream.cc}::StreamingSink::Write ( const void *  buf,
uint64_t  sz 
)
inlinevirtual

Appends data to the sink

Returns
on success: number of bytes written (can be less than requested) on failure: -errno.

Implements cvmfs::Sink.

Definition at line 34 of file cache_stream.cc.

Member Data Documentation

uint64_t anonymous_namespace{cache_stream.cc}::StreamingSink::pos_
private

Definition at line 81 of file cache_stream.cc.

void* anonymous_namespace{cache_stream.cc}::StreamingSink::window_buf_
private

Definition at line 82 of file cache_stream.cc.

uint64_t anonymous_namespace{cache_stream.cc}::StreamingSink::window_offset_
private

Definition at line 84 of file cache_stream.cc.

uint64_t anonymous_namespace{cache_stream.cc}::StreamingSink::window_size_
private

Definition at line 83 of file cache_stream.cc.


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