Subscription.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 #ifndef _SQUID_BASE_SUBSCRIPTION_H
10 #define _SQUID_BASE_SUBSCRIPTION_H
11 
12 #include "base/AsyncCall.h"
13 
26 {
27 public:
29 
34  virtual AsyncCall::Pointer callback() const = 0;
35 };
36 
47 template<class Call_>
49 {
50 public:
52  explicit CallSubscription(const RefCount<Call_> &aCall) : call(aCall) { assert(aCall != NULL); }
53  virtual AsyncCall::Pointer callback() const { return new Call_(*call); }
54 
55 private:
57 };
58 
59 #endif /* _SQUID_BASE_SUBSCRIPTION_H */
60 
#define assert(EX)
Definition: assert.h:17
virtual AsyncCall::Pointer callback() const =0
const RefCount< Call_ > call
gets copied to create callback calls
Definition: Subscription.h:56
RefCount< Subscription > Pointer
Definition: Subscription.h:28
virtual AsyncCall::Pointer callback() const
Definition: Subscription.h:53
CallSubscription(const RefCount< Call_ > &aCall)
Must be passed an object. nil pointers are not permitted.
Definition: Subscription.h:52
#define NULL
Definition: types.h:166

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors