avoid c-linkage warning with datasources - closes #1323

This commit is contained in:
Dane Springmeyer 2012-07-20 18:34:41 -07:00
parent e225eaae4b
commit 669c4906d4
30 changed files with 34 additions and 40 deletions

View file

@ -126,7 +126,7 @@ protected:
mutable bool is_bound_;
};
typedef std::string datasource_name();
typedef const char * datasource_name();
typedef datasource* create_ds(const parameters& params, bool bind);
typedef void destroy_ds(datasource *ds);
@ -142,7 +142,7 @@ public:
typedef boost::shared_ptr<datasource> datasource_ptr;
#define DATASOURCE_PLUGIN(classname) \
extern "C" MAPNIK_EXP std::string datasource_name() \
extern "C" MAPNIK_EXP const char * datasource_name() \
{ \
return classname::name(); \
} \

View file

@ -852,7 +852,7 @@ void csv_datasource::parse_csv(T& stream,
}
}
std::string csv_datasource::name()
const char * csv_datasource::name()
{
return "csv";
}

View file

@ -35,7 +35,7 @@ public:
csv_datasource(mapnik::parameters const& params, bool bind=true);
virtual ~csv_datasource ();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -200,7 +200,7 @@ datasource::datasource_t gdal_datasource::type() const
return datasource::Raster;
}
std::string gdal_datasource::name()
const char * gdal_datasource::name()
{
return "gdal";
}

View file

@ -38,7 +38,7 @@ public:
gdal_datasource(mapnik::parameters const& params, bool bind = true);
virtual ~gdal_datasource();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -106,11 +106,9 @@ void geojson_datasource::bind() const
geojson_datasource::~geojson_datasource() { }
std::string const geojson_datasource::name_="geojson";
std::string geojson_datasource::name()
const char * geojson_datasource::name()
{
return name_;
return "geojson";
}
boost::optional<mapnik::datasource::geometry_t> geojson_datasource::get_geometry_type() const

View file

@ -44,7 +44,7 @@ public:
geojson_datasource(mapnik::parameters const& params, bool bind=true);
virtual ~geojson_datasource ();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;
@ -52,8 +52,7 @@ public:
std::map<std::string, mapnik::parameters> get_statistics() const;
boost::optional<mapnik::datasource::geometry_t> get_geometry_type() const;
void bind() const;
private:
static const std::string name_;
private:
mapnik::datasource::datasource_t type_;
mutable std::map<std::string, mapnik::parameters> statistics_;
mutable mapnik::layer_descriptor desc_;

View file

@ -226,7 +226,7 @@ void geos_datasource::bind() const
is_bound_ = true;
}
std::string geos_datasource::name()
const char * geos_datasource::name()
{
return "geos";
}

View file

@ -39,7 +39,7 @@ public:
geos_datasource(mapnik::parameters const& params, bool bind = true);
virtual ~geos_datasource ();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -122,7 +122,7 @@ kismet_datasource::~kismet_datasource()
{
}
std::string kismet_datasource::name()
const char * kismet_datasource::name()
{
return "kismet";
}

View file

@ -46,7 +46,7 @@ public:
kismet_datasource(mapnik::parameters const& params, bool bind = true);
virtual ~kismet_datasource ();
datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -49,7 +49,6 @@ public:
private:
std::list<kismet_network_data> const& knd_list_;
boost::scoped_ptr<mapnik::transcoder> tr_;
mapnik::wkbFormat format_;
int feature_id_;
std::list<kismet_network_data>::const_iterator knd_list_it;
mapnik::projection source_;

View file

@ -352,7 +352,7 @@ void occi_datasource::bind() const
is_bound_ = true;
}
std::string occi_datasource::name()
const char * occi_datasource::name()
{
return "occi";
}

View file

@ -41,7 +41,7 @@ public:
occi_datasource(mapnik::parameters const& params, bool bind = true);
virtual ~occi_datasource ();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -333,7 +333,7 @@ void ogr_datasource::bind() const
is_bound_ = true;
}
std::string ogr_datasource::name()
const char * ogr_datasource::name()
{
return "ogr";
}

View file

