]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/FunAction.h
4 * DEBUG: section 16 Cache Manager API
8 #ifndef SQUID_MGR_FUN_ACTION_H
9 #define SQUID_MGR_FUN_ACTION_H
11 #include "mgr/Action.h"
12 #include "mgr/ActionCreator.h"
18 /// function-based cache manager Action; a wrapper for so called legacy actions
19 /// that do everything using a single OBJH function
20 class FunAction
: public Action
23 FunAction(const CommandPointer
&cmd
, OBJH
*aHandler
);
26 static Pointer
Create(const CommandPointer
&cmd
, OBJH
*aHandler
);
29 virtual void respond(const Request
& request
);
30 // we cannot aggregate because we do not even know what the handler does
31 virtual bool aggregatable() const { return false; }
35 virtual void dump(StoreEntry
*entry
);
38 OBJH
*handler
; ///< legacy function that collects and dumps info
42 /// creates FunAction using ActionCreator API
43 class FunActionCreator
: public ActionCreator
46 explicit FunActionCreator(OBJH
*aHandler
): handler(aHandler
) {}
48 /* ActionCreator API */
49 virtual Action::Pointer
create(const CommandPointer
&cmd
) const {
50 return FunAction::Create(cmd
, handler
);
54 OBJH
*handler
; ///< legacy function to pass to the FunAction wrapper
59 #endif /* SQUID_MGR_FUN_ACTION_H */