openModeller
Version 1.5.0
|
#include <OccurrencesFactory.hh>
Public Member Functions | |
bool | registerDriver (const string &driverId, CreateOccurrencesReaderCallback builder) |
bool | unregisterDriver (const string &driverId) |
vector< string > | getRegisteredDrivers () |
OccurrencesReader * | create (const char *source, const char *coordSystem) |
Static Public Member Functions | |
static OccurrencesFactory & | instance () |
Private Types | |
typedef OccurrencesReader *(* | CreateOccurrencesReaderCallback )(const char *source, const char *coordSystem) |
typedef map< string, CreateOccurrencesReaderCallback > | DriversMap |
Private Member Functions | |
OccurrencesFactory () | |
OccurrencesFactory (const OccurrencesFactory &) | |
OccurrencesFactory & | operator= (const OccurrencesFactory &) |
~OccurrencesFactory () | |
Private Attributes | |
DriversMap | _drivers |
Static Private Attributes | |
static bool | _initiated |
OccurrencesReader factory.
Definition at line 57 of file OccurrencesFactory.hh.
|
private |
Definition at line 63 of file OccurrencesFactory.hh.
|
private |
Definition at line 66 of file OccurrencesFactory.hh.
|
inlineprivate |
Definition at line 108 of file OccurrencesFactory.hh.
|
private |
|
inlineprivate |
Definition at line 117 of file OccurrencesFactory.hh.
OccurrencesReader * OccurrencesFactory::create | ( | const char * | source, |
const char * | coordSystem | ||
) |
Return an OccurrencesReader given a source string.
source | URL used to locate the occurrences. |
coordSystem | coord system. |
Definition at line 103 of file OccurrencesFactory.cpp.
References _drivers, Log::debug(), Log::instance(), and OccurrencesReader::load().
Referenced by RequestFile::_setOccurrences(), main(), and readOccurrences().
vector< string > OccurrencesFactory::getRegisteredDrivers | ( | ) |
Return registered drivers (vector of driver ids).
Definition at line 83 of file OccurrencesFactory.cpp.
References _drivers.
Referenced by main().
|
static |
Returns the unique instance of OccurrencesFactory (singleton pattern).
Definition at line 40 of file OccurrencesFactory.cpp.
References _initiated, SerializedXmlOccurrences::CreateOccurrencesReaderCallback(), DelimitedTextOccurrences::CreateOccurrencesReaderCallback(), TeOccurrences::CreateOccurrencesReaderCallback(), GbifOccurrences::CreateOccurrencesReaderCallback(), TapirOccurrences::CreateOccurrencesReaderCallback(), and registerDriver().
Referenced by RequestFile::_setOccurrences(), main(), and readOccurrences().
|
private |
bool OccurrencesFactory::registerDriver | ( | const string & | driverId, |
CreateOccurrencesReaderCallback | builder | ||
) |
Register an OccurrencesReader driver.
driverId | Driver identifier. |
builder | Function pointer to builder function. |
Definition at line 67 of file OccurrencesFactory.cpp.
References _drivers.
Referenced by instance().
bool OccurrencesFactory::unregisterDriver | ( | const string & | driverId | ) |
Unregister an OccurrencesReader driver.
driverId | Driver identifier. |
Definition at line 75 of file OccurrencesFactory.cpp.
References _drivers.
|
private |
Definition at line 105 of file OccurrencesFactory.hh.
Referenced by create(), getRegisteredDrivers(), registerDriver(), and unregisterDriver().
|
staticprivate |
Definition of OccurrencesFactory class.
LICENSE INFORMATION
Copyright © 2006 INPE Copyright(c) 2003 by CRIA - Centro de Referencia em Informacao Ambiental
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
http://www.gnu.org/copyleft/gpl.html
Definition at line 102 of file OccurrencesFactory.hh.
Referenced by instance().