]> git.ipfire.org Git - thirdparty/squid.git/blame - src/DiskIO/DiskDaemon/DiskdFile.h
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / DiskIO / DiskDaemon / DiskdFile.h
CommitLineData
59b2d47f 1/*
bbc27441 2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
59b2d47f 3 *
bbc27441
AJ
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.
59b2d47f 7 */
8
bbc27441
AJ
9/* DEBUG: section 79 Squid-side DISKD I/O functions. */
10
b9ae18aa 11#ifndef __STORE_DISKDFILE_H__
12#define __STORE_DISKDFILE_H__
13
aa839030 14#include "cbdata.h"
b9ae18aa 15#include "DiskIO/DiskFile.h"
59b2d47f 16
b9ae18aa 17class DiskdIOStrategy;
59b2d47f 18
b9ae18aa 19struct diomsg;
59b2d47f 20
63be0a78 21/**
22 \ingroup diskd
23 */
b9ae18aa 24class DiskdFile : public DiskFile
59b2d47f 25{
26
27public:
63be0a78 28 DiskdFile(char const *path, DiskdIOStrategy *);
b9ae18aa 29 ~DiskdFile();
63be0a78 30 virtual void open(int flags, mode_t aMode, RefCount<IORequestor> callback);
31 virtual void create(int flags, mode_t aMode, RefCount<IORequestor> callback);
b9ae18aa 32 virtual void read(ReadRequest *);
33 virtual void write(WriteRequest *);
63be0a78 34 virtual void close();
b9ae18aa 35 virtual bool error() const;
36 virtual bool canRead() const;
63be0a78 37 virtual bool ioInProgress() const;
59b2d47f 38
b9ae18aa 39 /* Temporary */
40 int getID() const {return id;}
59b2d47f 41
63be0a78 42 void completed(diomsg *);
b9ae18aa 43
44private:
45 int id;
46 char const *path_;
47 bool errorOccured;
48 DiskdIOStrategy *IO;
49 RefCount<IORequestor> ioRequestor;
b9ae18aa 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;
c7bf588b 61
f49c09b2 62 CBDATA_CLASS2(DiskdFile);
b9ae18aa 63};
59b2d47f 64
b9ae18aa 65#endif