20 #ifndef __TPIE_SORT_DEPRECATED_H__
21 #define __TPIE_SORT_DEPRECATED_H__
85 inline err exception_kind(
const exception & e) {
86 if (0 != dynamic_cast<const end_of_stream_exception *>(&e))
return END_OF_STREAM;
136 err sort(stream<T> *instream_ami, stream<T> *outstream_ami,
139 tpie::sort(instream_ami->underlying_stream(), outstream_ami->underlying_stream(), indicator);
140 }
catch (
const exception & e) {
141 TP_LOG_FATAL_ID(e.what());
142 return exception_kind(e);
159 template<
class T,
class CMPR>
160 err sort(stream<T> *instream_ami, stream<T> *outstream_ami,
161 CMPR *cmp, progress_indicator_base* indicator=NULL) {
163 TPIE2STL_cmp<T, CMPR> comp(cmp);
165 tpie::sort(instream_ami->underlying_stream(), outstream_ami->underlying_stream(), comp, *indicator);
167 progress_indicator_null dummy(1);
168 tpie::sort(instream_ami->underlying_stream(), outstream_ami->underlying_stream(), comp, dummy);
170 }
catch (
const exception & e) {
171 TP_LOG_FATAL_ID(e.what());
172 return exception_kind(e);
188 err ptr_sort(stream<T> *instream_ami, stream<T> *outstream_ami,
189 progress_indicator_base* indicator=NULL) {
191 TP_LOG_WARNING_ID(
"tpie::ami::ptr_sort is deprecated");
192 return sort(instream_ami, outstream_ami, indicator);
197 template<
class T,
class CMPR>
198 err ptr_sort(stream<T> *instream_ami, stream<T> *outstream_ami,
199 CMPR *cmp, progress_indicator_base* indicator=NULL) {
200 TP_LOG_WARNING_ID(
"tpie::ami::ptr_sort is deprecated");
201 return sort(instream_ami, outstream_ami, cmp, indicator);
213 template<
class T,
class KEY,
class CMPR>
214 err key_sort(stream<T> *instream_ami, stream<T> *outstream_ami,
215 KEY, CMPR *cmp, progress_indicator_base* indicator=NULL) {
216 TP_LOG_WARNING_ID(
"tpie::ami::key_sort is deprecated");
217 return sort(instream_ami, outstream_ami, cmp, indicator);
234 err sort(stream<T> *instream_ami,
235 progress_indicator_base* indicator=0) {
238 tpie::sort(instream_ami->underlying_stream(), *indicator);
240 progress_indicator_null dummy(1);
241 tpie::sort(instream_ami->underlying_stream(), dummy);
243 }
catch (
const exception & e) {
244 TP_LOG_FATAL_ID(e.what());
245 return exception_kind(e);
257 template<
class T,
class CMPR>
258 err sort(stream<T> *instream_ami,
259 CMPR *cmp, progress_indicator_base* indicator=NULL) {
261 TPIE2STL_cmp<T, CMPR> comp(cmp);
263 tpie::sort(instream_ami->underlying_stream(), comp, *indicator);
265 progress_indicator_null dummy(1);
266 tpie::sort(instream_ami->underlying_stream(), comp, dummy);
268 }
catch (
const exception & e) {
269 TP_LOG_FATAL_ID(e.what());
270 return exception_kind(e);
283 err ptr_sort(stream<T> *instream_ami,
284 progress_indicator_base* indicator=NULL) {
285 TP_LOG_WARNING_ID(
"tpie::ami::ptr_sort is deprecated");
286 return sort(instream_ami, indicator);
295 template<
class T,
class CMPR>
296 err ptr_sort(stream<T> *instream_ami,
297 CMPR *cmp, progress_indicator_base* indicator=NULL) {
298 TP_LOG_WARNING_ID(
"tpie::ami::ptr_sort is deprecated");
299 return sort(instream_ami, cmp, indicator);
308 template<
class T,
class KEY,
class CMPR>
309 err key_sort(stream<T> *instream_ami,
310 KEY , CMPR *cmp, progress_indicator_base* indicator=NULL) {
311 TP_LOG_WARNING_ID(
"tpie::ami::key_sort is deprecated");
312 return sort(instream_ami, cmp, indicator);
319 #endif // __TPIE_SORT_DEPRECATED_H__
void sort(uncompressed_stream< T > &instream, uncompressed_stream< T > &outstream, Compare comp, progress_indicator_base &indicator)
Sort elements of a stream using the given STL-style comparator object.
The base class for indicating the progress of some task.
Null-object progress indicator.
This file contains a few deprecated definitions for legacy code.
Conversion between STL and TPIE comparators.
err
Legacy TPIE error codes.
pipe_middle< bits::default_pred_sort_factory< default_store > > sort()
Pipelining sorter using std::less.
An error occurred at the BTE level.
An attempt was made to read past the end of a stream or write past the end of a substream.