Oracle Coherence for C++ API
Release 3.6.0.0

E15728-01

coherence/util/aggregator/Float64Average.hpp

00001 /*
00002 * Float64Average.hpp
00003 *
00004 * Copyright (c) 2000, 2010, 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_FLOAT64_AVERAGE_HPP
00017 #define COH_FLOAT64_AVERAGE_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/util/aggregator/AbstractFloat64Aggregator.hpp"
00022 #include "coherence/util/ValueExtractor.hpp"
00023 
00024 COH_OPEN_NAMESPACE3(coherence,util,aggregator)
00025 
00026 
00027 /**
00028 * Calculates an average for values of any numberic type extracted from a set
00029 * of entries in a Map. All the extracted Number objects will be treated as
00030 * <tt>float64_t</tt> values. If the set of entries is empty, a
00031 * <tt>NULL</tt> result is returned.
00032 
00033 * @author djl  2008.05.09
00034 */
00035 class COH_EXPORT Float64Average
00036     : public class_spec<Float64Average,
00037         extends<AbstractFloat64Aggregator> >
00038     {
00039     friend class factory<Float64Average>;
00040 
00041     // ----- constructors ---------------------------------------------------
00042 
00043     protected:
00044         /**
00045         * Default constructor (necessary for the PortableObject interface).
00046         */
00047         Float64Average();
00048 
00049         /**
00050         * Construct a Float64Average aggregator.
00051         *
00052         * @param vExtractor  the extractor that provides a value in the form
00053         *                    of any object that is a Number
00054         */
00055         Float64Average(ValueExtractor::View vExtractor);
00056 
00057 
00058     // ----- AbstractAggregator Interface  ----------------------------------
00059 
00060     protected:
00061         /**
00062         * {@inheritDoc}
00063         */
00064         virtual void init(bool fFinal);
00065 
00066         /**
00067         * {@inheritDoc}
00068         */
00069         virtual void process(Object::View v, bool fFinal);
00070 
00071         /**
00072         * {@inheritDoc}
00073         */
00074         virtual Object::Holder finalizeResult(bool fFinal);
00075     };
00076 
00077 COH_CLOSE_NAMESPACE3
00078 
00079 #endif // COH_FLOAT64_AVERAGE_HPP
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.