]> git.ipfire.org Git - thirdparty/squid.git/blob - src/StoreIOState.cc
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / StoreIOState.cc
1 /*
2 * Copyright (C) 1996-2014 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 20 Swap Dir base object */
10
11 #include "squid.h"
12 #include "Debug.h"
13 #include "defines.h"
14 #include "StoreIOState.h"
15
16 void *
17 StoreIOState::operator new (size_t amount)
18 {
19 assert(0);
20 return (void *)1;
21 }
22
23 void
24 StoreIOState::operator delete (void *address) {assert (0);}
25
26 StoreIOState::StoreIOState() :
27 swap_dirn(-1), swap_filen(-1), e(NULL), mode(O_BINARY),
28 offset_(0), file_callback(NULL), callback(NULL), callback_data(NULL)
29 {
30 read.callback = NULL;
31 read.callback_data = NULL;
32 flags.closing = false;
33 }
34
35 off_t
36 StoreIOState::offset() const
37 {
38 return offset_;
39 }
40
41 StoreIOState::~StoreIOState()
42 {
43 debugs(20,3, "StoreIOState::~StoreIOState: " << this);
44
45 if (read.callback_data)
46 cbdataReferenceDone(read.callback_data);
47
48 if (callback_data)
49 cbdataReferenceDone(callback_data);
50 }