minor c++ style fixes

This commit is contained in:
Dane Springmeyer 2013-09-23 17:37:46 -07:00
parent 01344baffb
commit e8b00ab8a9
2 changed files with 10 additions and 10 deletions

View file

@ -110,7 +110,7 @@ postgis_datasource::postgis_datasource(parameters const& params)
if(max_async_connections_ > pool_max_size_) if(max_async_connections_ > pool_max_size_)
{ {
std::ostringstream err; std::ostringstream err;
err << "PostGIS Plugin: Error: 'max_async_connections ("; err << "PostGIS Plugin: Error: 'max_async_connections ("
<< max_async_connections_ << ") must be <= max_size(" << pool_max_size_ << ")"; << max_async_connections_ << ") must be <= max_size(" << pool_max_size_ << ")";
throw mapnik::datasource_exception(err.str()); throw mapnik::datasource_exception(err.str());
} }
@ -630,10 +630,12 @@ boost::shared_ptr<IResultSet> postgis_datasource::get_resultset(boost::shared_pt
processor_context_ptr postgis_datasource::get_context(feature_style_context_map & ctx) const processor_context_ptr postgis_datasource::get_context(feature_style_context_map & ctx) const
{ {
std::string ds_name(name());
if (!asynchronous_request_) if (!asynchronous_request_)
return processor_context_ptr(); {
return processor_context_ptr();
}
std::string ds_name(name());
feature_style_context_map::const_iterator itr = ctx.find(ds_name); feature_style_context_map::const_iterator itr = ctx.find(ds_name);
if (itr != ctx.end()) if (itr != ctx.end())
{ {
@ -645,10 +647,10 @@ processor_context_ptr postgis_datasource::get_context(feature_style_context_map
} }
} }
featureset_ptr postgis_datasource::features(const query& q) const featureset_ptr postgis_datasource::features(query const& q) const
{ {
// if the driver is in asynchronous mode, return the appropriate fetaures // if the driver is in asynchronous mode, return the appropriate fetaures
if ( asynchronous_request_ ) if (asynchronous_request_ )
{ {
return features_with_context(q,boost::make_shared<postgis_processor_context>()); return features_with_context(q,boost::make_shared<postgis_processor_context>());
} }
@ -658,7 +660,7 @@ featureset_ptr postgis_datasource::features(const query& q) const
} }
} }
featureset_ptr postgis_datasource::features_with_context(const query& q,processor_context_ptr proc_ctx) const featureset_ptr postgis_datasource::features_with_context(query const& q,processor_context_ptr proc_ctx) const
{ {
#ifdef MAPNIK_STATS #ifdef MAPNIK_STATS

View file

@ -69,8 +69,8 @@ public:
mapnik::datasource::datasource_t type() const; mapnik::datasource::datasource_t type() const;
static const char * name(); static const char * name();
processor_context_ptr get_context(feature_style_context_map &) const; processor_context_ptr get_context(feature_style_context_map &) const;
featureset_ptr features_with_context(const query& q, processor_context_ptr ctx= processor_context_ptr()) const; featureset_ptr features_with_context(query const& q, processor_context_ptr ctx= processor_context_ptr()) const;
featureset_ptr features(const query& q) const; featureset_ptr features(query const& q) const;
featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const; featureset_ptr features_at_point(coord2d const& pt, double tol = 0) const;
mapnik::box2d<double> envelope() const; mapnik::box2d<double> envelope() const;
boost::optional<mapnik::datasource::geometry_t> get_geometry_type() const; boost::optional<mapnik::datasource::geometry_t> get_geometry_type() const;
@ -113,10 +113,8 @@ private:
bool estimate_extent_; bool estimate_extent_;
int max_async_connections_; int max_async_connections_;
bool asynchronous_request_; bool asynchronous_request_;
// params below are for testing purposes only (will likely be removed at any time)
int intersect_min_scale_; int intersect_min_scale_;
int intersect_max_scale_; int intersect_max_scale_;
}; };
#endif // POSTGIS_DATASOURCE_HPP #endif // POSTGIS_DATASOURCE_HPP