CernVM-FS
2.12.0
|
#include <sink_path.h>
Public Member Functions | |
PathSink (const std::string &destination_path) | |
virtual | ~PathSink () |
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 size) |
virtual bool | RequiresReserve () |
virtual std::string | Describe () |
const std::string | path () |
Public Member Functions inherited from cvmfs::Sink | |
virtual | ~Sink () |
void | Release () |
Private Attributes | |
FILE * | file_ |
UniquePtr< FileSink > | sink_ |
const std::string | path_ |
Additional Inherited Members | |
Protected Member Functions inherited from cvmfs::Sink | |
Sink (bool is_owner) | |
Protected Attributes inherited from cvmfs::Sink | |
bool | is_owner_ |
PathSink is a data sink that writes to a file given by a path.
Internally it uses a FileSink that has ownership of the file. (Though as PathSink is owner of the FileSink, to the outside also PathSink is considered to be the owner.)
Like FileSink, PathSink does not require to reserve space. Contrary to FileSink, PathSink does not allow to adopt and write to a different file path.
Definition at line 30 of file sink_path.h.
|
explicit |
Definition at line 15 of file sink_path.cc.
|
inlinevirtual |
Definition at line 34 of file sink_path.h.
|
virtual |
Return a string representation describing the type of sink and its status
Implements cvmfs::Sink.
Definition at line 46 of file sink_path.cc.
|
inlinevirtual |
Commit data to the sink
Implements cvmfs::Sink.
Definition at line 70 of file sink_path.h.
|
inlinevirtual |
Implements cvmfs::Sink.
Definition at line 61 of file sink_path.h.
Referenced by Describe().
|
inline |
Definition at line 109 of file sink_path.h.
Referenced by download::PrepareDownloadDestination().
|
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().
Implements cvmfs::Sink.
Definition at line 30 of file sink_path.cc.
|
inlinevirtual |
Returns if the specific sink type needs reservation of (data) space
Implements cvmfs::Sink.
Definition at line 100 of file sink_path.h.
|
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.
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_)
Implements cvmfs::Sink.
Definition at line 90 of file sink_path.h.
|
inlinevirtual |
Truncate all written data and start over at position zero.
Implements cvmfs::Sink.
Definition at line 52 of file sink_path.h.
|
inlinevirtual |
Appends data to the sink
Implements cvmfs::Sink.
Definition at line 42 of file sink_path.h.
|
private |
Definition at line 112 of file sink_path.h.
Referenced by PathSink().
|
private |
Definition at line 114 of file sink_path.h.
Referenced by Describe(), path(), and Purge().
Definition at line 113 of file sink_path.h.
Referenced by Flush(), IsValid(), PathSink(), Purge(), RequiresReserve(), Reserve(), Reset(), and Write().