Navigation Menu

Skip to content

Commit

Permalink
Rename DatumType to DataType and remove ColumnType.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yata committed Jun 25, 2014
1 parent a7305bc commit 4211711
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 32 deletions.
4 changes: 2 additions & 2 deletions new-interface/column.hpp
Expand Up @@ -11,8 +11,8 @@ class Column {
virtual Table *table() const = 0;
// 名前を取得する.
virtual const char *name() const = 0;
// カラムの種類を取得する
virtual ColumnType type() const = 0;
// カラムのデータ型を取得する
virtual DataType data_type() const = 0;
// 索引 ID の最小値を取得する.
virtual IndexID min_index_id() const = 0;
// 索引 ID の最大値を取得する.
Expand Down
4 changes: 2 additions & 2 deletions new-interface/datum.hpp
Expand Up @@ -61,7 +61,7 @@ class Datum {
Datum &operator=(Datum &&datum);

// 種類を返す.
DatumType type() const {
DataType type() const {
return type_;
}

Expand Down Expand Up @@ -129,7 +129,7 @@ class Datum {
void clear();

private:
DatumType type_;
DataType type_;
union {
std::nullptr_t null_;
bool bool_;
Expand Down
64 changes: 36 additions & 28 deletions new-interface/types.hpp
Expand Up @@ -47,40 +47,48 @@ class Column;
class Index;
class Datum;

enum ColumnType {
ID_COLUMN,
BOOL_COLUMN,
INT_COLUMN,
FLOAT_COLUMN,
TEXT_COLUMN,
REF_COLUMN,
BOOL_ARRAY_COLUMN,
INT_ARRAY_COLUMN,
FLOAT_ARRAY_COLUMN,
TEXT_ARRAY_COLUMN,
REF_ARRAY_COLUMN,
INDEX_COLUMN
enum DataType {
// 無効な型.
INVALID_DATA,

// 真偽値.
BOOLEAN_DATA,
// 64-bit 符号あり整数.
INTEGER_DATA,
// 倍精度浮動小数点数.
FLOAT_DATA,
// 時刻(The Unix Epoch からの経過マイクロ秒数).
TIME_DATA,
// 経緯度(ミリ秒単位).
GEO_POINT_DATA,
// 文字列.
TEXT_DATA,
// 参照.
REFERENCE_DATA,

// 上述の型を配列にしたもの.
BOOLEAN_ARRAY_DATA,
INTEGER_ARRAY_DATA,
FLOAT_ARRAY_DATA,
TIME_ARRAY_DATA,
GEO_POINT_ARRAY_DATA,
TEXT_ARRAY_DATA,
REFERENCE_ARRAY_DATA
};

std::ostream &operator<<(std::ostream &stream, ColumnType column_type);

enum DatumType {
NULL_DATUM,
BOOL_DATUM,
INT_DATUM,
FLOAT_DATUM,
TEXT_DATUM,
BOOL_ARRAY_DATUM,
INT_ARRAY_DATUM,
FLOAT_ARRAY_DATUM,
TEXT_ARRAY_DATUM
};

std::ostream &operator<<(std::ostream &stream, DatumType datum_type);
std::ostream &operator<<(std::ostream &stream, DataType data_type);

enum IndexType {
// 木構造にもとづく索引.
// 範囲検索をサポートする.
TREE_INDEX,

// ハッシュ表にもとづく索引.
// TREE_INDEX と比べると,データの登録・削除と完全一致検索が速い代わり,
// 範囲検索などには向かない(あるいは使えない).
HASH_INDEX

// TODO: 全文検索用の索引は,こちらの索引に加えるか,まったく別の索引として扱う.
};

std::ostream &operator<<(std::ostream &stream, IndexType index_type);
Expand Down

0 comments on commit 4211711

Please sign in to comment.