AIODiskFile.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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
19class AIODiskIOStrategy;
20
21class AIODiskFile : public DiskFile
22{
23 CBDATA_CLASS(AIODiskFile);
24
25public:
26
27 friend class AIODiskIOStrategy;
28 AIODiskFile (char const *path, AIODiskIOStrategy *);
29 ~AIODiskFile() override;
30
31 // XXX: the code has this as "IORequestor::Pointer callback"
32 void open(int flags, mode_t mode, RefCount<IORequestor> callback) override;
33
34 void create (int, mode_t, RefCount<IORequestor>) override;
35 void read(ReadRequest *) override;
36 void write(WriteRequest *) override;
37 void close () override;
38 bool canRead() const override;
39 bool canWrite() const override;
40
41 /* During migration only */
42 int getFD() const override;
43
44 bool error() const override;
45
46 /* Inform callers if there is IO in progress */
47 bool ioInProgress() const override;
48
49private:
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
#define CBDATA_CLASS(type)
Definition: cbdata.h:289
virtual void read(ReadRequest *)=0
virtual void close()=0
virtual bool ioInProgress() const =0
virtual void open(int flags, mode_t mode, RefCount< IORequestor > callback)=0
virtual int getFD() const
Definition: DiskFile.h:53
virtual bool canRead() const =0
virtual bool canWrite() const
Definition: DiskFile.h:50
virtual void write(WriteRequest *)=0
virtual void create(int flags, mode_t mode, RefCount< IORequestor > callback)=0
virtual bool error() const =0
unsigned short mode_t
Definition: types.h:129

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors