openModeller  Version 1.5.0
TapirOccurrences Class Reference

#include <TapirOccurrences.hh>

Inheritance diagram for TapirOccurrences:
Inheritance graph
Collaboration diagram for TapirOccurrences:
Collaboration graph

Public Member Functions

 TapirOccurrences (const char *url, const char *coordSystem)
 
 ~TapirOccurrences ()
 
bool load ()
 
OccurrencesPtr getPresences (const char *groupId)
 
OccurrencesPtr getAbsences (const char *groupId)
 
- Public Member Functions inherited from OccurrencesReader
virtual ~OccurrencesReader ()
 
void printOccurrences (const std::string &msg="")
 

Static Public Member Functions

static OccurrencesReaderCreateOccurrencesReaderCallback (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
 

Additional Inherited Members

- Protected Types inherited from OccurrencesReader
typedef std::vector
< OccurrencesPtr
LstOccurrences
 
- Protected Member Functions inherited from OccurrencesReader
int _addOccurrence (const char *id, const char *groupId, Coord lg, Coord lt, Scalar error, Scalar abundance, int num_attributes, Scalar *attributes)
 
 OccurrencesReader ()
 
- Protected Attributes inherited from OccurrencesReader
LstOccurrences _presences
 
LstOccurrences _absences
 
char * _source
 
char * _coord_system
 

Detailed Description

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.

Constructor & Destructor Documentation

TapirOccurrences::TapirOccurrences ( const char *  url,
const char *  coordSystem 
)

Constructor.

Parameters
urlService URL.
coordSystemDefault 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().

TapirOccurrences::~TapirOccurrences ( )

Destructor.

Definition at line 115 of file TapirOccurrences.cpp.

Member Function Documentation

size_t TapirOccurrences::_curl_body_writer ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  stream 
)
staticprivate

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 
)
staticprivate

Definition at line 61 of file TapirOccurrences.cpp.

Referenced by _retrieveRecords(), and load().

void TapirOccurrences::_endCapabilitiesElement ( void *  data,
const char *  el 
)
staticprivate

Definition at line 405 of file TapirOccurrences.cpp.

References CapabilitiesInfo::_parser, and _startCapabilitiesElement().

Referenced by _startCapabilitiesElement().

Here is the call graph for this function:

void TapirOccurrences::_maxRecordsDataHandler ( void *  data,
const char *  value,
int  len 
)
staticprivate

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().

Here is the call graph for this function:

bool TapirOccurrences::_retrieveRecords ( TapirRecordData data,
int  limit 
)
private
void TapirOccurrences::_startSearchElement ( void *  data,
const char *  el,
const char **  attr 
)
staticprivate

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().

Here is the call graph for this function:

OccurrencesPtr TapirOccurrences::getAbsences ( const char *  groupId)
inlinevirtual

Return the absences (abundance == 0) from a specific group.

Parameters
groupIdIdentifier for a group of occurrences (usually a species name).
Returns
Pointer to occurrences of the specified group. If the group was not found or not specified, an empty OccurrencesPtr is returned.

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.

Parameters
groupIdIdentifier for a group of occurrences (usually a species name).
Returns
Pointer to occurrences of the specified group. If the group was not found or not specified, an empty OccurrencesPtr is returned.

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().

Here is the call graph for this function:

Member Data Documentation

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().


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