OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimElevCellHandlerFactory.cpp
Go to the documentation of this file.
1 //*****************************************************************************
2 // FILE: ossimElevCellHandlerFactory.cc
3 //
4 // Copyright (C) 2001 ImageLinks, Inc.
5 //
6 // License: LGPL
7 //
8 // See LICENSE.txt file in the top level directory for more details.
9 //
10 // DESCRIPTION:
11 // Contains implementation of class ossimElevCellHandlerFactory. This is
12 // a "super-factory" owning a list of subfactories for each particular DEM
13 // format class.
14 //
15 // NOT CURRENTLY UTILIZED -- USE DTED MANAGER
16 //
17 // LIMITATIONS:
18 // The intention of this factory is to produce individual instances of
19 // elevation cell handlers. Presently this is not supported since DTED is
20 // the only elevation source being handled. DTED is loaded via the
21 // ossimDtedManager class as a DB interface, and not by accessing individual
22 // DTED handlers.
23 //
24 // SOFTWARE HISTORY:
25 //>
26 // 01Aug2001 Oscar Kramer (okramer@imagelinks.com)
27 // Initial coding.
28 //<
29 //*****************************************************************************
30 // $Id: ossimElevCellHandlerFactory.cpp 14800 2009-06-30 08:58:55Z dburken $
31 
33 #include <ossim/base/ossimString.h>
34 
36 
37 //*****************************************************************************
38 // STATIC METHOD: instance()
39 //
40 //*****************************************************************************
42 {
43  if(!theInstance)
45 
47 }
48 
49 //*****************************************************************************
50 // PROTECTED DEFAULT CONSTRUCTOR: ossimElevCellHandlerFactory
51 //
52 //*****************************************************************************
54 {
55  //***
56  // Add default sub factories to this factory's registry list:
57  // NOTE: DTED handlers are managed by their own ossimDtedManager so should
58  // never be created individually via a factory. This will be the typical
59  // pattern for all but custom DEM files.
60  //***
61 // registerFactory(ossimUsgsDemCellFactory::instance());
62 }
63 
64 
65 //*****************************************************************************
66 // METHOD: ossimElevCellHandlerFactory::create(kwl, prefix)
67 //
68 //*****************************************************************************
71  const char *prefix) const
72 {
73  std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator
74  elevCellFactory;
75 
77 
78  elevCellFactory = theRegistry.begin();
79  while((elevCellFactory != theRegistry.end()) && (!product))
80  {
81  product = (*elevCellFactory)->create(keywordList, prefix);
82  elevCellFactory++;
83  }
84 
85  return product;
86 }
87 
88 //*****************************************************************************
89 // METHOD: ossimElevCellHandlerFactory::create(proj_name)
90 //
91 //*****************************************************************************
94 {
95  std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator
96  elevCellFactory;
97 
99 
100  elevCellFactory = theRegistry.begin();
101  while((elevCellFactory != theRegistry.end()) && (!product))
102  {
103  product = (*elevCellFactory)->create(name);
104  elevCellFactory++;
105  }
106 
107  return product;
108 }
109 
110 //*****************************************************************************
111 // METHOD: ossimElevCellHandlerFactory::getList()
112 //
113 //*****************************************************************************
114 std::list<ossimString> ossimElevCellHandlerFactory::getList() const
115 {
116  std::list<ossimString> rtn_list;
117  std::list<ossimString> sub_list;
118  std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator factory_iter;
119 
120  factory_iter = theRegistry.begin();
121  while(factory_iter != theRegistry.end())
122  {
123  sub_list = (*factory_iter)->getList();
124  rtn_list.merge(sub_list);
125  factory_iter++;
126  }
127 
128  return rtn_list;
129 }
130 
static ossimElevCellHandlerFactory * theInstance
Represents serializable keyword/value map.
virtual std::list< ossimString > getList() const
std::list< ossimFactoryBase< ossimElevCellHandler > *> theRegistry
virtual ossimElevCellHandler * create(const ossimString &) const
static ossimElevCellHandlerFactory * instance()