API Documentation
Loading...
Searching...
No Matches
StreetInfo.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/Model.h>
3namespace NDEVR
4{
5 class StreetName : public Model
6 {
7 public:
8 StreetName(const Model& model)
9 : Model(model)
10 {
11
12 if (!isOfType(TypeName()))
13 {
14 //setup model for first time
16 }
17 }
18 void set(const String& type)
19 {
21 }
26 static constexpr const char* ValidRegex() { return "*."; } // TODO
27 static constexpr const char* TypeName() { return "street_name"; }
28 };
29 class SurfaceType : public Model
30 {
31 public:
32 SurfaceType(const Model& model)
33 : Model(model)
34 {
35
36 if (!isOfType(TypeName()))
37 {
38 //setup model for first time
40 }
41 }
42 void set(const String& type)
43 {
45 }
50 static constexpr const char* ValidRegex() { return "sad"; } // TODO
51 static constexpr const char* TypeName() { return "surface_type"; }
52 };
53 class SurfaceCondition : public Model
54 {
55 public:
56 SurfaceCondition(const Model& model)
57 : Model(model)
58 {
59
60 if (!isOfType(TypeName()))
61 {
62 //setup model for first time
64 }
65 }
66 void set(const String& condition)
67 {
69 }
74 static constexpr const char* ValidRegex() { return "sad";/*TODO*/ }
75 static constexpr const char* TypeName() { return "surface_condition"; }
76
77 };
78 class SpeedLimit : public Model
79 {
80 public:
81 SpeedLimit(const Model& model)
82 : Model(model)
83 {
84 if (!isOfType(TypeName()))
85 {
86 //setup model for first time
88 }
89 }
90 void set(const String& speed_limit)
91 {
93 }
98 static constexpr const char* ValidRegex() { return "sad";/*TODO*/ }
99 static constexpr const char* TypeName() { return "speed_limit"; }
100 };
101
102 class StreetInfo : public Model
103 {
104 public:
105 StreetInfo(const Model& model)
106 : Model(model)
107 {
108 if (!isOfType(TypeName()))
109 {
110 //setup model for first time
113 }
114 }
116 {
117 return StreetName(getChild(0));
118 }
120 {
121 return SurfaceType(getChild(1));
122 }
128 {
129 return SpeedLimit(getChild(3));
130 }
131
132 static constexpr const char* TypeName() { return "street_info"; }
133 };
134}
t_type getProperty(DesignProperty property) const
Definition DesignObject.h:263
void setProperty(DesignProperty property, const t_type &value)
Definition DesignObject.h:184
@ e_uncompressed_data
Definition DesignObject.h:128
Definition Model.h:54
void createChildren(uint04 child_size)
Definition Model.cpp:2995
Model getChild(uint04 child) const
Definition Model.cpp:2389
void setModelProperty(ModelProperty property, const t_type &value)
Definition Model.h:137
bool isOfType(const String &type) const
Definition Model.cpp:3075
@ e_type
Definition Model.h:100
Definition StreetInfo.h:79
String get() const
Definition StreetInfo.h:94
static constexpr const char * ValidRegex()
Definition StreetInfo.h:98
void set(const String &speed_limit)
Definition StreetInfo.h:90
SpeedLimit(const Model &model)
Definition StreetInfo.h:81
static constexpr const char * TypeName()
Definition StreetInfo.h:99
Definition StreetInfo.h:103
StreetName streetName()
Definition StreetInfo.h:115
StreetInfo(const Model &model)
Definition StreetInfo.h:105
SpeedLimit speedLimit()
Definition StreetInfo.h:127
SurfaceType surfaceType()
Definition StreetInfo.h:119
SurfaceCondition surfaceCondition()
Definition StreetInfo.h:123
static constexpr const char * TypeName()
Definition StreetInfo.h:132
Definition StreetInfo.h:6
void set(const String &type)
Definition StreetInfo.h:18
StreetName(const Model &model)
Definition StreetInfo.h:8
String get() const
Definition StreetInfo.h:22
static constexpr const char * ValidRegex()
Definition StreetInfo.h:26
static constexpr const char * TypeName()
Definition StreetInfo.h:27
Definition String.h:40
Definition StreetInfo.h:54
void set(const String &condition)
Definition StreetInfo.h:66
SurfaceCondition(const Model &model)
Definition StreetInfo.h:56
String get() const
Definition StreetInfo.h:70
static constexpr const char * ValidRegex()
Definition StreetInfo.h:74
static constexpr const char * TypeName()
Definition StreetInfo.h:75
Definition StreetInfo.h:30
void set(const String &type)
Definition StreetInfo.h:42
String get() const
Definition StreetInfo.h:46
SurfaceType(const Model &model)
Definition StreetInfo.h:32
static constexpr const char * ValidRegex()
Definition StreetInfo.h:50
static constexpr const char * TypeName()
Definition StreetInfo.h:51
Definition ACIColor.h:37