datatypes.h
Go to the documentation of this file.
1 /************************************************************************
2  * Copyright (C) 2012 Eindhoven University of Technology (TU/e). *
3  * All rights reserved. *
4  ************************************************************************
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions *
7  * are met: *
8  * *
9  * 1. Redistributions of source code must retain the above *
10  * copyright notice, this list of conditions and the following *
11  * disclaimer. *
12  * *
13  * 2. Redistributions in binary form must reproduce the above *
14  * copyright notice, this list of conditions and the following *
15  * disclaimer in the documentation and/or other materials *
16  * provided with the distribution. *
17  * *
18  * THIS SOFTWARE IS PROVIDED BY TU/e "AS IS" AND ANY EXPRESS OR *
19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
20  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
21  * ARE DISCLAIMED. IN NO EVENT SHALL TU/e OR CONTRIBUTORS BE LIABLE *
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
24  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
25  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
26  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
28  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
29  * DAMAGE. *
30  * *
31  * The views and conclusions contained in the software and *
32  * documentation are those of the authors and should not be *
33  * interpreted as representing official policies, either expressed or *
34  * implied, of TU/e. *
35  ************************************************************************/
36 
37 #ifndef WM_DATATYPES_H_
38 #define WM_DATATYPES_H_
39 
40 #include <map>
41 #include <string>
42 
43 namespace mhf {
44 
45 /* Type for object identifier */
46 typedef long ObjectID;
47 
48 /* Type for object attribute */
49 typedef int Attribute;
50 
51 /* Type for time */
52 typedef double Time;
53 
54 /* Type for duration */
55 typedef double Duration;
56 
61 
62 public:
63 
65  static std::map<Attribute, std::string> ATTR_TO_STR;
66 
68  static std::map<std::string, Attribute> STR_TO_ATTR;
69 
70 public:
71 
77  static Attribute attribute(const std::string& attribute_str);
78 
84  static std::string attribute_str(const Attribute& attribute);
85 
86 };
87 
88 }
89 
90 #endif /* WM_DATATYPES_H_ */
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
long ObjectID
Definition: datatypes.h:46
double Time
Definition: datatypes.h:52
int Attribute
Definition: datatypes.h:49
double Duration
Definition: datatypes.h:55
Class for converting between attribute names (strings) and more effecient attribute types...
Definition: datatypes.h:60
Definition: ClassModel.h:44


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