@@ -264,13 +264,21 @@ void Grid::fill_spec(spec::Custom& custom) const {
264264}
265265
266266
267+ ShareEckitGeoGridInit::ShareEckitGeoGridInit () {
268+ // ensure load of supporting files
269+ share::Grid::instance ();
270+ }
271+
272+
267273const Grid* GridFactory::make_from_string (const std::string& str) {
268274 std::unique_ptr<Spec> spec (spec::Custom::make_from_value (YAMLParser::decodeString (str)));
269275 return instance ().make_from_spec_ (*spec);
270276}
271277
272278
273279GridFactory& GridFactory::instance () {
280+ share::Grid::instance ();
281+
274282 static GridFactory INSTANCE;
275283 return INSTANCE;
276284}
@@ -282,7 +290,7 @@ const Grid* GridFactory::make_from_spec_(const Spec& spec) const {
282290 std::unique_ptr<Spec> cfg (make_spec_ (spec));
283291
284292 if (std::string type; cfg->get (" type" , type)) {
285- return GridFactoryType ::instance ().get (type).create (*cfg);
293+ return Factory<Grid> ::instance ().get (type).create (*cfg);
286294 }
287295
288296 list (Log::error () << " Grid: cannot build grid without 'type', choices are: " );
@@ -292,7 +300,6 @@ const Grid* GridFactory::make_from_spec_(const Spec& spec) const {
292300
293301Spec* GridFactory::make_spec_ (const Spec& spec) const {
294302 lock_type lock;
295- share::Grid::instance ();
296303
297304 auto * cfg = new spec::Layered (spec);
298305 ASSERT (cfg != nullptr );
@@ -344,11 +351,10 @@ bool Grid::NextIterator::next(Point& point) {
344351
345352std::ostream& GridFactory::list_ (std::ostream& out) const {
346353 lock_type lock;
347- share::Grid::instance ();
348354
349355 out << GridSpecByUID::instance () << std::endl;
350356 out << GridSpecByName::instance () << std::endl;
351- out << GridFactoryType ::instance () << std::endl;
357+ out << Factory<Grid> ::instance () << std::endl;
352358
353359 return out;
354360}
0 commit comments