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);
282 err ptr_sort(stream<T> *instream_ami,
283 progress_indicator_base* indicator=NULL) {
284 TP_LOG_WARNING_ID(
"tpie::ami::ptr_sort is deprecated");
285 return sort(instream_ami, indicator);
294 template<
class T,
class CMPR>
295 err ptr_sort(stream<T> *instream_ami,
296 CMPR *cmp, progress_indicator_base* indicator=NULL) {
297 TP_LOG_WARNING_ID(
"tpie::ami::ptr_sort is deprecated");
298 return sort(instream_ami, cmp, indicator);
307 template<
class T,
class KEY,
class CMPR>
308 err key_sort(stream<T> *instream_ami,
309 KEY , CMPR *cmp, progress_indicator_base* indicator=NULL) {
310 TP_LOG_WARNING_ID(
"tpie::ami::key_sort is deprecated");
311 return sort(instream_ami, cmp, indicator);
318 #endif // __TPIE_SORT_DEPRECATED_H__
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.
An error occurred at the BTE level.
void sort(file_stream< T > &instream, file_stream< T > &outstream, Compare comp, progress_indicator_base &indicator)
Sort elements of a stream using the given STL-style comparator object.
An attempt was made to read past the end of a stream or write past the end of a substream.