]>
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 "adaptation/forward.h"
8 // Interface for grouping adaptation services together.
9 // Specific groups differ in how the first and the next services are selected
13 typedef Vector
<String
> Store
;
14 typedef Store::iterator iterator
;
17 // Information sufficient to iterate services stored in the group,
18 // grouped together to simplify initial/sequentialServices interfaces.
19 // The iterators point back to
21 Loop(const iterator
&b
, const iterator
&e
): begin(b
), end(e
) {}
27 ServiceGroup(const String
&aKind
);
28 virtual ~ServiceGroup();
31 virtual void finalize(); // called after all are parsed
33 virtual Loop
initialServices() = 0;
34 // TODO: virtual Loop sequentialServices() = 0;
42 // a group of equivalent services; one service per set is usually used
43 class ServiceSet
: public ServiceGroup
47 virtual Loop
initialServices();
50 // corner case: a group consisting of one service
51 class SingleService
: public ServiceGroup
54 SingleService(const String
&aServiceKey
);
55 virtual Loop
initialServices();
58 // TODO: a group of services that must be used one after another
59 // class ServiceChain: public ServiceGroup
62 typedef Vector
<Adaptation::ServiceGroup
*> Groups
;
63 extern Groups
&AllGroups();
64 extern ServiceGroup
*FindGroup(const ServiceGroup::Id
&id
);
67 } // namespace Adaptation
69 #endif /* SQUID_ADAPTATION__SERVICE_GROUPS_H */