version
0.0.1
Defines the C++ API for MsPASS
|
Defines properties of a database attribute and link to internal names. More...
#include <AttributeMap.h>
Public Member Functions | |
AttributeProperties () | |
AttributeProperties (const std::string) | |
Create using a string description. The standard construction of an associative array uses this constructor driven by a series of input lines. The input line that is parsed must contain these member attributes in the following order: More... | |
AttributeProperties (const AttributeProperties &) | |
Standard copy constructor. | |
AttributeProperties & | operator= (const AttributeProperties &) |
Standard assignment operator. | |
std::string | fully_qualified_name () const |
Returns full name. More... | |
Public Attributes | |
std::string | db_attribute_name |
std::string | db_table_name |
Database table name from which this attribute was loaded. Relational databases always share attribute names with multiple tables. This is a fundamental axiom in relational database theory. Because an attribute of the same name may or may not be related in different tables it is necessary to define the parent table to avoid ambiguity. Note that in MsPASS a common convention is that a db_attribute_name may contain the parent table implicity (e.g. wfdisc.sta) but code using this object should not assume this. User should assume the correct table name is stored here. | |
std::string | internal_name |
MDtype | mdt |
bool | is_key |
Defines if parameter is a key in it's parent table. Keys in a relational database are special attributes and it is useful to tag a parameter as being a key or not a key. When true this attribute indicates a parameter is a key for db_table_name. | |
Friends | |
std::ostream & | operator<< (std::ostream &ofs, const AttributeProperties &d) |
Defines properties of a database attribute and link to internal names.
This object is used to define the relationship between a parameter stored externally (originally conceived as a database attribute general enough for any externally imposed naming convention) with a particular name with some internal naming convention. This object defines the relationship for one internal parameter and it's external properties. Arrays of these objects or (as used in the AttributeMap object in MsPASS) associate arrays can be used to define relationships for a complete set of parameter names. Note this could have been called a struct since all the attributes are public.
mspass::utility::AttributeProperties::AttributeProperties | ( | ) |
Default constructor. Creates a null object with MTtype set to invalid. This constructor exists to avoid automatic construction with no parameters, but it should not be used.
mspass::utility::AttributeProperties::AttributeProperties | ( | const std::string | ) |
Create using a string description. The standard construction of an associative array uses this constructor driven by a series of input lines. The input line that is parsed must contain these member attributes in the following order:
The mdt field must be one of "REAL", "real", "STRING", "string", "INT", "int", "BOOL", "BOOLEAN", "bool", or "boolean". Any other field with cause this constructor to throw an exception.
MetadataError | is thrown for parsing errors. |
string mspass::utility::AttributeProperties::fully_qualified_name | ( | ) | const |
Returns full name.
Database attribute names can and often do occur in multiple tables. This method returns a full name that is used to uniquely define that attribute in a particular table. Although this could be generalized, for the present this is always returned in the form used by Antelope/datascope: that is the string is if the form table.attribute.
std::string mspass::utility::AttributeProperties::db_attribute_name |
Name for this parameter as the attribute name in some database table.
std::string mspass::utility::AttributeProperties::internal_name |
Internal name used to reference this parameter.
MDtype mspass::utility::AttributeProperties::mdt |
Type of this parameter.