Navigation Menu

Skip to content

Commit

Permalink
Add Sorter::sort() for convenience and remove SortStatus.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yata committed Jun 19, 2014
1 parent e4d306f commit b19229f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions new-interface/sorter.hpp
Expand Up @@ -5,11 +5,6 @@

namespace grnxx {

enum SortStatus {
SORT_CONTINUE,
SORT_FINISH
};

class Sorter {
public:
Sorter();
Expand Down Expand Up @@ -54,6 +49,18 @@ class Sorter {
// - 演算で例外が発生する.
// - リソースを確保できない.
virtual bool finish(Error *error) = 0;

// レコードの一覧を整列する.
// 成功すれば true を返す.
// 失敗したときは *error にその内容を格納し, false を返す.
//
// reset(), finish() を呼び出すことで整列をおこなう.
//
// 失敗する状況としては,以下のようなものが挙げられる.
// - 不正なレコードの一覧が指定された.
// - 演算で例外が発生する.
// - リソースを確保できない.
virtual bool sort(Error *error, RecordSet *record_set) = 0;
};

} // namespace grnxx
Expand Down

0 comments on commit b19229f

Please sign in to comment.