Oracle Coherence for C++ API
Release 3.7.0.0

E18684-01

coherence/util/filter/InFilter.hpp

00001 /*
00002 * InFilter.hpp
00003 *
00004 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
00005 *
00006 * Oracle is a registered trademarks of Oracle Corporation and/or its
00007 * affiliates.
00008 *
00009 * This software is the confidential and proprietary information of Oracle
00010 * Corporation. You shall not disclose such confidential and proprietary
00011 * information and shall use it only in accordance with the terms of the
00012 * license agreement you entered into with Oracle.
00013 *
00014 * This notice may not be removed or altered.
00015 */
00016 #ifndef COH_IN_FILTER_HPP
00017 #define COH_IN_FILTER_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/util/Set.hpp"
00022 #include "coherence/util/ValueExtractor.hpp"
00023 #include "coherence/util/filter/ComparisonFilter.hpp"
00024 #include "coherence/util/filter/IndexAwareFilter.hpp"
00025 
00026 COH_OPEN_NAMESPACE3(coherence,util,filter)
00027 
00028 
00029 /**
00030 * Filter which checks whether the result of a method invocation belongs to a
00031 * predefined set of values.
00032 *
00033 * @author djl  2008.04.07
00034 */
00035 class COH_EXPORT InFilter
00036     : public class_spec<InFilter,
00037         extends<ComparisonFilter>,
00038         implements<IndexAwareFilter> >
00039     {
00040     friend class factory<InFilter>;
00041 
00042     // ----- constructors ---------------------------------------------------
00043 
00044     protected:
00045         /**
00046         * Default constructor (necessary for the PortableObject interface).
00047         */
00048         InFilter();
00049 
00050         /**
00051         * Construct an InFilter for testing "In" condition.
00052         *
00053         * @param vExtractor  the ValueExtractor to use by this filter
00054         * @param vSetValues  the set of values to compare the result with
00055         */
00056         InFilter(ValueExtractor::View vExtractor, Set::View vSetValues);
00057 
00058 
00059     // ----- ExtractorFilter interface --------------------------------------
00060 
00061     protected:
00062         /**
00063         * {@inheritDoc}
00064         */
00065         virtual bool evaluateExtracted(Object::View vExtracted) const;
00066 
00067 
00068     // ----- IndexAwareFilter interface -------------------------------------
00069 
00070     public:
00071         /**
00072         * {@inheritDoc}
00073         */
00074         virtual size32_t calculateEffectiveness(Map::View vMapIndexes,
00075                 Set::View vSetKeys) const;
00076 
00077         /**
00078         * {@inheritDoc}
00079         */
00080         virtual Filter::View applyIndex(Map::View vMapIndexes,
00081                 Set::Handle hSetKeys) const;
00082    };
00083 
00084 COH_CLOSE_NAMESPACE3
00085 
00086 #endif // COH_IN_FILTER_HPP
Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.