C++ Client API Reference for Oracle Coherence
14c (14.1.2.0.0)

F79659-03

coherence/util/filter/XorFilter.hpp

00001 /*
00002  * Copyright (c) 2000, 2020, Oracle and/or its affiliates.
00003  *
00004  * Licensed under the Universal Permissive License v 1.0 as shown at
00005  * http://oss.oracle.com/licenses/upl.
00006  */
00007 #ifndef COH_XOR_FILTER_HPP
00008 #define COH_XOR_FILTER_HPP
00009 
00010 #include "coherence/lang.ns"
00011 
00012 #include "coherence/util/Map.hpp"
00013 #include "coherence/util/filter/ArrayFilter.hpp"
00014 
00015 COH_OPEN_NAMESPACE3(coherence,util,filter)
00016 
00017 
00018 /**
00019 * Filter which returns the logical exclusive or ("xor") of two other filters.
00020 *
00021 * @author djl  2008.04.14
00022 */
00023 class COH_EXPORT XorFilter
00024     : public class_spec<XorFilter,
00025         extends<ArrayFilter> >
00026     {
00027     friend class factory<XorFilter>;
00028 
00029     // ----- constructors ---------------------------------------------------
00030 
00031     protected:
00032         /**
00033         * Default constructor (necessary for the PortableObject interface).
00034         */
00035         XorFilter();
00036 
00037         /**
00038         * Construct an XorFilter. The result is defined as:
00039         *   vFilterLeft ^ vFilterRight
00040         *
00041         * @param vFilterLeft   the "left" filter
00042         * @param vFilterRight  the "right" filter
00043         */
00044         XorFilter(Filter::View vFilterLeft, Filter::View vFilterRight);
00045 
00046     private:
00047         /**
00048         * Blocked copy constructor.
00049         */
00050         XorFilter(const XorFilter&);
00051 
00052 
00053     // ----- EntryFilter interface ------------------------------------------
00054 
00055     public:
00056         /**
00057         * {@inheritDoc}
00058         */
00059         virtual bool evaluateEntry(Map::Entry::View vEntry) const;
00060 
00061 
00062     // ----- Filter interface -----------------------------------------------
00063 
00064     public:
00065         /**
00066         * {@inheritDoc}
00067         */
00068         virtual bool evaluate(Object::View v) const;
00069 
00070 
00071     // ----- IndexAwareFilter interface -------------------------------------
00072 
00073     public:
00074         /**
00075         * {@inheritDoc}
00076         */
00077         virtual size32_t calculateEffectiveness(Map::View vMapIndexes,
00078                 Set::View vSetKeys) const;
00079 
00080         /**
00081         * {@inheritDoc}
00082         */
00083         virtual Filter::View applyIndex(Map::View vMapIndexes,
00084                 Set::Handle hSetKeys) const;
00085     };
00086 
00087 COH_CLOSE_NAMESPACE3
00088 
00089 #endif // COH_XOR_FILTER_HPP
Copyright © 2000, 2025, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.