source: squid-ssl/trunk/fuentes/src/DiskIO/AIO/AIODiskFile.h @ 5495

Last change on this file since 5495 was 5495, checked in by Juanma, 4 years ago

Initial release

File size: 1.4 KB
Line 
1/*
2 * Copyright (C) 1996-2015 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 USE_DISKIO_AIO
13
14#include "async_io.h"
15#include "cbdata.h"
16#include "DiskIO/DiskFile.h"
17#include "SquidString.h"
18
19class AIODiskIOStrategy;
20
21class AIODiskFile : public DiskFile
22{
23
24public:
25
26    friend class AIODiskIOStrategy;
27    AIODiskFile (char const *path, AIODiskIOStrategy *);
28    ~AIODiskFile();
29
30    /// \bug the code has this as "IORequestor::Pointer callback"
31    virtual void open(int flags, mode_t mode, RefCount<IORequestor> callback);
32
33    virtual void create (int, mode_t, RefCount<IORequestor>);
34    virtual void read(ReadRequest *);
35    virtual void write(WriteRequest *);
36    virtual void close ();
37    virtual bool canRead() const;
38    virtual bool canWrite() const;
39
40    /* During migration only */
41    virtual int getFD() const;
42
43    virtual bool error() const;
44
45    /* Inform callers if there is IO in progress */
46    virtual bool ioInProgress() const;
47
48private:
49    void error(bool const &);
50    int fd;
51    String path;
52    AIODiskIOStrategy *strategy;
53    RefCount<IORequestor> ioRequestor;
54    bool closed;
55    bool error_;
56    CBDATA_CLASS2(AIODiskFile);
57};
58
59#endif /* USE_DISKIO_AIO */
60#endif /* SQUID_AIODISKFILE_H */
61
Note: See TracBrowser for help on using the repository browser.