[datasource] call after_load for static plugins
This commit is contained in:
parent
ee63a6f055
commit
45568e8895
1 changed files with 20 additions and 17 deletions
|
@ -86,7 +86,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define REGISTER_STATIC_DATASOURCE_PLUGIN(classname) \
|
#define REGISTER_STATIC_DATASOURCE_PLUGIN(classname) \
|
||||||
ds_map.emplace(std::string{classname::kName}, std::make_shared<classname>())
|
{ \
|
||||||
|
auto plugin = std::make_shared<classname>(); \
|
||||||
|
plugin->after_load(); \
|
||||||
|
ds_map.emplace(std::string{classname::kName}, std::move(plugin)); \
|
||||||
|
}
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
|
||||||
#ifdef MAPNIK_STATIC_PLUGINS
|
#ifdef MAPNIK_STATIC_PLUGINS
|
||||||
|
@ -150,14 +154,13 @@ void init_datasource_cache_static()
|
||||||
|
|
||||||
datasource_ptr create_static_datasource(parameters const& params)
|
datasource_ptr create_static_datasource(parameters const& params)
|
||||||
{
|
{
|
||||||
datasource_ptr ds;
|
|
||||||
boost::optional<std::string> type = params.get<std::string>("type");
|
boost::optional<std::string> type = params.get<std::string>("type");
|
||||||
datasource_map::iterator it = ds_map.find(*type);
|
datasource_map::iterator it = ds_map.find(*type);
|
||||||
if (it != ds_map.end())
|
if (it != ds_map.end())
|
||||||
{
|
{
|
||||||
ds = it->second->create(params);
|
return it->second->create(params);
|
||||||
}
|
}
|
||||||
return ds;
|
return datasource_ptr{};
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
datasource_ptr create_static_datasource(parameters const& /*params*/)
|
datasource_ptr create_static_datasource(parameters const& /*params*/)
|
||||||
|
|
Loading…
Reference in a new issue