FunAction.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/* DEBUG: section 16 Cache Manager API */
10
11#ifndef SQUID_MGR_FUN_ACTION_H
12#define SQUID_MGR_FUN_ACTION_H
13
14#include "mgr/Action.h"
15#include "mgr/ActionCreator.h"
16
17namespace Mgr
18{
19
22class FunAction: public Action
23{
24protected:
25 FunAction(const CommandPointer &cmd, OBJH *aHandler);
26
27public:
28 static Pointer Create(const CommandPointer &cmd, OBJH *aHandler);
29
30 /* Action API */
31 void respond(const Request& request) override;
32 // we cannot aggregate because we do not even know what the handler does
33 bool aggregatable() const override { return false; }
34
35protected:
36 /* Action API */
37 void dump(StoreEntry *entry) override;
38
39private:
41};
42
45{
46public:
47 explicit FunActionCreator(OBJH *aHandler): handler(aHandler) {}
48
49 /* ActionCreator API */
50 Action::Pointer create(const CommandPointer &cmd) const override {
51 return FunAction::Create(cmd, handler);
52 }
53
54private:
56};
57
58} // namespace Mgr
59
60#endif /* SQUID_MGR_FUN_ACTION_H */
61
const CommandPointer cmd
the command that caused this action
Definition: Action.h:86
creates FunAction using ActionCreator API
Definition: FunAction.h:45
FunActionCreator(OBJH *aHandler)
Definition: FunAction.h:47
OBJH * handler
legacy function to pass to the FunAction wrapper
Definition: FunAction.h:55
Action::Pointer create(const CommandPointer &cmd) const override
returns a pointer to the new Action object for cmd; never nil
Definition: FunAction.h:50
FunAction(const CommandPointer &cmd, OBJH *aHandler)
Definition: FunAction.cc:30
void respond(const Request &request) override
respond to Coordinator request; default is to collect and sendResponse
Definition: FunAction.cc:38
static Pointer Create(const CommandPointer &cmd, OBJH *aHandler)
Definition: FunAction.cc:25
OBJH * handler
legacy function that collects and dumps info
Definition: FunAction.h:40
bool aggregatable() const override
Definition: FunAction.h:33
void dump(StoreEntry *entry) override
Definition: FunAction.cc:48
cache manager request
Definition: Request.h:24
void OBJH(StoreEntry *)
Definition: forward.h:44
Cache Manager API.
Definition: Action.h:20

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors