FunAction.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 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 virtual void respond(const Request& request);
32 // we cannot aggregate because we do not even know what the handler does
33 virtual bool aggregatable() const { return false; }
34
35protected:
36 /* Action API */
37 virtual void dump(StoreEntry *entry);
38
39private:
41};
42
45{
46public:
47 explicit FunActionCreator(OBJH *aHandler): handler(aHandler) {}
48
49 /* ActionCreator API */
50 virtual Action::Pointer create(const CommandPointer &cmd) const {
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
virtual Action::Pointer create(const CommandPointer &cmd) const
returns a pointer to the new Action object for cmd; never nil
Definition: FunAction.h:50
virtual void respond(const Request &request)
respond to Coordinator request; default is to collect and sendResponse
Definition: FunAction.cc:38
FunAction(const CommandPointer &cmd, OBJH *aHandler)
Definition: FunAction.cc:30
static Pointer Create(const CommandPointer &cmd, OBJH *aHandler)
Definition: FunAction.cc:25
virtual bool aggregatable() const
Definition: FunAction.h:33
OBJH * handler
legacy function that collects and dumps info
Definition: FunAction.h:40
virtual void dump(StoreEntry *entry)
Definition: FunAction.cc:48
cache manager request
Definition: Request.h:23
void OBJH(StoreEntry *)
Definition: forward.h:44
Cache Manager API.
Definition: Action.h:20
struct _request * request(char *urlin)
Definition: tcp-banger2.c:291

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors