MsPASS C++ API  2.4.1.dev4+g92330b7a
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;
83 friend std::ostream &operator<<(std::ostream &ofs,
84 const AttributeProperties &d);
85};
105public:
121 std::map<std::string, AttributeProperties> attributes;
125 AttributeMap();
144 AttributeMap(const std::string tag);
146 AttributeMap(const AttributeMap &am0);
159 AttributeProperties operator[](const std::string key) const;
161 AttributeProperties operator[](const char *key) const;
187 std::map<std::string, AttributeProperties>
188 aliases(const std::string key) const;
190 std::map<std::string, AttributeProperties> aliases(const char *key) const;
208 std::list<std::string> aliastables(const std::string key) const;
210 std::list<std::string> aliastables(const char *key) const;
219 bool is_alias(const std::string key) const;
221 bool is_alias(const char *key) const;
222
223private:
233 AttributeMap(const AntelopePf &pf, const std::string name);
238 std::map<std::string, std::list<std::string>> aliasmap;
239};
240} // namespace utility
241} // namespace mspass
242
243#endif
C++ object version of a parameter file.
Definition AntelopePf.h:61
An object to map internal and external attribute names.
Definition AttributeMap.h:104
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:121
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:322
AttributeMap & operator=(const AttributeMap &am0)
Definition AttributeMap.cc:227
std::map< std::string, AttributeProperties > aliases(const std::string key) const
Definition AttributeMap.cc:249
bool is_alias(const std::string key) const
Definition AttributeMap.cc:238
std::list< std::string > aliastables(const std::string key) const
Definition AttributeMap.cc:289
Defines properties of a database attribute and link to internal names.
Definition AttributeMap.h:23
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
friend std::ostream & operator<<(std::ostream &ofs, const AttributeProperties &d)
MDtype mdt
Definition AttributeMap.h:40