te::rst::RasterFactory Class Referenceabstract

This is the abstract factory for Rasters. More...

#include <RasterFactory.h>

Inheritance diagram for te::rst::RasterFactory:
te::common::AbstractFactory< Raster, std::string > te::gdal::RasterFactory te::grib::RasterFactory te::mem::ExpansibleRasterFactory te::mem::RasterFactory

Public Types

typedef FactoryDictionary< AbstractFactory< Raster, std::string, std::less< std::string > >, std::string, std::less< std::string > > dictionary_type
 
typedef AbstractFactory factory_type
 

Public Member Functions

virtual std::map< std::string, std::string > getCapabilities () const =0
 It returns a map<string, string> containing all supported formats. More...
 
virtual void getCreationalParameters (std::vector< std::pair< std::string, std::string > > &params) const =0
 It returns the list of parameters accepted as raster info. More...
 
const std::string & getKey () const
 It returns the factory key associated to the concreate factory. More...
 
virtual const std::string & getType () const =0
 Returns the type (name) of this factory. More...
 
virtual ~RasterFactory ()
 Destructor. More...
 

Static Public Member Functions

static const factory_typefind (const std::string &factoryKey)
 
static dictionary_typegetDictionary ()
 It returns a reference to the internal dictionary of concrete factories. More...
 
static Rastermake ()
 It creates and returns an empty raster with default raster driver. More...
 
static Rastermake (const std::string &rType)
 It creates an empty raster with the proper driver. More...
 
static Rastermake (Grid *g, const std::vector< BandProperty * > bands, const std::map< std::string, std::string > &rinfo, void *h=0, void(*deleter)(void *)=0)
 It creates a raster with the given parameters using the default raster driver. More...
 
static Rastermake (const std::string &rType, Grid *g, const std::vector< BandProperty * > bands, const std::map< std::string, std::string > &rinfo, void *h=0, void(*deleter)(void *)=0)
 It creates a raster with the given parameters using a proper driver. More...
 
static Rastermake (const std::map< std::string, std::string > &rinfo, void *h=0, void(*deleter)(void *)=0)
 It creates a raster with the given parameters using the default driver. More...
 
static Rastermake (const std::string &rType, const std::map< std::string, std::string > &rinfo, void *h, void(*deleter)(void *)=0)
 It creates a raster with the given parameters using a proper driver. More...
 
