2016-07-03 08:02:42 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2016-08-18 22:34:36 +08:00
|
|
|
#include "storage/model/properties/properties.hpp"
|
2016-08-25 22:29:45 +08:00
|
|
|
#include "storage/type_group_edge.hpp"
|
|
|
|
#include "storage/type_group_vertex.hpp"
|
2016-07-03 08:02:42 +08:00
|
|
|
|
|
|
|
using std::cout;
|
|
|
|
using std::endl;
|
|
|
|
|
|
|
|
class ConsoleWriter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ConsoleWriter() {}
|
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(const StoredProperty<TypeGroupEdge> &value)
|
2016-08-25 22:29:45 +08:00
|
|
|
{
|
2016-09-05 17:02:48 +08:00
|
|
|
handle<TypeGroupEdge>(value);
|
2016-08-25 22:29:45 +08:00
|
|
|
}
|
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(const StoredProperty<TypeGroupVertex> &value)
|
2016-08-25 22:29:45 +08:00
|
|
|
{
|
2016-09-05 17:02:48 +08:00
|
|
|
handle<TypeGroupVertex>(value);
|
2016-08-25 22:29:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class T>
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(StoredProperty<T> const &value)
|
2016-07-03 08:02:42 +08:00
|
|
|
{
|
2016-09-05 17:02:48 +08:00
|
|
|
cout << "KEY: " << value.key.family_name() << "; VALUE: ";
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
value.accept(*this);
|
2016-08-18 22:34:36 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
// value.accept(*this);
|
2016-07-03 08:02:42 +08:00
|
|
|
|
|
|
|
cout << endl;
|
|
|
|
}
|
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(const Null &v) { cout << "NULL"; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(const Bool &b) { cout << b; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(const String &s) { cout << s; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(const Int32 &int32) { cout << int32; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(const Int64 &int64) { cout << int64; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
void handle(const Float &f) { cout << f; }
|
|
|
|
|
|
|
|
void handle(const Double &d) { cout << d; }
|
|
|
|
|
|
|
|
// Not yet implemented
|
|
|
|
void handle(const ArrayBool &) { assert(false); }
|
|
|
|
|
|
|
|
// Not yet implemented
|
|
|
|
void handle(const ArrayInt32 &) { assert(false); }
|
|
|
|
|
|
|
|
// Not yet implemented
|
|
|
|
void handle(const ArrayInt64 &) { assert(false); }
|
|
|
|
|
|
|
|
// Not yet implemented
|
|
|
|
void handle(const ArrayFloat &) { assert(false); }
|
|
|
|
|
|
|
|
// Not yet implemented
|
|
|
|
void handle(const ArrayDouble &) { assert(false); }
|
|
|
|
|
|
|
|
// Not yet implemented
|
|
|
|
void handle(const ArrayString &) { assert(false); }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
void finish() {}
|
2016-07-03 08:02:42 +08:00
|
|
|
};
|