]> git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/CapturingStoreEntry.h
Create an explicit EventLoop class which can be used to run an event loop
[thirdparty/squid.git] / src / tests / CapturingStoreEntry.h
1 #ifndef SQUID_TESTS_CAPTURINGSTORE_ENTRY_H
2 #define SQUID_TESTS_CAPTURINGSTORE_ENTRY_H
3
4 #include "Mem.h"
5 #include "Store.h"
6
7 /* class that captures various call data for test analysis */
8
9 class CapturingStoreEntry : public StoreEntry
10 {
11
12 public:
13 MEMPROXY_CLASS(CapturingStoreEntry);
14
15 CapturingStoreEntry() : _buffer_calls(0), _flush_calls(0) {}
16
17 String _appended_text;
18 int _buffer_calls;
19 int _flush_calls;
20
21 virtual void buffer()
22 {
23 _buffer_calls += 1;
24 }
25
26 virtual void flush()
27 {
28 _flush_calls += 1;
29 }
30
31 virtual void append(char const * buf, int len)
32 {
33 _appended_text.append(buf, len);
34 }
35 };
36
37 MEMPROXY_CLASS_INLINE(CapturingStoreEntry);
38
39 #endif