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