]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/ServiceGroups.h
1 #ifndef SQUID_ADAPTATION__SERVICE_GROUPS_H
2 #define SQUID_ADAPTATION__SERVICE_GROUPS_H
4 #include "SquidString.h"
6 #include "adaptation/forward.h"
10 // Interface for grouping adaptation services together.
11 // Specific groups differ in how the first and the next services are selected
15 typedef Vector
<String
> Store
;
16 typedef Store::iterator iterator
;
19 // Information sufficient to iterate services stored in the group,
20 // grouped together to simplify initial/sequentialServices interfaces.
21 // The iterators point back to
23 Loop(const iterator
&b
, const iterator
&e
): begin(b
), end(e
) {}
29 ServiceGroup(const String
&aKind
);
30 virtual ~ServiceGroup();
33 virtual void finalize(); // called after all are parsed
35 virtual Loop
initialServices() = 0;
36 // TODO: virtual Loop sequentialServices() = 0;
44 // a group of equivalent services; one service per set is usually used
45 class ServiceSet
: public ServiceGroup
49 virtual Loop
initialServices();
52 // corner case: a group consisting of one service
53 class SingleService
: public ServiceGroup
56 SingleService(const String
&aServiceKey
);
57 virtual Loop
initialServices();
60 // TODO: a group of services that must be used one after another
61 // class ServiceChain: public ServiceGroup
64 typedef Vector
<Adaptation::ServiceGroup
*> Groups
;
65 extern Groups
&AllGroups();
66 extern ServiceGroup
*FindGroup(const ServiceGroup::Id
&id
);
69 } // namespace Adaptation
71 #endif /* SQUID_ADAPTATION__SERVICE_GROUPS_H */