1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum ScalarType {
Char,
UChar,
Short,
UShort,
Int,
UInt,
Float,
Double,
}
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum PropertyType {
Scalar(ScalarType),
List(ScalarType, ScalarType)
}
#[derive(Debug, PartialEq, Clone)]
pub enum Property {
Char(i8),
UChar(u8),
Short(i16),
UShort(u16),
Int(i32),
UInt(u32),
Float(f32),
Double(f64),
ListChar(Vec<i8>),
ListUChar(Vec<u8>),
ListShort(Vec<i16>),
ListUShort(Vec<u16>),
ListInt(Vec<i32>),
ListUInt(Vec<u32>),
ListFloat(Vec<f32>),
ListDouble(Vec<f64>),
}
pub trait PropertyAccess {
fn new() -> Self;
fn set_property(&mut self, _property_name: String, _property: Property) {
}
fn get_char(&self, _property_name: &String) -> Option<i8> {
None
}
fn get_uchar(&self, _property_name: &String) -> Option<u8> {
None
}
fn get_short(&self, _property_name: &String) -> Option<i16> {
None
}
fn get_ushort(&self, _property_name: &String) -> Option<u16> {
None
}
fn get_int(&self, _property_name: &String) -> Option<i32> {
None
}
fn get_uint(&self, _property_name: &String) -> Option<u32> {
None
}
fn get_float(&self, _property_name: &String) -> Option<f32> {
None
}
fn get_double(&self, _property_name: &String) -> Option<f64> {
None
}
fn get_list_char(&self, _property_name: &String) -> Option<&[i8]> {
None
}
fn get_list_uchar(&self, _property_name: &String) -> Option<&[u8]> {
None
}
fn get_list_short(&self, _property_name: &String) -> Option<&[i16]> {
None
}
fn get_list_ushort(&self, _property_name: &String) -> Option<&[u16]> {
None
}
fn get_list_int(&self, _property_name: &String) -> Option<&[i32]> {
None
}
fn get_list_uint(&self, _property_name: &String) -> Option<&[u32]> {
None
}
fn get_list_float(&self, _property_name: &String) -> Option<&[f32]> {
None
}
fn get_list_double(&self, _property_name: &String) -> Option<&[f64]> {
None
}
}