source: squid-ssl/trunk/fuentes/src/DiskIO/DiskDaemon/DiskdFile.h @ 5495

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

Initial release

File size: 1.5 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/* DEBUG: section 79    Squid-side DISKD I/O functions. */
10
11#ifndef __STORE_DISKDFILE_H__
12#define __STORE_DISKDFILE_H__
13
14#include "cbdata.h"
15#include "DiskIO/DiskFile.h"
16
17class DiskdIOStrategy;
18
19struct diomsg;
20
21/**
22 \ingroup diskd
23 */
24class DiskdFile : public DiskFile
25{
26
27public:
28    DiskdFile(char const *path, DiskdIOStrategy *);
29    ~DiskdFile();
30    virtual void open(int flags, mode_t aMode, RefCount<IORequestor> callback);
31    virtual void create(int flags, mode_t aMode, RefCount<IORequestor> callback);
32    virtual void read(ReadRequest *);
33    virtual void write(WriteRequest *);
34    virtual void close();
35    virtual bool error() const;
36    virtual bool canRead() const;
37    virtual bool ioInProgress() const;
38
39    /* Temporary */
40    int getID() const {return id;}
41
42    void completed(diomsg *);
43
44private:
45    int id;
46    char const *path_;
47    bool errorOccured;
48    DiskdIOStrategy *IO;
49    RefCount<IORequestor> ioRequestor;
50    void openDone(diomsg *);
51    void createDone (diomsg *);
52    void readDone (diomsg *);
53    void writeDone (diomsg *);
54    void closeDone (diomsg *);
55    int mode;
56    void notifyClient();
57    bool canNotifyClient() const;
58    void ioAway();
59    void ioCompleted();
60    size_t inProgressIOs;
61
62    CBDATA_CLASS2(DiskdFile);
63};
64
65#endif
66
Note: See TracBrowser for help on using the repository browser.