Adding map context to simplify parameter passing

This commit is contained in:
Dan Paulat 2021-11-27 19:00:49 -06:00
parent afb174a8fe
commit f7f86ec24a
12 changed files with 140 additions and 124 deletions

View file

@ -10,14 +10,27 @@ namespace map
class GenericLayerImpl
{
public:
explicit GenericLayerImpl() {}
explicit GenericLayerImpl(std::shared_ptr<MapContext> context) :
context_ {context}
{
}
~GenericLayerImpl() {}
std::shared_ptr<MapContext> context_;
};
GenericLayer::GenericLayer() : p(std::make_unique<GenericLayerImpl>()) {}
GenericLayer::GenericLayer(std::shared_ptr<MapContext> context) :
p(std::make_unique<GenericLayerImpl>(context))
{
}
GenericLayer::~GenericLayer() = default;
std::shared_ptr<MapContext> GenericLayer::context() const
{
return p->context_;
}
} // namespace map
} // namespace qt
} // namespace scwx