41#define SORT_DEBUG if (0)
84template <
class T,
class Compare>
86 Compare *cmp,
int deleteInputStream = 0)
92 assert(instream && outstream && cmp);
95 if (instreamLength == 0) {
123 cout <<
"ami_sort: instream = " <<
name << endl;
128 else if (
runList->length() == 1) {
146 cout <<
"AMI_sort: done" << endl << endl;
155template <
class T,
class Compare>
168 cout <<
"reading: " << *
crt << endl;
172 cout <<
"reading: " << *
crt << endl;
173 if (cmp.compare(*prev, *
crt) != -1)
int isSorted(AMI_STREAM< T > *str, Compare cmp)
AMI_err AMI_sort(AMI_STREAM< T > *instream, AMI_STREAM< T > **outstream, Compare *cmp, int deleteInputStream=0)
queue< char * > * runFormation(AMI_STREAM< T > *instream, Compare *cmp)
AMI_err name(char **stream_name)
AMI_err seek(off_t offset)
AMI_err read_item(T **elt)
#define assert(condition)