00001 /* 00002 * Integer64Sum.hpp 00003 * 00004 * Copyright (c) 2000, 2019, 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_INTEGER64_SUM_HPP 00017 #define COH_INTEGER64_SUM_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/aggregator/AbstractInteger64Aggregator.hpp" 00022 #include "coherence/util/ValueExtractor.hpp" 00023 00024 COH_OPEN_NAMESPACE3(coherence,util,aggregator) 00025 00026 00027 /** 00028 * Sums up numeric values extracted from a set of entries in a Map. All the 00029 * extracted Number objects will be treated as <tt>int64_t</tt> values. 00030 * 00031 * @author djl 2008.05.12 00032 */ 00033 class COH_EXPORT Integer64Sum 00034 : public class_spec<Integer64Sum, 00035 extends<AbstractInteger64Aggregator> > 00036 { 00037 friend class factory<Integer64Sum>; 00038 00039 // ----- constructors --------------------------------------------------- 00040 00041 protected: 00042 /** 00043 * Default constructor (necessary for the PortableObject interface). 00044 */ 00045 Integer64Sum(); 00046 00047 /** 00048 * Construct a Integer64Sum aggregator. 00049 * 00050 * @param vExtractor the extractor that provides a value in the form 00051 * of any object that is a Number 00052 */ 00053 Integer64Sum(ValueExtractor::View vExtractor); 00054 00055 /** 00056 * Construct an Integer64Sum that will aggregate values extracted 00057 * from a set of InvocableMap::Entry objects. 00058 * 00059 * @param vsMethod the name of the method that could be invoked via 00060 * reflection and that returns values to aggregate; 00061 * this parameter can also be a dot-delimited 00062 * sequence of method names which would result in 00063 * an aggregator based on the ChainedExtractor that 00064 * is based on an array of corresponding 00065 * ReflectionExtractor objects 00066 * 00067 * @since Coherence 12.1.2 00068 */ 00069 Integer64Sum(String::View vsMethod); 00070 00071 private: 00072 /** 00073 * Blocked copy constructor. 00074 */ 00075 Integer64Sum(const Integer64Sum&); 00076 00077 00078 // ----- AbstractAggregator Interface ---------------------------------- 00079 00080 protected: 00081 /** 00082 * {@inheritDoc} 00083 */ 00084 virtual void init(bool fFinal); 00085 00086 /** 00087 * {@inheritDoc} 00088 */ 00089 virtual void process(Object::View v, bool fFinal); 00090 }; 00091 00092 COH_CLOSE_NAMESPACE3 00093 00094 #endif // COH_INTEGER64_SUM_HPP