@ -42,7 +42,7 @@ public:
ogr_datasource(mapnik::parameters const& params, bool bind=true);
virtual ~ogr_datasource ();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -130,7 +130,7 @@ osm_datasource::~osm_datasource()
//delete osm_data_;
}
std::string osm_datasource::name()
const char * osm_datasource::name()
{
return "osm";
}

View file

@ -43,7 +43,7 @@ public:
osm_datasource(const parameters& params, bool bind = true);
virtual ~osm_datasource();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
featureset_ptr features(const query& q) const;
featureset_ptr features_at_point(coord2d const& pt) const;
box2d<double> envelope() const;

View file

@ -313,7 +313,7 @@ void postgis_datasource::bind() const
{
srid_ = -1;
MAPNIK_LOG_DEBUG(postgis) << "postgis_datasource: Table " << table_ << " is using SRID=-1";
MAPNIK_LOG_DEBUG(postgis) << "postgis_datasource: Table " << table_ << " is using SRID=" << srid_;
}
// At this point the geometry_field may still not be known
@ -439,7 +439,7 @@ postgis_datasource::~postgis_datasource()
}
}
std::string postgis_datasource::name()
const char * postgis_datasource::name()
{
return "postgis";
}

View file

@ -51,7 +51,7 @@ public:
postgis_datasource(const parameters &params, bool bind=true);
~postgis_datasource();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
featureset_ptr features(const query& q) const;
featureset_ptr features_at_point(coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -159,7 +159,7 @@ mapnik::datasource::datasource_t raster_datasource::type() const
return datasource::Raster;
}
std::string raster_datasource::name()
const char * raster_datasource::name()
{
return "raster";
}

View file

@ -34,7 +34,7 @@ public:
raster_datasource(const mapnik::parameters& params, bool bind=true);
virtual ~raster_datasource();
datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(const mapnik::query& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -166,7 +166,7 @@ rasterlite_datasource::~rasterlite_datasource()
{
}
std::string rasterlite_datasource::name()
const char * rasterlite_datasource::name()
{
return "rasterlite";
}

View file

@ -37,7 +37,7 @@ public:
rasterlite_datasource(mapnik::parameters const& params, bool bind = true);
virtual ~rasterlite_datasource ();
mapnik::datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -238,7 +238,7 @@ void shape_datasource::init(shape_io& shape) const
MAPNIK_LOG_DEBUG(shape) << "shape_datasource: Shape type=" << shape_type_;
}
std::string shape_datasource::name()
const char * shape_datasource::name()
{
return "shape";
}

View file

@ -45,7 +45,7 @@ public:
shape_datasource(const parameters &params, bool bind=true);
virtual ~shape_datasource();
datasource::datasource_t type() const;
static std::string name();
static const char * name();
featureset_ptr features(const query& q) const;
featureset_ptr features_at_point(coord2d const& pt) const;
box2d<double> envelope() const;

View file

@ -473,7 +473,7 @@ void sqlite_datasource::parse_attachdb(std::string const& attachdb) const
}
}
std::string sqlite_datasource::name()
const char * sqlite_datasource::name()
{
return "sqlite";
}

View file

@ -43,7 +43,7 @@ public:
sqlite_datasource(mapnik::parameters const& params, bool bind = true);
virtual ~sqlite_datasource ();
datasource::datasource_t type() const;
static std::string name();
static const char * name();
mapnik::featureset_ptr features(mapnik::query const& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
mapnik::box2d<double> envelope() const;

View file

@ -39,11 +39,9 @@ void hello_datasource::bind() const
hello_datasource::~hello_datasource() { }
// This name must match the plugin filename, eg 'hello.input'
std::string const hello_datasource::name_="hello";
std::string hello_datasource::name()
const char * hello_datasource::name()
{
return name_;
return "hello";
}
mapnik::datasource::datasource_t hello_datasource::type() const

View file

@ -18,7 +18,7 @@ public:
mapnik::datasource::datasource_t type() const;
// mandatory: name of the plugin
static std::string name();
static const char * name();
// mandatory: function to query features by box2d
// this is called when rendering, specifically in feature_style_processor.hpp