2016-07-05 11:01:22 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "storage/model/properties/property.hpp"
|
2016-07-05 20:20:33 +08:00
|
|
|
#include "storage/model/properties/all.hpp"
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
template <class Handler>
|
2016-08-02 22:41:53 +08:00
|
|
|
void accept(const Property &property, Handler &h)
|
2016-07-05 11:01:22 +08:00
|
|
|
{
|
|
|
|
switch (property.flags) {
|
|
|
|
|
|
|
|
case Property::Flags::True:
|
2016-08-02 22:41:53 +08:00
|
|
|
return h.handle(static_cast<const Bool &>(property));
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
case Property::Flags::False:
|
2016-08-02 22:41:53 +08:00
|
|
|
return h.handle(static_cast<const Bool &>(property));
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
case Property::Flags::String:
|
2016-08-02 22:41:53 +08:00
|
|
|
return h.handle(static_cast<const String &>(property));
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
case Property::Flags::Int32:
|
2016-08-02 22:41:53 +08:00
|
|
|
return h.handle(static_cast<const Int32 &>(property));
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
case Property::Flags::Int64:
|
2016-08-02 22:41:53 +08:00
|
|
|
return h.handle(static_cast<const Int64 &>(property));
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
case Property::Flags::Float:
|
2016-08-02 22:41:53 +08:00
|
|
|
return h.handle(static_cast<const Float &>(property));
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
case Property::Flags::Double:
|
2016-08-02 22:41:53 +08:00
|
|
|
return h.handle(static_cast<const Double &>(property));
|
2016-07-05 11:01:22 +08:00
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|