forked from Archive/PX4-Autopilot
ucdr/msg.h.em: static inline the (de-)serialization methods
to avoid multiple definitions when using them from different places.
This commit is contained in:
parent
2f91102808
commit
f513c40d62
|
@ -124,7 +124,7 @@ static inline constexpr int ucdr_topic_size_@(topic)()
|
||||||
return @(struct_size);
|
return @(struct_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ucdr_serialize_@(topic)(const void* data, ucdrBuffer& buf, int64_t time_offset = 0)
|
static inline bool ucdr_serialize_@(topic)(const void* data, ucdrBuffer& buf, int64_t time_offset = 0)
|
||||||
{
|
{
|
||||||
const @(uorb_struct)& topic = *static_cast<const @(uorb_struct)*>(data);
|
const @(uorb_struct)& topic = *static_cast<const @(uorb_struct)*>(data);
|
||||||
@{
|
@{
|
||||||
|
@ -153,7 +153,7 @@ for field_type, field_name, field_size, padding in fields:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ucdr_deserialize_@(topic)(ucdrBuffer& buf, @(uorb_struct)& topic, int64_t time_offset = 0)
|
static inline bool ucdr_deserialize_@(topic)(ucdrBuffer& buf, @(uorb_struct)& topic, int64_t time_offset = 0)
|
||||||
{
|
{
|
||||||
@{
|
@{
|
||||||
for field_type, field_name, field_size, padding in fields:
|
for field_type, field_name, field_size, padding in fields:
|
||||||
|
|
Loading…
Reference in New Issue