]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/ActionProfile.h
Merged from trunk
[thirdparty/squid.git] / src / mgr / ActionProfile.h
1 /*
2 * Copyright (C) 1996-2015 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_ACTION_PROFILE_H
12 #define SQUID_MGR_ACTION_PROFILE_H
13
14 #include "mgr/ActionCreator.h"
15 #include "mgr/forward.h"
16
17 namespace Mgr
18 {
19
20 /// hard-coded Cache Manager action configuration, including Action creator
21 class ActionProfile: public RefCountable
22 {
23 public:
24 typedef RefCount<ActionProfile> Pointer;
25
26 public:
27 ActionProfile(const char* aName, const char* aDesc, bool aPwReq,
28 bool anAtomic, const ActionCreatorPointer &aCreator):
29 name(aName), desc(aDesc), isPwReq(aPwReq), isAtomic(anAtomic),
30 creator(aCreator) {
31 }
32
33 public:
34 const char *name; ///< action label to uniquely identify this action
35 const char *desc; ///< action description to build an action menu list
36 bool isPwReq; ///< whether password is required to perform the action
37 bool isAtomic; ///< whether action dumps everything in one dump() call
38 ActionCreatorPointer creator; ///< creates Action objects with this profile
39 };
40
41 } // namespace Mgr
42
43 inline std::ostream &
44 operator <<(std::ostream &os, const Mgr::ActionProfile &profile)
45 {
46 return os << profile.name;
47 }
48
49 #endif /* SQUID_MGR_ACTION_PROFILE_H */
50