#pragma once #include #include #include #include namespace mbgl { namespace style { namespace conversion { template struct Converter> { template optional> operator()(const V& value, Error& error) const { if (isUndefined(value)) { return DataDrivenPropertyValue(); } else if (!isObject(value)) { optional constant = convert(value, error); if (!constant) { return {}; } return DataDrivenPropertyValue(*constant); } else if (!objectMember(value, "property")) { optional> function = convert>(value, error); if (!function) { return {}; } return DataDrivenPropertyValue(*function); } else { optional> composite = convert>(value, error); if (composite) { return DataDrivenPropertyValue(*composite); } optional> source = convert>(value, error); if (!source) { return {}; } return DataDrivenPropertyValue(*source); } } }; } // namespace conversion } // namespace style } // namespace mbgl