AIODiskFile.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef SQUID_AIODISKFILE_H
10 #define SQUID_AIODISKFILE_H
11 
12 #if HAVE_DISKIO_MODULE_AIO
13 
14 #include "cbdata.h"
15 #include "DiskIO/AIO/async_io.h"
16 #include "DiskIO/DiskFile.h"
17 #include "SquidString.h"
18 
19 class AIODiskIOStrategy;
20 
21 class AIODiskFile : public DiskFile
22 {
23  CBDATA_CLASS(AIODiskFile);
24 
25 public:
26 
27  friend class AIODiskIOStrategy;
28  AIODiskFile (char const *path, AIODiskIOStrategy *);
29  ~AIODiskFile();
30 
32  virtual void open(int flags, mode_t mode, RefCount<IORequestor> callback);
33 
34  virtual void create (int, mode_t, RefCount<IORequestor>);
35  virtual void read(ReadRequest *);
36  virtual void write(WriteRequest *);
37  virtual void close ();
38  virtual bool canRead() const;
39  virtual bool canWrite() const;
40 
41  /* During migration only */
42  virtual int getFD() const;
43 
44  virtual bool error() const;
45 
46  /* Inform callers if there is IO in progress */
47  virtual bool ioInProgress() const;
48 
49 private:
50  void error(bool const &);
51  int fd;
52  String path;
53  AIODiskIOStrategy *strategy;
54  RefCount<IORequestor> ioRequestor;
55  bool closed;
56  bool error_;
57 };
58 
59 #endif /* HAVE_DISKIO_MODULE_AIO */
60 #endif /* SQUID_AIODISKFILE_H */
61 
virtual void create(int flags, mode_t mode, RefCount< IORequestor > callback)=0
void const char HLPCB * callback
Definition: stub_helper.cc:16
virtual bool canRead() const =0
virtual bool error() const =0
#define CBDATA_CLASS(type)
Definition: cbdata.h:302
virtual void write(WriteRequest *)=0
unsigned short mode_t
Definition: types.h:150
virtual int getFD() const
Definition: DiskFile.h:53
virtual bool canWrite() const
Definition: DiskFile.h:50
virtual bool ioInProgress() const =0
virtual void close()=0
virtual void open(int flags, mode_t mode, RefCount< IORequestor > callback)=0
virtual void read(ReadRequest *)=0

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors