Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
b6d0579e
Commit
b6d0579e
authored
Jul 08, 2020
by
Gauthier Quesnel
Browse files
core: remove value-type in message
parent
5e545d72
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
app/gui/node-editor.cpp
View file @
b6d0579e
...
...
@@ -162,7 +162,7 @@ observation_output_observe(const irt::observer& obs,
return
;
auto
*
output
=
reinterpret_cast
<
observation_output
*>
(
obs
.
user_data
);
const
auto
value
=
static_cast
<
float
>
(
msg
.
cast_to_real_64
(
0
)
);
const
auto
value
=
static_cast
<
float
>
(
msg
[
0
]
);
if
(
match
(
output
->
observation_type
,
observation_output
::
type
::
multiplot
,
...
...
lib/benchmark/benchmark2.cpp
View file @
b6d0579e
...
...
@@ -51,7 +51,7 @@ file_output_observe(const irt::observer& obs,
return
;
auto
*
output
=
reinterpret_cast
<
file_output
*>
(
obs
.
user_data
);
fmt
::
print
(
output
->
os
,
"{},{}
\n
"
,
t
,
msg
.
to_
real
_64
(
0
)
);
fmt
::
print
(
output
->
os
,
"{},{}
\n
"
,
t
,
msg
.
real
[
0
]
);
}
...
...
lib/include/irritator/core.hpp
View file @
b6d0579e
This diff is collapsed.
Click to expand it.
lib/test/public-api.cpp
View file @
b6d0579e
...
...
@@ -45,7 +45,7 @@ file_output_observe(const irt::observer& obs,
return
;
auto
*
output
=
reinterpret_cast
<
file_output
*>
(
obs
.
user_data
);
fmt
::
print
(
output
->
os
,
"{},{}
\n
"
,
t
,
msg
.
to_
real
_64
(
0
)
);
fmt
::
print
(
output
->
os
,
"{},{}
\n
"
,
t
,
msg
.
real
[
0
]
);
}
int
...
...
@@ -524,45 +524,32 @@ main()
"message"
_test
=
[]
{
{
irt
::
message
v8
(
irt
::
i8
(
0
),
irt
::
i8
(
1
),
irt
::
i8
(
2
),
irt
::
i8
(
3
));
expect
(
v8
.
to_integer_8
(
0
)
==
0
);
expect
(
v8
.
to_integer_8
(
1
)
==
1
);
expect
(
v8
.
to_integer_8
(
2
)
==
2
);
expect
(
v8
.
to_integer_8
(
3
)
==
3
);
expect
(
v8
.
size
()
==
4
_ul
);
}
{
irt
::
message
v32
(
0
,
1
,
2
,
3
);
expect
(
v32
.
to_integer_32
(
0
)
==
0
);
expect
(
v32
.
to_integer_32
(
1
)
==
1
);
expect
(
v32
.
to_integer_32
(
2
)
==
2
);
expect
(
v32
.
to_integer_32
(
3
)
==
3
);
expect
(
v32
.
size
()
==
4
_ul
);
irt
::
message
vdouble
;
expect
(
vdouble
.
real
[
0
]
==
0.0
);
expect
(
vdouble
.
real
[
1
]
==
0.0
);
expect
(
vdouble
.
real
[
2
]
==
0.0
);
expect
(
vdouble
.
size
()
==
0
_ul
);
}
{
irt
::
message
v64
(
irt
::
i64
(
0
),
irt
::
i64
(
1
),
irt
::
i64
(
2
),
irt
::
i64
(
3
));
expect
(
v64
.
to_integer_64
(
0
)
==
0
);
expect
(
v64
.
to_integer_64
(
1
)
==
1
);
expect
(
v64
.
to_integer_64
(
2
)
==
2
);
expect
(
v64
.
to_integer_64
(
3
)
==
3
);
expect
(
v64
.
size
()
==
4
_ul
);
irt
::
message
vdouble
(
1.0
);
expect
(
vdouble
[
0
]
==
1.0
);
expect
(
vdouble
.
size
()
==
1
_ul
);
}
{
irt
::
message
vfloat
(
0.0
f
,
1.0
f
,
2.0
f
,
3.0
f
);
expect
(
vfloat
.
to_real_32
(
0
)
==
0.0
_f
);
expect
(
vfloat
.
to_real_32
(
1
)
==
1.0
_f
);
expect
(
vfloat
.
to_real_32
(
2
)
==
2.0
_f
);
expect
(
vfloat
.
to_real_32
(
3
)
==
3.0
_f
);
expect
(
vfloat
.
size
()
==
4
_ul
);
irt
::
message
vdouble
(
0.0
,
1.0
);
expect
(
vdouble
[
0
]
==
0.0
);
expect
(
vdouble
[
1
]
==
1.0
);
expect
(
vdouble
.
size
()
==
2
_ul
);
}
{
irt
::
message
vdouble
(
0.0
,
1.0
,
2.0
,
3.0
);
expect
(
vdouble
.
to_real_64
(
0
)
==
0.0
);
expect
(
vdouble
.
to_real_64
(
1
)
==
1.0
);
expect
(
vdouble
.
to_real_64
(
2
)
==
2.0
);
expect
(
vdouble
.
to_real_64
(
3
)
==
3.0
);
expect
(
vdouble
.
size
()
==
4
_ul
);
irt
::
message
vdouble
(
1.0
,
2.0
,
3.0
);
expect
(
vdouble
[
0
]
==
1.0
);
expect
(
vdouble
[
1
]
==
2.0
);
expect
(
vdouble
[
2
]
==
3.0
);
expect
(
vdouble
.
size
()
==
3
_ul
);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment