Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

coherence/util/filter/ValueChangeEventFilter.hpp

00001 /*
00002 * ValueChangeEventFilter.hpp
00003 *
00004 * Copyright (c) 2000, 2013, 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_VALUE_CHANGE_EVENT_FILTER_HPP
00017 #define COH_VALUE_CHANGE_EVENT_FILTER_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/util/filter/ExtractorFilter.hpp"
00022 #include "coherence/util/ValueExtractor.hpp"
00023 
00024 COH_OPEN_NAMESPACE3(coherence,util,filter)
00025 
00026 
00027 /**
00028 * Filter which evaluates the content of a MapEvent values based on the
00029 * specified value extractor.  This filter evaluates to true only for update
00030 * events that change the value of an extracted attribute.
00031 *
00032 * Example: a filter that evaluates to true if there is an update to an
00033 * Employee object that changes a value of the LastName property.
00034 * <pre>
00035 *   ValueChangeEventFilter::create(ReflectionExtractor::create("LastName"));
00036 * </pre>
00037 *
00038 * see MapEventFilter
00039 *
00040 * @author djl  2008.05.19
00041 */
00042 class COH_EXPORT ValueChangeEventFilter
00043     : public class_spec<ValueChangeEventFilter,
00044         extends<ExtractorFilter> >
00045     {
00046     friend class factory<ValueChangeEventFilter>;
00047 
00048     // ----- constructors ---------------------------------------------------
00049 
00050     protected:
00051         /**
00052         * Default constructor (necessary for the PortableObject interface).
00053         */
00054         ValueChangeEventFilter();
00055 
00056         /**
00057         * Construct a ValueChangeEventFilter that evaluates MapEvent values
00058         * based on the specified extractor.
00059         *
00060         * @param vExtractor  ValueExtractor to extract MapEvent values
00061         */
00062         ValueChangeEventFilter(ValueExtractor::View vValueExtractor);
00063 
00064     private:
00065         /**
00066         * Blocked copy constructor.
00067         */
00068         ValueChangeEventFilter(const ValueChangeEventFilter&);
00069 
00070 
00071     // ----- ExtractorFilter interface --------------------------------------
00072 
00073     protected:
00074         /**
00075         * Evaluate the specified extracted value.
00076         *
00077         * @param vExtracted  an extracted value to evaluate
00078         */
00079         virtual bool evaluateExtracted(Object::View vExtracted) const;
00080 
00081 
00082     // ----- Filter interface -----------------------------------------------
00083 
00084     public:
00085         /**
00086         * {@inheritDoc}
00087         */
00088         virtual bool evaluate(Object::View v) const;
00089 
00090 
00091     // ----- Object interface -----------------------------------------------
00092 
00093     public:
00094         /**
00095         * {@inheritDoc}
00096         */
00097         virtual bool equals(Object::View v) const;
00098 
00099         /**
00100         * {@inheritDoc}
00101         */
00102         virtual size32_t hashCode() const;
00103 
00104         /**
00105         * {@inheritDoc}
00106         */
00107         virtual void toStream(std::ostream& out) const;
00108     };
00109 
00110 COH_CLOSE_NAMESPACE3
00111 
00112 #endif // COH_VALUE_CHANGE_EVENT_FILTER_HPP
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.