![]() |
CernVM-FS
2.13.0
|
#include <sink.h>
Public Member Functions | |
virtual | ~Sink () |
virtual int64_t | Write (const void *buf, uint64_t sz)=0 |
virtual int | Reset ()=0 |
virtual int | Purge ()=0 |
virtual bool | IsValid ()=0 |
void | Release () |
virtual int | Flush ()=0 |
virtual bool | Reserve (size_t size)=0 |
virtual bool | RequiresReserve ()=0 |
virtual std::string | Describe ()=0 |
Protected Member Functions | |
Sink (bool is_owner) | |
Protected Attributes | |
bool | is_owner_ |
A data sink that behaves like a writable file descriptor with a custom implementation.
|
pure virtual |
Return a string representation describing the type of sink and its status
Implemented in cvmfs::MemSink, cvmfs::PathSink, cvmfs::FileSink, cvmfs::TransactionSink, and anonymous_namespace{cache_stream.cc}::StreamingSink.
Referenced by download::CallbackCurlData(), and download::PrepareDownloadDestination().
|
pure virtual |
Commit data to the sink
Implemented in cvmfs::TransactionSink, anonymous_namespace{cache_stream.cc}::StreamingSink, cvmfs::MemSink, cvmfs::PathSink, and cvmfs::FileSink.
Referenced by download::DownloadManager::VerifyAndFinalize().
|
pure virtual |
Implemented in anonymous_namespace{cache_stream.cc}::StreamingSink, cvmfs::TransactionSink, cvmfs::MemSink, cvmfs::PathSink, and cvmfs::FileSink.
Referenced by download::PrepareDownloadDestination().
|
pure virtual |
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().
Implemented in anonymous_namespace{cache_stream.cc}::StreamingSink, cvmfs::TransactionSink, cvmfs::MemSink, cvmfs::PathSink, and cvmfs::FileSink.
Referenced by download::DownloadManager::Fetch().
|
inline |
Release ownership of the sink's resource
Definition at line 58 of file sink.h.
Referenced by manifest::DoFetch(), manifest::DoVerify(), and whitelist::Whitelist::LoadUrl().
|
pure virtual |
Returns if the specific sink type needs reservation of (data) space
Implemented in cvmfs::MemSink, cvmfs::PathSink, cvmfs::FileSink, cvmfs::TransactionSink, and anonymous_namespace{cache_stream.cc}::StreamingSink.
Referenced by download::CallbackCurlHeader(), and download::DownloadManager::SetUrlOptions().
|
pure virtual |
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.
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_)
Implemented in cvmfs::MemSink, cvmfs::PathSink, cvmfs::FileSink, cvmfs::TransactionSink, and anonymous_namespace{cache_stream.cc}::StreamingSink.
Referenced by download::CallbackCurlHeader(), and download::DownloadManager::SetUrlOptions().
|
pure virtual |
Truncate all written data and start over at position zero.
Implemented in anonymous_namespace{cache_stream.cc}::StreamingSink, cvmfs::TransactionSink, cvmfs::PathSink, cvmfs::MemSink, and cvmfs::FileSink.
Referenced by download::DownloadManager::VerifyAndFinalize().
|
pure virtual |
Appends data to the sink
Implemented in cvmfs::TransactionSink, cvmfs::MemSink, cvmfs::PathSink, cvmfs::FileSink, and anonymous_namespace{cache_stream.cc}::StreamingSink.
Referenced by download::CallbackCurlData(), and zlib::DecompressZStream2Sink().
|
protected |
Definition at line 99 of file sink.h.
Referenced by cvmfs::FileSink::Adopt(), cvmfs::MemSink::Adopt(), cvmfs::MemSink::FreeData(), cvmfs::FileSink::Purge(), Release(), cvmfs::MemSink::Reserve(), cvmfs::MemSink::Reset(), cvmfs::MemSink::Write(), and cvmfs::FileSink::~FileSink().