openModeller
Version 1.4.0
|
#include <TapirOccurrences.hh>
Public Member Functions | |
TapirOccurrences (const char *url, const char *coordSystem) | |
~TapirOccurrences () | |
bool | load () |
OccurrencesPtr | getPresences (const char *groupId) |
OccurrencesPtr | getAbsences (const char *groupId) |
Static Public Member Functions | |
static OccurrencesReader * | CreateOccurrencesReaderCallback (const char *source, const char *coordSystem) |
Private Member Functions | |
bool | _parseCapabilities (const std::string *xml, CapabilitiesInfo *info) |
bool | _retrieveRecords (TapirRecordData *data, int limit) |
Static Private Member Functions | |
static size_t | _curl_header_writer (void *ptr, size_t size, size_t nmemb, void *stream) |
static size_t | _curl_body_writer (void *ptr, size_t size, size_t nmemb, void *stream) |
static void | _startCapabilitiesElement (void *data, const char *el, const char **attr) |
static void | _maxRecordsDataHandler (void *data, const char *value, int len) |
static void | _endCapabilitiesElement (void *data, const char *el) |
static void | _startSearchElement (void *data, const char *el, const char **attr) |
Private Attributes | |
bool | _loaded |
int | _default_limit |
int | _provider_limit |
Read occurrences data from a TAPIR service that uses DarwinCore 1.4 and the corresponding geospatial extension.
Definition at line 69 of file TapirOccurrences.hh.
TapirOccurrences::TapirOccurrences | ( | const char * | url, |
const char * | coordSystem | ||
) |
Constructor.
url | Service URL. |
coordSystem | Default coordinate system in WKT. |
Definition at line 96 of file TapirOccurrences.cpp.
References OccurrencesReader::_coord_system, _default_limit, _loaded, and OccurrencesReader::_source.
Referenced by CreateOccurrencesReaderCallback().
Destructor.
Definition at line 115 of file TapirOccurrences.cpp.
size_t TapirOccurrences::_curl_body_writer | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
void * | stream | ||
) | [static, private] |
Definition at line 79 of file TapirOccurrences.cpp.
Referenced by _retrieveRecords(), and load().
size_t TapirOccurrences::_curl_header_writer | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
void * | stream | ||
) | [static, private] |
Definition at line 61 of file TapirOccurrences.cpp.
Referenced by _retrieveRecords(), and load().
void TapirOccurrences::_endCapabilitiesElement | ( | void * | data, |
const char * | el | ||
) | [static, private] |
Definition at line 405 of file TapirOccurrences.cpp.
References CapabilitiesInfo::_parser, and _startCapabilitiesElement().
Referenced by _startCapabilitiesElement().
void TapirOccurrences::_maxRecordsDataHandler | ( | void * | data, |
const char * | value, | ||
int | len | ||
) | [static, private] |
Definition at line 394 of file TapirOccurrences.cpp.
References CapabilitiesInfo::_max_records.
Referenced by _startCapabilitiesElement().
bool TapirOccurrences::_parseCapabilities | ( | const std::string * | xml, |
CapabilitiesInfo * | info | ||
) | [private] |
Definition at line 272 of file TapirOccurrences.cpp.
References CapabilitiesInfo::_max_records, CapabilitiesInfo::_parser, _provider_limit, _startCapabilitiesElement(), Log::error(), and Log::instance().
Referenced by load().
bool TapirOccurrences::_retrieveRecords | ( | TapirRecordData * | data, |
int | limit | ||
) | [private] |
Definition at line 481 of file TapirOccurrences.cpp.
References _curl_body_writer(), _curl_header_writer(), TapirRecordData::_next, TapirRecordData::_occurrences, OccurrencesReader::_source, _startSearchElement(), Log::error(), Log::info(), Log::instance(), and TP_TEMPLATE_LOCATION.
Referenced by getPresences().
void TapirOccurrences::_startCapabilitiesElement | ( | void * | data, |
const char * | el, | ||
const char ** | attr | ||
) | [static, private] |
Definition at line 315 of file TapirOccurrences.cpp.
References CapabilitiesInfo::_accepts_any_model, CapabilitiesInfo::_accepts_om_model, CapabilitiesInfo::_accepts_om_template, _endCapabilitiesElement(), CapabilitiesInfo::_has_guid, CapabilitiesInfo::_has_lat, CapabilitiesInfo::_has_long, CapabilitiesInfo::_has_name, CapabilitiesInfo::_is_tapir, _maxRecordsDataHandler(), CapabilitiesInfo::_parser, TP_OUTPUT_MODEL_LOCATION, TP_OUTPUT_MODEL_STRSIZE, TP_TEMPLATE_LOCATION, and TP_TEMPLATE_STRSIZE.
Referenced by _endCapabilitiesElement(), and _parseCapabilities().
void TapirOccurrences::_startSearchElement | ( | void * | data, |
const char * | el, | ||
const char ** | attr | ||
) | [static, private] |
Definition at line 627 of file TapirOccurrences.cpp.
References TapirRecordData::_next, and TapirRecordData::_occurrences.
Referenced by _retrieveRecords().
OccurrencesReader * TapirOccurrences::CreateOccurrencesReaderCallback | ( | const char * | source, |
const char * | coordSystem | ||
) | [static] |
Return a new instance of TapirOccurrences.
Definition at line 53 of file TapirOccurrences.cpp.
References TapirOccurrences().
Referenced by OccurrencesFactory::instance().
OccurrencesPtr TapirOccurrences::getAbsences | ( | const char * | groupId | ) | [inline, virtual] |
Return the absences (abundance == 0) from a specific group.
groupId | Identifier for a group of occurrences (usually a species name). |
Reimplemented from OccurrencesReader.
Definition at line 106 of file TapirOccurrences.hh.
OccurrencesPtr TapirOccurrences::getPresences | ( | const char * | groupId | ) | [virtual] |
Return the presences (abundance > 0) from a specific group.
groupId | Identifier for a group of occurrences (usually a species name). |
Reimplemented from OccurrencesReader.
Definition at line 421 of file TapirOccurrences.cpp.
References OccurrencesReader::_coord_system, _default_limit, TapirRecordData::_next, TapirRecordData::_occurrences, OccurrencesReader::_presences, _provider_limit, _retrieveRecords(), Log::info(), and Log::instance().
bool TapirOccurrences::load | ( | ) | [virtual] |
Read occurrences from a TAPIR service.
Implements OccurrencesReader.
Definition at line 124 of file TapirOccurrences.cpp.
References CapabilitiesInfo::_accepts_any_model, CapabilitiesInfo::_accepts_om_model, CapabilitiesInfo::_accepts_om_template, _curl_body_writer(), _curl_header_writer(), CapabilitiesInfo::_has_guid, CapabilitiesInfo::_has_lat, CapabilitiesInfo::_has_long, CapabilitiesInfo::_has_name, CapabilitiesInfo::_is_tapir, _loaded, _parseCapabilities(), OccurrencesReader::_source, Log::error(), Log::info(), Log::instance(), and Log::warn().
int TapirOccurrences::_default_limit [private] |
Definition at line 114 of file TapirOccurrences.hh.
Referenced by getPresences(), and TapirOccurrences().
bool TapirOccurrences::_loaded [private] |
Definition at line 111 of file TapirOccurrences.hh.
Referenced by load(), and TapirOccurrences().
int TapirOccurrences::_provider_limit [private] |
Definition at line 117 of file TapirOccurrences.hh.
Referenced by _parseCapabilities(), and getPresences().