static Rasteropen (const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
 It opens a raster with the given parameters and default raster driver. More...
 
static Rasteropen (const std::string &rType, const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
 It creates a raster with the given parameters. More...
 
static Rasteropen (const std::string &key, const std::string &value, te::common::AccessPolicy p=te::common::RAccess)
 It creates a raster with the given parameters and default raster driver. More...
 
static Rasteropen (const std::string &rType, const std::string &key, const std::string &value, te::common::AccessPolicy p=te::common::RAccess)
 It creates a raster with the given parameters. More...
 

Protected Member Functions

virtual Rasterbuild ()=0
 Concrete factories (derived from this one) must implement this method in order to create objects. More...
 
virtual Rastercreate (Grid *g, const std::vector< BandProperty * > bands, const std::map< std::string, std::string > &rinfo, void *h=0, void(*deleter)(void *)=0)=0
 This method must be implemented by subclasses (raster drivers). More...
 
virtual RasteriOpen (const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
 This method may be re-implemented by subclasses in order to have a finner control for the raster object instantiation. More...
 
 RasterFactory (const std::string &factoryKey)
 Constructor. More...
 

Protected Attributes

std::string m_factoryKey
 The key that identifies the concrete factory: it will be used for unregistering the factory during destruction. More...
 

Detailed Description

This is the abstract factory for Rasters.

See also
Raster

Definition at line 50 of file RasterFactory.h.

Member Typedef Documentation

typedef FactoryDictionary<AbstractFactory<Raster , std::string , std::less<std::string > >, std::string , std::less<std::string > > te::common::AbstractFactory< Raster , std::string , std::less<std::string > >::dictionary_type
inherited

Definition at line 73 of file AbstractFactory.h.

typedef AbstractFactory te::common::AbstractFactory< Raster , std::string , std::less<std::string > >::factory_type
inherited

Definition at line 77 of file AbstractFactory.h.

Constructor & Destructor Documentation

virtual te::rst::RasterFactory::~RasterFactory ( )
inlinevirtual

Destructor.

Reimplemented in te::gdal::RasterFactory, te::grib::RasterFactory, and te::mem::RasterFactory.

Definition at line 193 of file RasterFactory.h.

te::rst::RasterFactory::RasterFactory ( const std::string &  factoryKey)
protected

Constructor.

Parameters
factorKeyThe key that identifies the factory.

Member Function Documentation

virtual Raster * te::common::AbstractFactory< Raster , std::string , std::less<std::string > >::build ( )
protectedpure virtualinherited

Concrete factories (derived from this one) must implement this method in order to create objects.

Returns
It returns an object created by the concrete factory.

Implemented in te::mem::ExpansibleRasterFactory, te::gdal::RasterFactory, te::grib::RasterFactory, and te::mem::RasterFactory.

virtual Raster* te::rst::RasterFactory::create ( Grid g,
const std::vector< BandProperty * >  bands,
const std::map< std::string, std::string > &  rinfo,
void *  h = 0,
void(*)(void *)  deleter = 0 
)
protectedpure virtual

This method must be implemented by subclasses (raster drivers).

Parameters
gThe raster grid. May be a NULL parameter. Implementations must take its ownership.
bandsA vector of band properties, one for each band. Implementations must take ownership of the pointers in this vector.
rinfoThe necessary information to create the raster.
hIt may be any specific value for a given driver. May be a NULL parameter.
deleterA pointer to a deleter function used to free the memory pointed by h. May be a NULL parameter. Implementations must use this method when it doesn't use 'h' anymore.
Returns
The new raster.
Note
The caller will take the ownership of the returned pointer.

Implemented in te::mem::ExpansibleRasterFactory, te::gdal::RasterFactory, te::grib::RasterFactory, and te::mem::RasterFactory.

static const factory_type* te::common::AbstractFactory< Raster , std::string , std::less<std::string > >::find ( const std::string &  factoryKey)
staticinherited
virtual std::map<std::string, std::string> te::rst::RasterFactory::getCapabilities ( ) const
pure virtual

It returns a map<string, string> containing all supported formats.

Implemented in te::gdal::RasterFactory, te::grib::RasterFactory, te::mem::ExpansibleRasterFactory, and te::mem::RasterFactory.

virtual void te::rst::RasterFactory::getCreationalParameters ( std::vector< std::pair< std::string, std::string > > &  params) const
pure virtual

It returns the list of parameters accepted as raster info.

Implemented in te::mem::ExpansibleRasterFactory, te::gdal::RasterFactory, te::grib::RasterFactory, and te::mem::RasterFactory.

static dictionary_type& te::common::AbstractFactory< Raster , std::string , std::less<std::string > >::getDictionary ( )
staticinherited

It returns a reference to the internal dictionary of concrete factories.

The dictionary is a singleton.

Returns
A reference to the internal dictionary.
const std::string & te::common::AbstractFactory< Raster , std::string , std::less<std::string > >::getKey ( ) const
inherited

It returns the factory key associated to the concreate factory.

Returns
The factory key associated to the concreate factory.
virtual const std::string& te::rst::RasterFactory::getType ( ) const
pure virtual

Returns the type (name) of this factory.

Implemented in te::mem::ExpansibleRasterFactory, te::gdal::RasterFactory, te::grib::RasterFactory, and te::mem::RasterFactory.

virtual Raster* te::rst::RasterFactory::iOpen ( const std::map< std::string, std::string > &  rinfo,
te::common::AccessPolicy  p = te::common::RAccess 
)
protectedvirtual

This method may be re-implemented by subclasses in order to have a finner control for the raster object instantiation.

Parameters
rinfoThe necessary information to open the raster.
pThe access policy.
Returns
A raster.
Note
The caller will take the ownership of the returned pointer.
static Raster* te::rst::RasterFactory::make ( )
static

It creates and returns an empty raster with default raster driver.

Returns
An empty raster.
Note
The caller will take the ownership of the returned pointer.

Referenced by te::rp::CreateRasterFileFromMatrix().

static Raster* te::rst::RasterFactory::make ( const std::string &  rType)
static

It creates an empty raster with the proper driver.

Parameters
rTypeThe name of the specific driver to be used to create the raster.
Returns
An empty raster.
Note
The caller will take the ownership of the returned pointer.
static Raster* te::rst::RasterFactory::make ( Grid g,
const std::vector< BandProperty * >  bands,
const std::map< std::string, std::string > &  rinfo,
void *  h = 0,
void(*)(void *)  deleter = 0 
)
static

It creates a raster with the given parameters using the default raster driver.

Parameters
gThe raster grid. The factory will take its ownership.
bandsA vector of band properties with one property for each band. The factory will take the ownership of all properties.
rinfoThe necessary information to create the raster.
hIt may be any specific value for a given driver.
deleterA pointer to a deleter function used to free the memory pointed by h.
Returns
A new raster.
Note
The caller will take the ownership of the returned pointer.
If you inform a deleter when the created raster is destroyed it will call it for the informed h pointer.
static Raster* te::rst::RasterFactory::make ( const std::string &  rType,
Grid g,
const std::vector< BandProperty * >  bands,
const std::map< std::string, std::string > &  rinfo,
void *  h = 0,
void(*)(void *)  deleter = 0 
)
static

It creates a raster with the given parameters using a proper driver.

Parameters
rTypeThe name of the specific driver to create the raster.
gThe raster grid. The factory will take its ownership.
bandsA vector of band properties, one property for each band. The factory will take the ownership of all properties.
rinfoThe necessary information to create the raster.
hIt may be any specific value for a given driver.
deleterA pointer to a deleter function used to free the memory pointed by h.
Returns
A new raster.
Note
The caller will take the ownership of the returned pointer.
If you inform a deleter when the created raster is destroyed it will call it for the informed h pointer.
static Raster* te::rst::RasterFactory::make ( const std::map< std::string, std::string > &  rinfo,
void *  h = 0,
void(*)(void *)  deleter = 0 
)
static

It creates a raster with the given parameters using the default driver.

Parameters
rinfoThe necessary information to create the raster.
hIt may be any specific value for a given driver.
deleterA pointer to a deleter function used to free the memory pointed by h.
Returns
A new raster.
Note
The caller will take the ownership of the returned pointer.
If you inform a deleter when the created raster is destroyed it will call it for the informed h pointer.
static Raster* te::rst::RasterFactory::make ( const std::string &  rType,
const std::map< std::string, std::string > &  rinfo,
void *  h,
void(*)(void *)  deleter = 0 
)
static

It creates a raster with the given parameters using a proper driver.

Parameters
rTypeThe name of the specific driver to create the raster.
rinfoThe necessary information to create the raster.
hIt may be any specific value for a given driver.
deleterA pointer to a deleter function used to free the memory pointed by h.
Returns
A new raster.
Note
The caller will take the ownership of the returned pointer.
If you inform a deleter when the created raster is destroyed it will call it for the informed h pointer.
static Raster* te::rst::RasterFactory::open ( const std::map< std::string, std::string > &  rinfo,
te::common::AccessPolicy  p = te::common::RAccess 
)
static

It opens a raster with the given parameters and default raster driver.

Parameters
rinfoThe necessary information to open the raster.
pThe access policy.
Returns
The opened raster.
Note
The caller will take the ownership of the returned pointer.
static Raster* te::rst::RasterFactory::open ( const std::string &  rType,
const std::map< std::string, std::string > &  rinfo,
te::common::AccessPolicy  p = te::common::RAccess 
)
static

It creates a raster with the given parameters.

Parameters
rTypeThe name of the specific driver to create the raster.
rinfoThe necessary information to open the raster.
pThe access policy.
Returns
The opened raster.
Note
The caller will take the ownership of the returned pointer.
static Raster* te::rst::RasterFactory::open ( const std::string &  key,
const std::string &  value,
te::common::AccessPolicy  p = te::common::RAccess 
)
static

It creates a raster with the given parameters and default raster driver.

Parameters
keyThe name of the key used to define raster location, ex.: "URI".
valueThe value of the key to define raster location, ex.: "/path/to/raster.tif".
pThe access policy.
Returns
The opened raster.
Note
The caller will take the ownership of the returned pointer.
static Raster* te::rst::RasterFactory::open ( const std::string &  rType,
const std::string &  key,
const std::string &  value,
te::common::AccessPolicy  p = te::common::RAccess 
)
static

It creates a raster with the given parameters.

Parameters
rTypeThe name of the specific driver to create the raster.
keyThe name of the key used to define raster location, ex.: "URI".
valueThe value of the key to define raster location, ex.: "/path/to/raster.tif".
pThe access policy.
Returns
The opened raster.
Note
The caller will take the ownership of the returned pointer.

Member Data Documentation

std::string te::common::AbstractFactory< Raster , std::string , std::less<std::string > >::m_factoryKey
protectedinherited

The key that identifies the concrete factory: it will be used for unregistering the factory during destruction.

Definition at line 136 of file AbstractFactory.h.


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