2016-07-03 08:02:42 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
#include "storage/model/properties/handler.hpp"
|
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-08-25 22:29:45 +08:00
|
|
|
void handle(const typename PropertyFamily<
|
|
|
|
TypeGroupEdge>::PropertyType::PropertyFamilyKey &key,
|
|
|
|
const Property &value)
|
|
|
|
{
|
|
|
|
handle<TypeGroupEdge>(key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void handle(const typename PropertyFamily<
|
|
|
|
TypeGroupVertex>::PropertyType::PropertyFamilyKey &key,
|
|
|
|
const Property &value)
|
|
|
|
{
|
|
|
|
handle<TypeGroupVertex>(key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
void handle(
|
|
|
|
const typename PropertyFamily<T>::PropertyType::PropertyFamilyKey &key,
|
|
|
|
const Property &value)
|
2016-07-03 08:02:42 +08:00
|
|
|
{
|
2016-08-18 22:34:36 +08:00
|
|
|
cout << "KEY: " << key.family_name() << "; VALUE: ";
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-07-05 11:01:22 +08:00
|
|
|
accept(value, *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-08-02 22:41:53 +08:00
|
|
|
void handle(const Bool &b) { cout << b.value(); }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-08-02 22:41:53 +08:00
|
|
|
void handle(const String &s) { cout << s.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-08-02 22:41:53 +08:00
|
|
|
void handle(const Int32 &int32) { cout << int32.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-08-02 22:41:53 +08:00
|
|
|
void handle(const Int64 &int64) { cout << int64.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-08-02 22:41:53 +08:00
|
|
|
void handle(const Float &f) { cout << f.value; }
|
2016-07-03 08:02:42 +08:00
|
|
|
|
2016-08-02 22:41:53 +08:00
|
|
|
void handle(const Double &d) { cout << d.value; }
|
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
|
|
|
};
|