CernVM-FS  2.13.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sink.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_NETWORK_SINK_H_
6 #define CVMFS_NETWORK_SINK_H_
7 
8 #include <stdint.h>
9 
10 #include <string>
11 
12 namespace cvmfs {
13 
18 class Sink {
19  protected:
20  explicit Sink(bool is_owner) : is_owner_(is_owner) { }
21 
22  public:
23  virtual ~Sink() { }
30  virtual int64_t Write(const void *buf, uint64_t sz) = 0;
31 
38  virtual int Reset() = 0;
39 
49  virtual int Purge() = 0;
50 
54  virtual bool IsValid() = 0;
55 
59  void Release() { is_owner_ = false; }
60 
66  virtual int Flush() = 0;
67 
84  virtual bool Reserve(size_t size) = 0;
85 
92  virtual bool RequiresReserve() = 0;
93 
97  virtual std::string Describe() = 0;
98 
99  protected:
100  bool is_owner_;
101 };
102 
103 } // namespace cvmfs
104 
105 #endif // CVMFS_NETWORK_SINK_H_
virtual int Purge()=0
virtual bool RequiresReserve()=0
virtual std::string Describe()=0
virtual bool IsValid()=0
void Release()
Definition: sink.h:59
virtual int Reset()=0
Sink(bool is_owner)
Definition: sink.h:20
virtual int Flush()=0
virtual bool Reserve(size_t size)=0
static void size_t size
Definition: smalloc.h:54
virtual ~Sink()
Definition: sink.h:23
bool is_owner_
Definition: sink.h:100
virtual int64_t Write(const void *buf, uint64_t sz)=0