FunAction.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 /* 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 
17 namespace Mgr
18 {
19 
22 class FunAction: public Action
23 {
24 protected:
25  FunAction(const CommandPointer &cmd, OBJH *aHandler);
26 
27 public:
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 
35 protected:
36  /* Action API */
37  virtual void dump(StoreEntry *entry);
38 
39 private:
41 };
42 
45 {
46 public:
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 
54 private:
56 };
57 
58 } // namespace Mgr
59 
60 #endif /* SQUID_MGR_FUN_ACTION_H */
61 
cache manager request
Definition: Request.h:22
OBJH * handler
legacy function to pass to the FunAction wrapper
Definition: FunAction.h:55
struct _request * request(char *urlin)
Definition: tcp-banger2.c:291
creates FunAction using ActionCreator API
Definition: FunAction.h:44
FunAction(const CommandPointer &cmd, OBJH *aHandler)
Definition: FunAction.cc:29
void OBJH(StoreEntry *)
Definition: forward.h:44
virtual Action::Pointer create(const CommandPointer &cmd) const
returns a pointer to the new Action object for cmd; never nil
Definition: FunAction.h:50
FunActionCreator(OBJH *aHandler)
Definition: FunAction.h:47
OBJH * handler
legacy function that collects and dumps info
Definition: FunAction.h:40
virtual void respond(const Request &request)
respond to Coordinator request; default is to collect and sendResponse
Definition: FunAction.cc:37
virtual void dump(StoreEntry *entry)
Definition: FunAction.cc:47
const CommandPointer cmd
the command that caused this action
Definition: Action.h:86
static Pointer Create(const CommandPointer &cmd, OBJH *aHandler)
Definition: FunAction.cc:24
virtual bool aggregatable() const
Definition: FunAction.h:33

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors