00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 #ifndef COH_ABSTRACT_COMPARABLE_AGGREGATOR_HPP
00017 #define COH_ABSTRACT_COMPARABLE_AGGREGATOR_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/util/aggregator/AbstractAggregator.hpp"
00022 #include "coherence/util/Comparator.hpp"
00023 #include "coherence/util/ValueExtractor.hpp"
00024 
00025 COH_OPEN_NAMESPACE3(coherence,util,aggregator)
00026 
00027 using coherence::io::pof::PofReader;
00028 using coherence::io::pof::PofWriter;
00029 using coherence::io::pof::PortableObject;
00030 
00031 using coherence::util::Comparator;
00032 using coherence::util::ValueExtractor;
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 class COH_EXPORT AbstractComparableAggregator
00050     : public abstract_spec<AbstractComparableAggregator,
00051         extends<AbstractAggregator> >
00052     {
00053     
00054 
00055     protected:
00056 
00057 
00058 
00059         AbstractComparableAggregator();
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069         AbstractComparableAggregator(ValueExtractor::View vExtractor,
00070                 Comparator::View vComparator = NULL);
00071 
00072 
00073     
00074 
00075     protected:
00076 
00077 
00078 
00079         virtual void init(bool fFinal);
00080 
00081 
00082 
00083 
00084         virtual Object::Holder finalizeResult(bool fFinal);
00085 
00086 
00087     
00088 
00089     public:
00090 
00091 
00092 
00093         virtual void readExternal(PofReader::Handle hIn);
00094 
00095 
00096 
00097 
00098         virtual void writeExternal(PofWriter::Handle hOut) const;
00099 
00100 
00101     
00102 
00103     protected:
00104 
00105 
00106 
00107         int32_t m_count;
00108 
00109 
00110 
00111 
00112         MemberView<Object> m_vResult;
00113 
00114 
00115 
00116 
00117         MemberView<Comparator> m_vComparator;
00118     };
00119 
00120 COH_CLOSE_NAMESPACE3
00121 
00122 #endif // COH_ABSTRACT_COMPARABLE_AGGREGATOR_HPP