datatypes.cpp
Go to the documentation of this file.
1 /*
2  * datatypes.cpp
3  *
4  * Created on: Jul 3, 2012
5  * Author: sdries
6  */
7 
8 #include "wire/core/datatypes.h"
9 
10 namespace mhf {
11 
12 std::map<Attribute, std::string> AttributeConv::ATTR_TO_STR;
13 
14 std::map<std::string, Attribute> AttributeConv::STR_TO_ATTR;
15 
16 Attribute AttributeConv::attribute(const std::string& attribute_str) {
18  if (it == STR_TO_ATTR.end()) {
19  Attribute attribute_id = STR_TO_ATTR.size();
20  STR_TO_ATTR[attribute_str] = attribute_id;
21  ATTR_TO_STR[attribute_id] = attribute_str;
22  return attribute_id;
23  }
24  return it->second;
25 }
26 
29  if (it == ATTR_TO_STR.end()) {
30  return "";
31  }
32  return it->second;
33 }
34 
35 }
36 
37 
38 
static std::map< std::string, Attribute > STR_TO_ATTR
map from attribute string to types
Definition: datatypes.h:68
static std::map< Attribute, std::string > ATTR_TO_STR
map from attribute types to strings
Definition: datatypes.h:65
static Attribute attribute(const std::string &attribute_str)
attribute
Definition: datatypes.cpp:16
static std::string attribute_str(const Attribute &attribute)
attribute_str
Definition: datatypes.cpp:27
iterator(field< oT > &in_M, const bool at_end=false)
int Attribute
Definition: datatypes.h:49
Definition: ClassModel.h:44


wire_core
Author(s): Sjoerd van den Dries, Jos Elfring
autogenerated on Fri Apr 16 2021 02:32:27