Created
May 25, 2014 12:44
-
-
Save ryanjdew/6d2d51006a3c58bff8c0 to your computer and use it in GitHub Desktop.
C++ reduce MarkLogic UDF function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class T> | |
void Bucketeer<T>:: | |
reduce(const AggregateUDF* _o, Reporter& reporter) | |
{ | |
/* Merge matches found */ | |
const Bucketeer<T> *o = (const Bucketeer<T>*)_o; | |
typename std::multimap<String, T> o_buckets = o->buckets; | |
for (typename std::multimap<String, T>::iterator it = o_buckets.begin(); it != o_buckets.end(); it++) { | |
buckets.insert(typename std::pair <String, T> (it->first, it->second)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment