BlockingFile.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 /* DEBUG: section 47 Store Directory Routines */
10 
11 #ifndef SQUID_BLOCKINGFILE_H
12 #define SQUID_BLOCKINGFILE_H
13 
14 #include "cbdata.h"
15 #include "DiskIO/DiskFile.h"
16 #include "DiskIO/IORequestor.h"
17 #include "typedefs.h" //DRCB, DWCB
18 
19 class BlockingFile : public DiskFile
20 {
22 
23 public:
24  BlockingFile(char const *path);
25  ~BlockingFile();
26  virtual void open(int flags, mode_t mode, RefCount<IORequestor> callback);
27  virtual void create(int flags, mode_t mode, RefCount<IORequestor> callback);
28  virtual void read(ReadRequest *);
29  virtual void write(WriteRequest *);
30  virtual void close();
31  virtual bool error() const;
32  virtual int getFD() const { return fd;}
33 
34  virtual bool canRead() const;
35  virtual bool ioInProgress() const;
36 
37 private:
38  static DRCB ReadDone;
39  static DWCB WriteDone;
40  int fd;
41  bool closed;
42  void error (bool const &);
43  bool error_;
44  char const *path_;
48  void doClose();
49  void readDone(int fd, const char *buf, int len, int errflag);
50  void writeDone(int fd, int errflag, size_t len);
51 };
52 
53 #endif /* SQUID_BLOCKINGFILE_H */
54 
BlockingFile(char const *path)
Definition: BlockingFile.cc:25
void const char HLPCB * callback
Definition: stub_helper.cc:16
static DRCB ReadDone
Definition: BlockingFile.h:38
RefCount< IORequestor > ioRequestor
Definition: BlockingFile.h:45
virtual void write(WriteRequest *)
void DWCB(int, int, size_t, void *)
Definition: typedefs.h:18
virtual void create(int flags, mode_t mode, RefCount< IORequestor > callback)
Definition: BlockingFile.cc:62
virtual bool ioInProgress() const
void readDone(int fd, const char *buf, int len, int errflag)
virtual void read(ReadRequest *)
virtual int getFD() const
Definition: BlockingFile.h:32
virtual void open(int flags, mode_t mode, RefCount< IORequestor > callback)
Definition: BlockingFile.cc:39
virtual void close()
Definition: BlockingFile.cc:79
void writeDone(int fd, int errflag, size_t len)
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
void DRCB(int, const char *buf, int size, int errflag, void *data)
Definition: typedefs.h:16
void const char * buf
Definition: stub_helper.cc:16
unsigned short mode_t
Definition: types.h:150
CBDATA_CLASS(BlockingFile)
char const * path_
Definition: BlockingFile.h:44
virtual bool error() const
Definition: BlockingFile.cc:94
static DWCB WriteDone
Definition: BlockingFile.h:39
virtual bool canRead() const
Definition: BlockingFile.cc:88
RefCount< WriteRequest > writeRequest
Definition: BlockingFile.h:47
RefCount< ReadRequest > readRequest
Definition: BlockingFile.h:46
void doClose()
Definition: BlockingFile.cc:68

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors