casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PageHeaderCache.h
Go to the documentation of this file.
1 #ifndef PAGEHEADERCACHE_H_
2 #define PAGEHEADERCACHE_H_
3 
4 #include <map>
5 #include <vector>
6 
9 
10 namespace casa {
11 
12 using std::vector;
13 using std::map;
14 
16 public:
19  : item_(item), value_(value) {}
20  HeaderItem item() const { return item_ ; }
21  const String& value() const { return value_ ; }
22  void setValue(const String& value) { value_ = value ; }
23 private:
26 };
27 
29 private:
30  static const String& emptyString() { static const String empty_ {""}; return empty_; }
31 public:
35  void clear();
36  const String& value(HeaderItem header_item) const {
37  const auto it = itemIndex_.find(header_item);
38  if ( it == itemIndex_.end() ) return emptyString();
39  return values_[it->second].value(); }
40  const std::vector<HeaderItemData>& values() const { return values_ ; }
41  String toString() const ;
42 
43 private:
44  map<HeaderItem,uInt> itemIndex_;
45  std::vector<HeaderItemData> values_;
46 
47 };
48 
49 ostream& operator<<(ostream &os, const PageHeaderCache& cache);
50 
51 }
52 
53 #endif
const String & value(HeaderItem header_item) const
ostream & operator<<(ostream &os, const PageHeaderCache &cache)
String toString() const
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
void setValue(const String &value)
HeaderItemData(HeaderItem item, const String &value)
static const String & emptyString()
HeaderItem item() const
map< HeaderItem, uInt > itemIndex_
std::vector< HeaderItemData > values_
void store(HeaderItemData data)
const std::vector< HeaderItemData > & values() const
String: the storage and methods of handling collections of characters.
Definition: String.h:223
const String & value() const