Commit 75838210 authored by Rashad Kanavath's avatar Rashad Kanavath

COMP: add export macro for building dll (GdalAdapters)

parent d7c14870
......@@ -32,7 +32,7 @@ namespace otb
*
* \ingroup OTBGdalAdapters
*/
class ITK_EXPORT GeometriesSet : public itk::DataObject
class OTBGdalAdapters_EXPORT GeometriesSet : public itk::DataObject
{
public:
/**\name Standard ITK typedefs */
......
......@@ -22,6 +22,8 @@
#include "itkProcessObject.h"
#include "itkMacro.h"
#include "OTBGdalAdaptersExport.h"
// Forward declarations
namespace otb {
namespace ogr {
......@@ -62,7 +64,7 @@ namespace otb
*
* \ingroup OTBGdalAdapters
*/
class ITK_EXPORT GeometriesSource : public itk::ProcessObject, boost::noncopyable
class OTBGdalAdapters_EXPORT GeometriesSource : public itk::ProcessObject, boost::noncopyable
{
public:
/**\name Standard ITK typedefs */
......
......@@ -46,7 +46,7 @@ namespace otb
*
* \ingroup OTBGdalAdapters
*/
class ITK_EXPORT GeometriesToGeometriesFilter : public GeometriesSource
class OTBGdalAdapters_EXPORT GeometriesToGeometriesFilter : public GeometriesSource
{
public:
/**\name Standard ITK typedefs */
......@@ -172,7 +172,7 @@ private:
* Helper class to operate an exact copy of the fields from a source layer.
* \since OTB v 3.14.0
*/
struct FieldCopyTransformation
struct OTBGdalAdapters_EXPORT FieldCopyTransformation
{
OGRFeatureDefn & getDefinition(ogr::Layer & outLayer) const
{
......
......@@ -72,7 +72,9 @@ namespace otb { namespace ogr {
*
* \ingroup OTBGdalAdapters
*/
class DataSource : public itk::DataObject , public boost::noncopyable
#include "OTBGdalAdaptersExport.h"
class OTBGdalAdapters_EXPORT DataSource : public itk::DataObject , public boost::noncopyable
{
public:
/**\name Standard ITK typedefs */
......
......@@ -20,6 +20,8 @@
#include <boost/noncopyable.hpp>
#include "OTBGdalAdaptersExport.h"
namespace otb { namespace ogr {
/**\ingroup Geometry
* Singleton-like class to provide lazy-registering of all \c OGRDriver's.
......@@ -37,7 +39,7 @@ namespace otb { namespace ogr {
* VC++)
* - Non-copyable
*/
class Drivers : private boost::noncopyable
class OTBGdalAdapters_EXPORT Drivers : private boost::noncopyable
{
/** \name Singleton related functions */
//@{
......
......@@ -37,6 +37,8 @@ class OGRFeatureDefn;
namespace otb {
namespace ogr {
class Feature;
OTBGdalAdapters_EXPORT
bool operator==(Feature const& lhs, Feature const& rhs);
/**\ingroup gGeometry
......@@ -61,7 +63,7 @@ bool operator==(Feature const& lhs, Feature const& rhs);
*
* \ingroup OTBGdalAdapters
*/
class Feature
class OTBGdalAdapters_EXPORT Feature
{
public:
/**\name Construction, copy and destruction */
......
......@@ -25,6 +25,8 @@ class OGRFeature;
#include "ogr_core.h" // OGR enums
#include "itkIndent.h"
#include "OTBGdalAdaptersExport.h"
namespace otb { namespace ogr {
/*===========================================================================*/
......@@ -41,7 +43,7 @@ namespace otb { namespace ogr {
*
* \ingroup OTBGdalAdapters
*/
class FieldDefn
class OTBGdalAdapters_EXPORT FieldDefn
{
public:
FieldDefn(OGRFieldDefn& definition) : m_Definition(&definition){ }
......@@ -65,6 +67,7 @@ bool operator==(FieldDefn const& lhs, FieldDefn const& rhs)
&& lhs.GetType() == rhs.GetType();
}
OTBGdalAdapters_EXPORT
std::ostream & operator<<(std::ostream & os, FieldDefn const& defn);
/*===========================================================================*/
......@@ -91,7 +94,7 @@ class Feature;
*
* \ingroup OTBGdalAdapters
*/
class Field
class OTBGdalAdapters_EXPORT Field
{
public:
/**
......
......@@ -27,6 +27,8 @@
#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
#endif
#include "OTBGdalAdaptersExport.h"
class OGRGeometry;
namespace otb { namespace ogr {
......@@ -41,7 +43,7 @@ namespace internal {
* consequence, it is not in an anonymous namespace , but in \c
* otb::ogr::internal.
*/
struct GeometryDeleter
struct OTBGdalAdapters_EXPORT GeometryDeleter
{
void operator()(OGRGeometry* p);
};
......@@ -99,34 +101,34 @@ struct GeometryDeleter
*/
typedef boost::interprocess::unique_ptr<OGRGeometry, internal::GeometryDeleter> UniqueGeometryPtr;
///Do these features intersect?
bool Intersects (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Intersects (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Returns wheither if two geometries are equivalent.
bool Equals (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Equals (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for disjointness.
bool Disjoint (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Disjoint (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for touching.
bool Touches (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Touches (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for crossing.
bool Crosses (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Crosses (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for containment.
bool Within (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Within (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for containment.
bool Contains (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Contains (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for overlap.
bool Overlaps (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Overlaps (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes distance between two geometries.
double Distance (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT double Distance (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes intersection.
UniqueGeometryPtr Intersection (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT UniqueGeometryPtr Intersection (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes union.
UniqueGeometryPtr Union (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT UniqueGeometryPtr Union (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes union using cascading.
UniqueGeometryPtr UnionCascaded (OGRGeometry const& this_);
OTBGdalAdapters_EXPORT UniqueGeometryPtr UnionCascaded (OGRGeometry const& this_);
/// Computes difference.
UniqueGeometryPtr Difference (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT UniqueGeometryPtr Difference (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes symmetric difference.
UniqueGeometryPtr SymDifference (OGRGeometry const& lhs, OGRGeometry const& rhs); // -1.8
OTBGdalAdapters_EXPORT UniqueGeometryPtr SymDifference (OGRGeometry const& lhs, OGRGeometry const& rhs); // -1.8
/** Simplifies Geometry.
* This function tries to uses the best simplication algorithm available in the
......@@ -137,19 +139,19 @@ UniqueGeometryPtr SymDifference (OGRGeometry const& lhs, OGRGeometry const& rhs)
* \sa \c OGRGeometry::Simplify()
* \sa \c OGRGeometry::SimplifyPreserveTopology()
*/
UniqueGeometryPtr Simplify(OGRGeometry const& g, double tolerance);
OTBGdalAdapters_EXPORT UniqueGeometryPtr Simplify(OGRGeometry const& g, double tolerance);
/** Simplifies Geometry with no guarantee of preserving the geometry.
* \pre Requires GDAL 1.8.0
* \sa \c OGRGeometry::Simplify()
*/
UniqueGeometryPtr SimplifyDontPreserveTopology(OGRGeometry const& g, double tolerance);
OTBGdalAdapters_EXPORT UniqueGeometryPtr SimplifyDontPreserveTopology(OGRGeometry const& g, double tolerance);
/** Simplifies Geometry while preserving topology.
* \pre Requires GDAL 1.9.0
* \sa \c OGRGeometry::SimplifyPreserveTopology()
*/
UniqueGeometryPtr SimplifyPreserveTopology(OGRGeometry const& g, double tolerance);
OTBGdalAdapters_EXPORT UniqueGeometryPtr SimplifyPreserveTopology(OGRGeometry const& g, double tolerance);
/** @} */
......
......@@ -31,6 +31,8 @@
#include "cpl_string.h" // CSLCount
#endif
#include "OTBGdalAdaptersExport.h"
namespace otb
{
namespace ogr
......@@ -55,7 +57,7 @@ namespace ogr
*
* \ingroup OTBGdalAdapters
*/
struct StringListConverter
struct OTBGdalAdapters_EXPORT StringListConverter
{
template <class ContainerType>
......
......@@ -49,6 +49,7 @@ class Layer;
* Compares layers identities.
* \return whether the two layers are in fact the same.
*/
OTBGdalAdapters_EXPORT
bool operator==(Layer const& lhs, Layer const& rhs);
/**\ingroup gGeometry
......@@ -72,7 +73,7 @@ bool operator==(Layer const& lhs, Layer const& rhs);
*
* \ingroup OTBGdalAdapters
*/
class Layer
class OTBGdalAdapters_EXPORT Layer
{
public:
/**\name ITK standard definitions */
......
......@@ -31,6 +31,8 @@ class OGRDataSource;
class OGRSFDriver;
#endif
#include "OTBGdalAdaptersExport.h"
namespace otb
{
namespace ogr
......@@ -72,7 +74,8 @@ namespace version_proxy
* \param filename Filename of the file to open
* \param readOnly: If true, dataset is open in read-only mode.
* \return NULL if file could not be open.
*/
*/
OTBGdalAdapters_EXPORT
GDALDatasetType * Open(const char * filename, bool readOnly = true);
/**
......@@ -84,6 +87,7 @@ namespace version_proxy
* \param dataset Pointer to the dataset to close. Will not be
* checked for null pointer.
*/
OTBGdalAdapters_EXPORT
void Close(GDALDatasetType * dataset);
/**
......@@ -100,6 +104,7 @@ namespace version_proxy
*
* \return NULL if dataset could not be created.
*/
OTBGdalAdapters_EXPORT
GDALDatasetType * Create(GDALDriverType * driver, const char * name);
......@@ -110,7 +115,8 @@ namespace version_proxy
* and GDALDriver::Delete for gdal 2.x implementation.
*
* \param name Name of the dataset to destroy.
*/
*/
OTBGdalAdapters_EXPORT
bool Delete(const char * name);
/**
......@@ -125,9 +131,10 @@ namespace version_proxy
*
* \return NULL if no driver could be retrieved.
*/
OTBGdalAdapters_EXPORT
GDALDriverType * GetDriverByName(const char * name);
OTBGdalAdapters_EXPORT
std::string GetDriverNameFromDataSource(const GDALDatasetType * ds);
/**
......@@ -141,18 +148,21 @@ namespace version_proxy
*
* \return True if sync went on without any error.
*/
bool SyncToDisk(GDALDatasetType * dataset);
OTBGdalAdapters_EXPORT
bool SyncToDisk(GDALDatasetType * dataset);
/**
* \return The name of the dataset class behind the implementation
* (OGRDataSource for gdal 1.x and GdalDataset for gdal 2.x)
*/
OTBGdalAdapters_EXPORT
std::string GetDatasetClassName();
/**
* \return The name of the driver class behind the implementation
* (OGRSFDriver for gdal 1.x and GDALDriver for gdal 2.x)
*/
OTBGdalAdapters_EXPORT
std::string GetDriverClassName();
/**
......@@ -167,6 +177,8 @@ namespace version_proxy
*
* \return A vector of string containing the list of files.
*/
OTBGdalAdapters_EXPORT
std::vector<std::string> GetFileListAsStringVector(GDALDatasetType * dataset);
/**
......@@ -178,6 +190,7 @@ namespace version_proxy
*
* \return A vector of string containing the list of available drivers.
*/
OTBGdalAdapters_EXPORT
std::vector<std::string> GetAvailableDriversAsStringVector();
}
......
set(DOCUMENTATION "Adapters for the Gdal Library ( for reading and writing ).")
otb_module(OTBGdalAdapters
ENABLE_SHARED
DEPENDS
OTBBoostAdapters
OTBBoost
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment