version  0.0.1
Defines the C++ API for MsPASS
AttributeCrossReference.h
1 #ifndef _ATTRIBUTE_CROSS_REFERENCE_
2 #define _ATTRIBUTE_CROSS_REFERENCE_
3 #include <string>
4 #include <map>
5 #include <set>
6 #include "mspass/utility/Metadata.h"
7 #include "mspass/utility/AttributeMap.h"
8 namespace mspass
9 {
10 namespace utility{
21 {
22  public:
43  AttributeCrossReference(const std::string lines_to_parse);
54  AttributeCrossReference(const std::list<std::string>& lines);
55 
66  AttributeCrossReference(const std::map<std::string,std::string> internal2external,
67  const mspass::utility::MetadataList& mdlist);
71  std::string internal(const std::string key) const;
73  std::string external(const std::string key) const;
75  MDtype type(const std::string key) const;
79  int size() const;
86  void put(const std::string intern, const std::string ext);
91  std::set<std::string> internal_names() const;
96  std::set<std::string> external_names() const;
97  private:
98  std::map<std::string,std::string> itoe;
99  std::map<std::string,std::string> etoi;
100  /* keyed by internal names. Get type of this attribute*/
101  std::map<std::string,MDtype> imdtypemap;
102 };
103 } // end utility namespace
104 } // end mspass namespace encapsulation
105 #endif
Cross reference between external and internal names.
Definition: AttributeCrossReference.h:21
void put(const std::string intern, const std::string ext)
Definition: AttributeCrossReference.cc:148
std::set< std::string > external_names() const
Definition: AttributeCrossReference.cc:167
std::set< std::string > internal_names() const
Definition: AttributeCrossReference.cc:157
MDtype type(const std::string key) const
Definition: AttributeCrossReference.cc:133
AttributeCrossReference & operator=(const AttributeCrossReference &parent)
Definition: AttributeCrossReference.cc:103
int size() const
Definition: AttributeCrossReference.cc:143
AttributeCrossReference(const std::string lines_to_parse)
AttributeCrossReference()
Definition: AttributeCrossReference.h:27
std::string external(const std::string key) const
Definition: AttributeCrossReference.cc:123
AttributeCrossReference(const std::list< std::string > &lines)
AttributeCrossReference(const std::map< std::string, std::string > internal2external, const mspass::utility::MetadataList &mdlist)