OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
AlosPalsarRecordFactory.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 // "Copyright Centre for Remote Imaging, Sensing and Processing"
5 //
6 // License: LGPL
7 //
8 // See LICENSE.txt file in the top level directory for more details.
9 //
10 //----------------------------------------------------------------------------
11 // $Id$
12 
14 #include <ossim/base/ossimTrace.h>
15 
16 // Static trace for debugging
17 static ossimTrace traceDebug("AlosPalsarRecordFactory:debug");
18 
19 namespace ossimplugins
20 {
21 
23 {
24 }
25 
27 {
28 }
29 
31 {
32  if (traceDebug())
33  {
34  ossimNotify(ossimNotifyLevel_DEBUG) << "Intanciate AlosPalsar record:" << id << "\n";
35  }
36  AlosPalsarRecord* record = _availableRecords[id];
37  if (record == NULL)
38  {
39  return NULL;
40  }
41  else
42  {
43  return record->Instanciate();
44  }
45 }
46 
48 {
49  _availableRecords[id] = record;
50 }
51 
52 }
AlosPalsarRecord * Instanciate(int id)
Instanciate a new Record.
This class is the base class of all the record classes.
std::map< int, AlosPalsarRecord * > _availableRecords
Contain all the available Records for the factory.
virtual AlosPalsarRecord * Instanciate()=0
This function is able to create a new instance of the class.
void RegisterRecord(int id, AlosPalsarRecord *record)
Add a new Record type available in this factory.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)