version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
AttributeMap.h
1#ifndef _ATTRIBUTE_MAP_H_
2#define _ATTRIBUTE_MAP_H_
3#include "mspass/utility/AntelopePf.h"
4#include "mspass/utility/Metadata.h"
5#include <list>
6#include <map>
7#include <string>
8namespace mspass {
9namespace utility {
24public:
26 std::string db_attribute_name;
36 std::string db_table_name;
38 std::string internal_name;
40 MDtype mdt;
45 bool is_key;
64 AttributeProperties(const std::string);
77 std::string fully_qualified_name() const;
78 friend std::ostream &operator<<(std::ostream &ofs,
79 const AttributeProperties &d);
80};
100public:
116 std::map<std::string, AttributeProperties> attributes;
120 AttributeMap();
139 AttributeMap(const std::string tag);
141 AttributeMap(const AttributeMap &am0);
154 AttributeProperties operator[](const std::string key) const;
156 AttributeProperties operator[](const char *key) const;
182 std::map<std::string, AttributeProperties>
183 aliases(const std::string key) const;
185 std::map<std::string, AttributeProperties> aliases(const char *key) const;
203 std::list<std::string> aliastables(const std::string key) const;
205 std::list<std::string> aliastables(const char *key) const;
214 bool is_alias(const std::string key) const;
216 bool is_alias(const char *key) const;
217
218private:
228 AttributeMap(const AntelopePf &pf, const std::string name);
233 std::map<std::string, std::list<std::string>> aliasmap;
234};
235} // namespace utility
236} // namespace mspass
237
238#endif
C++ object version of a parameter file.
Definition AntelopePf.h:61
An object to map internal and external attribute names.
Definition AttributeMap.h:99
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
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:219
AttributeProperties operator[](const std::string key) const
Definition AttributeMap.cc:320
AttributeMap & operator=(const AttributeMap &am0)
Definition AttributeMap.cc:227
std::map< std::string, AttributeProperties > aliases(const std::string key) const
bool is_alias(const std::string key) const
std::list< std::string > aliastables(const std::string key) const
Defines properties of a database attribute and link to internal names.
Definition AttributeMap.h:23
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:26
std::string db_table_name
Database table name from which this attribute was loaded. Relational databases always share attribute...
Definition AttributeMap.h:36
std::string fully_qualified_name() const
Returns full name.
Definition AttributeMap.cc:118
std::string internal_name
Definition AttributeMap.h:38
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:45
AttributeProperties & operator=(const AttributeProperties &)
Standard assignment operator.
Definition AttributeMap.cc:108
MDtype mdt
Definition AttributeMap.h:40