Closed janEbert closed 5 years ago
Thank you, I don't know how I missed them ;)
Why you did this to me? :( How could you?
http://build.ros.org/job/Ldev__ros_type_introspection__ubuntu_xenial_amd64/41/changes
Oh man, I am so sorry! :( I wrote this from a Windows machine on which I could not build.
Because it was so simple, I would not have imagined it would break the build. What could be the reason?
Ah I see, the types unsigned char
and uint8_t
point to the same type.
In that case, would it be better to remove the BYTE
type from BuiltinTypes
?
I'm not able to find a better solution. Or remove the BYTE
overload again in case other stuff depended on it (which sounds like a messy solution)?
Again, I am so sorry I killed the master of all things!
No problem, I was kidding, I will fix it later.
Cheers
Thanks, that's a bit reassuring, but, I still trashed your master... :)
Because I feel very bad, I did remove all occurrences of BYTE
in this commit.
Although I understand if you cannot trust me anymore. ☺️
Something I stumbled upon which might explain why you missed those values in the first place:
In the Wiki entry for messages in section 2.1.1 it says that both char
and byte
are deprecated already and were aliases for int8
and uint8
respectively.
In my opinion, this speaks for removal as those were aliases and do not make sense with the current implementation.
Some types are not supported for extraction.
BuiltinType
is missing twogetType()
functions, namely forBYTE
andCHAR
which currently resolve toOTHER
(as they are not overloaded like the other types) which prevents the correct type comparison inVariant::extract()
.This PR adds those overloads. However, some stuff might be debatable:
BYTE
usingunsigned char
. Another possibility is using the C++17std::byte
class which is not as backwards compatible but semantically nicer.CHAR
is overloaded usingchar
. This makes semantic sense but has one quirk:char
can be asigned char
orunsigned char
(the same type asBYTE
, although distinct in the sense that it does not break the template). I cannot think of when it could be problematic but there may be cases.