2 * Copyright 2001-2007 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file shibsp/attribute/filtering/MatchFunctor.h
20 * A function that evaluates whether an expressed criteria is met by the current filter context.
23 #ifndef __shibsp_matchfunc_h__
24 #define __shibsp_matchfunc_h__
26 #include <shibsp/base.h>
30 class SHIBSP_API Attribute;
31 class SHIBSP_API FilteringContext;
34 * A function that evaluates whether an expressed criteria is met by the current filter context.
36 class SHIBSP_API MatchFunctor
38 MAKE_NONCOPYABLE(MatchFunctor);
42 virtual ~MatchFunctor() {}
45 * Evaluates this matching criteria. This evaluation is used when a filtering engine determines policy
\r
48 * @param filterContext current filtering context
\r
49 * @return true if the criteria for this matching function are met
\r
50 * @throws AttributeFilteringException thrown if the function can not be evaluated
\r
52 virtual bool evaluatePolicyRequirement(const FilteringContext& filterContext) const=0;
\r
55 * Evaluates this matching criteria. This evaluation is used when a filtering engine is filtering attribute
\r
58 * @param filterContext the current filtering context
\r
59 * @param attribute the attribute being evaluated
\r
60 * @param index the index of the attribute value being evaluated
\r
61 * @return true if the criteria for this matching function are met
\r
62 * @throws AttributeFilteringException thrown if the function can not be evaluated
\r
64 virtual bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const=0;
\r
68 * Registers MatchFunctor classes into the runtime.
70 void SHIBSP_API registerMatchFunctors();
73 #endif /* __shibsp_matchfunc_h__ */