00001 /* 00002 * AbstractInteger64Aggregator.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_ABSTRACT_INTEGER64_AGGREGATOR_HPP 00017 #define COH_ABSTRACT_INTEGER64_AGGREGATOR_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/aggregator/AbstractAggregator.hpp" 00022 #include "coherence/util/ValueExtractor.hpp" 00023 00024 COH_OPEN_NAMESPACE3(coherence,util,aggregator) 00025 00026 00027 /** 00028 * Abstract aggregator that processes numeric values extracted from a set of 00029 * entries in a Map. All the extracted Number objects will be treated as 00030 * <tt>int64_t</tt> values and the result of the aggregator is a Integer64. 00031 * If the set of entries is empty, a <tt>NULL</tt> result is returned. 00032 * 00033 * @author djl 2008.05.09 00034 */ 00035 class COH_EXPORT AbstractInteger64Aggregator 00036 : public abstract_spec<AbstractInteger64Aggregator, 00037 extends<AbstractAggregator> > 00038 { 00039 // ----- constructors --------------------------------------------------- 00040 00041 protected: 00042 /** 00043 * @internal 00044 */ 00045 AbstractInteger64Aggregator(); 00046 00047 /** 00048 * @internal 00049 */ 00050 AbstractInteger64Aggregator(ValueExtractor::View vExtractor); 00051 00052 /** 00053 * Construct an AbstractInteger64Aggregator that will aggregate 00054 * values extracted from a set of InvocableMap::Entry objects. 00055 * 00056 * @param vsMethod the name of the method that could be invoked via 00057 * reflection and that returns values to aggregate; 00058 * this parameter can also be a dot-delimited 00059 * sequence of method names which would result in 00060 * an aggregator based on the ChainedExtractor that 00061 * is based on an array of corresponding 00062 * ReflectionExtractor objects 00063 * 00064 * @since Coherence 12.1.2 00065 */ 00066 AbstractInteger64Aggregator(String::View vsMethod); 00067 00068 private: 00069 /** 00070 * Blocked copy constructor. 00071 */ 00072 AbstractInteger64Aggregator(const AbstractInteger64Aggregator&); 00073 00074 00075 // ----- AbstractAggregator Interface ---------------------------------- 00076 00077 protected: 00078 /** 00079 * {@inheritDoc} 00080 */ 00081 virtual void init(bool fFinal); 00082 00083 /** 00084 * {@inheritDoc} 00085 */ 00086 virtual Object::Holder finalizeResult(bool fFinal); 00087 00088 00089 // ----- data members --------------------------------------------------- 00090 00091 protected: 00092 /** 00093 * The count of processed entries. 00094 */ 00095 int32_t m_count; 00096 00097 /** 00098 * The running result value. 00099 */ 00100 int64_t m_lResult; 00101 }; 00102 00103 COH_CLOSE_NAMESPACE3 00104 00105 #endif // COH_ABSTRACT_INTEGER64_AGGREGATOR_HPP