OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimUnitTypeLut.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: See top level LICENSE.txt file.
5 //
6 // Author: Garrett Potts
7 //
8 //*******************************************************************
9 // $Id: ossimUnitTypeLut.cpp 22857 2014-08-05 15:02:58Z gpotts $
10 
12 
13 //ossimUnitTypeLut* ossimUnitTypeLut::theInstance = NULL;
14 
15 static const int TABLE_SIZE = 17;
16 
18 {
19  static ossimUnitTypeLut inst;
20 
21  return &inst;
22 // if (!theInstance)
23 // {
24 // theInstance = new ossimUnitTypeLut;
25 // }
26 // return theInstance;
27 }
28 
30  :ossimLookUpTable(TABLE_SIZE)
31 {
32  theTable[0].theKey = OSSIM_UNIT_UNKNOWN;
33  theTable[0].theValue = "unknown";
34  theTable[1].theKey = OSSIM_METERS;
35  theTable[1].theValue = "meters";
36  theTable[2].theKey = OSSIM_FEET;
37  theTable[2].theValue = "feet";
38  theTable[3].theKey = OSSIM_US_SURVEY_FEET;
39  theTable[3].theValue = "us_survey_feet";
40  theTable[4].theKey = OSSIM_DEGREES;
41  theTable[4].theValue = "degrees";
42  theTable[5].theKey = OSSIM_RADIANS;
43  theTable[5].theValue = "radians";
44  theTable[6].theKey = OSSIM_NAUTICAL_MILES;
45  theTable[6].theValue = "nautical_miles";
46  theTable[7].theKey = OSSIM_SECONDS;
47  theTable[7].theValue = "seconds";
48  theTable[8].theKey = OSSIM_MINUTES;
49  theTable[8].theValue = "minutes";
50  theTable[9].theKey = OSSIM_PIXEL;
51  theTable[9].theValue = "pixel";
52  theTable[10].theKey = OSSIM_MILES;
53  theTable[10].theValue = "miles";
54  theTable[11].theKey = OSSIM_MILLIMETERS;
55  theTable[11].theValue = "millimeters";
56  theTable[12].theKey = OSSIM_MICRONS;
57  theTable[12].theValue = "microns";
58  theTable[13].theKey = OSSIM_CENTIMETERS;
59  theTable[13].theValue = "centimeters";
60  theTable[14].theKey = OSSIM_YARDS;
61  theTable[14].theValue = "yards";
62  theTable[15].theKey = OSSIM_INCHES;
63  theTable[15].theValue = "inches";
64  theTable[16].theKey = OSSIM_KILOMETERS;
65  theTable[16].theValue = "kilometers";
66 }
67 
69 {
70 }
72  bool case_insensitive) const
73 {
74  ossim_int32 result
75  = ossimLookUpTable::getEntryNumber(entry_string, case_insensitive);
76  if(result < 0)
77  {
79  }
80 
81  return result;
82 }
83 
85  const char* prefix,
86  bool case_insensitive) const
87 {
88  ossim_int32 result =
89  ossimLookUpTable::getEntryNumber(kwl, prefix, case_insensitive);
90  if(result < 0)
91  {
93  }
94  return result;
95 }
96 
98 {
100 }
std::vector< ossimKeyValueMap > theTable
Represents serializable keyword/value map.
virtual ~ossimUnitTypeLut()
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
virtual ossimKeyword getKeyword() const
static const char * UNITS_KW
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
int ossim_int32