Subscription.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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{
27public:
29
34 virtual AsyncCall::Pointer callback() const = 0;
35};
36
47template<class Call_>
49{
50public:
52 explicit CallSubscription(const RefCount<Call_> &aCall) : call(aCall) { assert(aCall != nullptr); }
54 {
55 const AsyncCall::Pointer cb = new Call_(*call);
58 return cb;
59 }
60
61private:
63};
64
65#endif /* _SQUID_BASE_SUBSCRIPTION_H */
66
#define RefCountable
The locking interface for use on Reference-Counted classes.
Definition: Lock.h:66
#define assert(EX)
Definition: assert.h:17
CodeContext::Pointer codeContext
what the callee is expected to work on
Definition: AsyncCall.h:74
CallSubscription(const RefCount< Call_ > &aCall)
Must be passed an object. nil pointers are not permitted.
Definition: Subscription.h:52
const RefCount< Call_ > call
gets copied to create callback calls
Definition: Subscription.h:62
AsyncCall::Pointer callback() const override
Definition: Subscription.h:53
static const Pointer & Current()
Definition: CodeContext.cc:33
RefCount< Subscription > Pointer
Definition: Subscription.h:28
virtual AsyncCall::Pointer callback() const =0

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors