version  0.0.1
Defines the C++ API for MsPASS
AttributeMap.h
1 #ifndef _ATTRIBUTE_MAP_H_
2 #define _ATTRIBUTE_MAP_H_
3 #include <string>
4 #include <map>
5 #include <list>
6 #include "mspass/utility/Metadata.h"
7 #include "mspass/utility/AntelopePf.h"
8 namespace mspass
9 {
10 namespace utility{
24 {
25 public:
27  std::string db_attribute_name;
37  std::string db_table_name;
39  std::string internal_name;
41  MDtype mdt;
46  bool is_key;
65  AttributeProperties(const std::string);
77  std::string fully_qualified_name() const;
78  friend std::ostream& operator<<(std::ostream& ofs, const AttributeProperties& d);
79 };
99 {
100 public:
116  std::map<std::string,AttributeProperties> attributes;
120  AttributeMap();
138  AttributeMap(const std::string tag);
140  AttributeMap(const AttributeMap& am0);
142  AttributeMap& operator=(const AttributeMap& am0);
153  AttributeProperties operator[](const std::string key) const;
155  AttributeProperties operator[](const char* key) const;
181  std::map<std::string,AttributeProperties> aliases(const std::string key) const;
183  std::map<std::string,AttributeProperties> aliases(const char *key) const;
200  std::list<std::string> aliastables(const std::string key) const;
202  std::list<std::string> aliastables(const char *key) const;
211  bool is_alias(const std::string key) const;
213  bool is_alias(const char *key) const;
214 private:
224  AttributeMap(const AntelopePf &pf,const std::string name);
229  std::map<std::string,std::list<std::string> > aliasmap;
230 };
231 } // end utility namespace
232 } // End namespace mspass declaration
233 
234 #endif
C++ object version of a parameter file.
Definition: AntelopePf.h:62
An object to map internal and external attribute names.
Definition: AttributeMap.h:99
AttributeMap(const std::string tag)
Create mapping for a specified namespace tag (usually a schema name).
AttributeMap()
Default constructor. The default assumes the css3.0 schema and will load the name definitions defined...
Definition: AttributeMap.cc:214
AttributeProperties operator[](const std::string key) const
Definition: AttributeMap.cc:325
AttributeMap & operator=(const AttributeMap &am0)
Definition: AttributeMap.cc:221
std::list< std::string > aliastables(const std::string key) const
std::map< std::string, AttributeProperties > attributes
Maps internal to external names. This object is little more than a wrapper around this Standard Templ...
Definition: AttributeMap.h:116
bool is_alias(const std::string key) const
std::map< std::string, AttributeProperties > aliases(const std::string key) const
Defines properties of a database attribute and link to internal names.
Definition: AttributeMap.h:24
AttributeProperties(const std::string)
Create using a string description. The standard construction of an associative array uses this constr...
std::string db_attribute_name
Definition: AttributeMap.h:27
std::string db_table_name
Database table name from which this attribute was loaded. Relational databases always share attribute...
Definition: AttributeMap.h:37
std::string fully_qualified_name() const
Returns full name.
Definition: AttributeMap.cc:110
std::string internal_name
Definition: AttributeMap.h:39
AttributeProperties()
Definition: AttributeMap.cc:13
bool is_key
Defines if parameter is a key in it's parent table. Keys in a relational database are special attribu...
Definition: AttributeMap.h:46
AttributeProperties & operator=(const AttributeProperties &)
Standard assignment operator.
Definition: AttributeMap.cc:100
MDtype mdt
Definition: AttributeMap.h:41