OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimLookUpTable.h
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: MIT
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: David Burken
9 //
10 // Description:
11 //
12 // Contains class declaration for LookUpTable.
13 //*******************************************************************
14 // $Id: ossimLookUpTable.h 19448 2011-04-26 15:15:07Z dburken $
15 
16 #ifndef ossimLookUpTable_HEADER
17 #define ossimLookUpTable_HEADER
18 
19 #include <vector>
20 
22 #include <ossim/base/ossimString.h>
24 
25 #include <initializer_list>
26 
27 class ossimKeywordlist;
28 
29 //*******************************************************************
30 // CLASS: LookUpTable
31 //*******************************************************************
33 {
34 public:
35 
36  enum
37  {
38  NOT_FOUND = -1
39  };
40 
45  ossimLookUpTable(const std::initializer_list<ossimString>& stringInitializer);
46 
47  virtual ~ossimLookUpTable();
48 
54  virtual ossimString getEntryString(ossim_int32 entry_number) const;
55 
63  virtual ossimString getTableIndexString(ossim_uint32 table_index) const;
64 
69  virtual ossimString operator[](ossim_int32 entry_number) const;
70 
76  virtual ossimString getEntryString(const ossimKeywordlist& kwl,
77  const char* prefix=0) const;
78 
85  virtual ossim_int32 getEntryNumber(const char* entry_string,
86  bool case_insensitive = true) const;
87 
95  virtual ossim_int32 getEntryNumber(const ossimKeywordlist& kwl,
96  const char* prefix=0,
97  bool case_insensitive = true) const;
98 
102  virtual ossimKeyword getKeyword() const;
103 
104  virtual ossim_uint32 getTableSize() const;
105 
106  void dumpValues(std::ostream& out)const;
107 protected:
108 
109  ossimLookUpTable(ossim_int32 table_size);
110 
112  {
113  public:
114  ossimKeyValueMap(ossim_int32 key=0, const ossimString& value=""):
115  theKey(key),
116  theValue(value)
117  {}
118  void init (ossim_int32 key, const ossimString& value) { theKey=key; theValue=value; }
119 
122  };
123 
124  std::vector<ossimKeyValueMap> theTable;
125 
127 };
128 
129 #endif
std::vector< ossimKeyValueMap > theTable
void init(ossim_int32 key, const ossimString &value)
#define OSSIMDLLEXPORT
Represents serializable keyword/value map.
unsigned int ossim_uint32
ossimKeyValueMap(ossim_int32 key=0, const ossimString &value="")
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32