OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ErsSarRecordFactory.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // "Copyright Centre National d'Etudes Spatiales"
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 //----------------------------------------------------------------------------
10 // $Id$
11 
13 
14 namespace ossimplugins
15 {
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
27  ErsSarRecord* record = _availableRecords[id];
28  if (record == NULL)
29  {
30  return NULL;
31  }
32  else
33  {
34  return record->Instanciate();
35  }
36 }
37 
39 {
40  _availableRecords[id] = record;
41 }
42 }
virtual ErsSarRecord * Instanciate()=0
This function is able to create a new instance of the class.
void RegisterRecord(int id, ErsSarRecord *record)
Add a new Record type available in this factory.
virtual ~ErsSarRecordFactory()
Destructor.
ErsSarRecord * Instanciate(int id)
Instanciate a new Record.
This class is the base class of all the record classes.
Definition: ErsSarRecord.h:27
std::map< int, ErsSarRecord * > _availableRecords
Contain all the available Records for the factory.