openModeller  Version 1.5.0
RasterFactory Class Reference

Build a Raster. More...

#include <RasterFactory.hh>

Collaboration diagram for RasterFactory:
Collaboration graph

Public Member Functions

bool registerDriver (const string &driverId, CreateRasterCallback builder)
 
bool unregisterDriver (const string &driverId)
 Unregister a Raster. More...
 
Rastercreate (const string &source, int categ=0)
 
Rastercreate (const string &source, const MapFormat &format)
 

Static Public Member Functions

static RasterFactoryinstance ()
 

Private Types

typedef Raster *(* CreateRasterCallback )()
 
typedef std::map< string,
CreateRasterCallback
DriversMap
 

Private Member Functions

 RasterFactory ()
 
 RasterFactory (const RasterFactory &)
 No copy allowed. More...
 
RasterFactoryoperator= (const RasterFactory &)
 No copy allowed. More...
 
 ~RasterFactory ()
 No destructor allowed. More...
 

Private Attributes

DriversMap _drivers
 Map of Rasters and identifiers. More...
 

Static Private Attributes

static bool _initiated
 

Detailed Description

Build a Raster.

Its a Factory pattern to Build a Raster using a raster lib that is specified in a url. Register or Unregister a raster lib to use with openModeller. Default raster lib is GDAL http://www.remotesensing.org/gdal . Its a Singleton Pattern.

Definition at line 56 of file RasterFactory.hh.

Member Typedef Documentation

typedef Raster*(* RasterFactory::CreateRasterCallback)()
private

Definition at line 62 of file RasterFactory.hh.

typedef std::map<string, CreateRasterCallback> RasterFactory::DriversMap
private

Definition at line 65 of file RasterFactory.hh.

Constructor & Destructor Documentation

RasterFactory::RasterFactory ( )
inlineprivate

Definition at line 106 of file RasterFactory.hh.

RasterFactory::RasterFactory ( const RasterFactory )
private

No copy allowed.

RasterFactory::~RasterFactory ( )
inlineprivate

No destructor allowed.

Definition at line 115 of file RasterFactory.hh.

Member Function Documentation

Raster * RasterFactory::create ( const string &  source,
int  categ = 0 
)

Open an existing raster (read only).

Definition at line 79 of file RasterFactory.cpp.

References _drivers, and Raster::createRaster().

Referenced by RequestFile::_setProjection(), main(), and MapFormat::MapFormat().

Here is the call graph for this function:

Raster * RasterFactory::create ( const string &  source,
const MapFormat format 
)

Create a new file for projections.

Definition at line 173 of file RasterFactory.cpp.

References _drivers, and Raster::createRaster().

Here is the call graph for this function:

RasterFactory & RasterFactory::instance ( )
static
RasterFactory& RasterFactory::operator= ( const RasterFactory )
private

No copy allowed.

bool RasterFactory::registerDriver ( const string &  driverId,
CreateRasterCallback  builder 
)

Register a Raster.

Parameters
driverIdRaster Identifier.
builderFunction pointer to builder function.

Definition at line 63 of file RasterFactory.cpp.

References _drivers.

Referenced by instance().

bool RasterFactory::unregisterDriver ( const string &  driverId)

Unregister a Raster.

Definition at line 71 of file RasterFactory.cpp.

References _drivers.

Member Data Documentation

DriversMap RasterFactory::_drivers
private

Map of Rasters and identifiers.

Definition at line 103 of file RasterFactory.hh.

Referenced by create(), registerDriver(), and unregisterDriver().

bool RasterFactory::_initiated
staticprivate

Definition at line 100 of file RasterFactory.hh.

Referenced by instance().


The documentation for this class was generated from the following files: