utils: codegen: ipc: Remove namespace
argument
The `serializer()`, `deserializer_{fd,no_fd,simple}()` functions take a string argument named "namespace", but they do not use it. So remove the argument. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
This commit is contained in:
parent
d4ef160b1a
commit
0a1539a4f1
3 changed files with 17 additions and 17 deletions
|
@ -31,12 +31,12 @@ template<>
|
||||||
class IPADataSerializer<{{struct|name}}>
|
class IPADataSerializer<{{struct|name}}>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
{{- serializer.serializer(struct, "")}}
|
{{- serializer.serializer(struct)}}
|
||||||
{%- if struct|has_fd %}
|
{%- if struct|has_fd %}
|
||||||
{{serializer.deserializer_fd(struct, "")}}
|
{{serializer.deserializer_fd(struct)}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{{serializer.deserializer_no_fd(struct, "")}}
|
{{serializer.deserializer_no_fd(struct)}}
|
||||||
{{serializer.deserializer_fd_simple(struct, "")}}
|
{{serializer.deserializer_fd_simple(struct)}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
};
|
};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -32,12 +32,12 @@ template<>
|
||||||
class IPADataSerializer<{{struct|name_full}}>
|
class IPADataSerializer<{{struct|name_full}}>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
{{- serializer.serializer(struct, namespace_str)}}
|
{{- serializer.serializer(struct)}}
|
||||||
{%- if struct|has_fd %}
|
{%- if struct|has_fd %}
|
||||||
{{serializer.deserializer_fd(struct, namespace_str)}}
|
{{serializer.deserializer_fd(struct)}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{{serializer.deserializer_no_fd(struct, namespace_str)}}
|
{{serializer.deserializer_no_fd(struct)}}
|
||||||
{{serializer.deserializer_fd_simple(struct, namespace_str)}}
|
{{serializer.deserializer_fd_simple(struct)}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
};
|
};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#
|
#
|
||||||
# \todo Avoid intermediate vectors
|
# \todo Avoid intermediate vectors
|
||||||
#}
|
#}
|
||||||
{%- macro serializer_field(field, namespace, loop) %}
|
{%- macro serializer_field(field, loop) %}
|
||||||
{%- if field|is_pod or field|is_enum %}
|
{%- if field|is_pod or field|is_enum %}
|
||||||
std::vector<uint8_t> {{field.mojom_name}};
|
std::vector<uint8_t> {{field.mojom_name}};
|
||||||
std::tie({{field.mojom_name}}, std::ignore) =
|
std::tie({{field.mojom_name}}, std::ignore) =
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
# Generate code to deserialize \a field into object ret.
|
# Generate code to deserialize \a field into object ret.
|
||||||
# This code is meant to be used by the IPADataSerializer specialization.
|
# This code is meant to be used by the IPADataSerializer specialization.
|
||||||
#}
|
#}
|
||||||
{%- macro deserializer_field(field, namespace, loop) %}
|
{%- macro deserializer_field(field, loop) %}
|
||||||
{% if field|is_pod or field|is_enum %}
|
{% if field|is_pod or field|is_enum %}
|
||||||
{%- set field_size = (field|bit_width|int / 8)|int %}
|
{%- set field_size = (field|bit_width|int / 8)|int %}
|
||||||
{{- check_data_size(field_size, 'dataSize', field.mojom_name, 'data')}}
|
{{- check_data_size(field_size, 'dataSize', field.mojom_name, 'data')}}
|
||||||
|
@ -182,7 +182,7 @@
|
||||||
# Generate code for IPADataSerializer specialization, for serializing
|
# Generate code for IPADataSerializer specialization, for serializing
|
||||||
# \a struct.
|
# \a struct.
|
||||||
#}
|
#}
|
||||||
{%- macro serializer(struct, namespace) %}
|
{%- macro serializer(struct) %}
|
||||||
static std::tuple<std::vector<uint8_t>, std::vector<SharedFD>>
|
static std::tuple<std::vector<uint8_t>, std::vector<SharedFD>>
|
||||||
serialize(const {{struct|name_full}} &data,
|
serialize(const {{struct|name_full}} &data,
|
||||||
{%- if struct|needs_control_serializer %}
|
{%- if struct|needs_control_serializer %}
|
||||||
|
@ -196,7 +196,7 @@
|
||||||
std::vector<SharedFD> retFds;
|
std::vector<SharedFD> retFds;
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- for field in struct.fields %}
|
{%- for field in struct.fields %}
|
||||||
{{serializer_field(field, namespace, loop)}}
|
{{serializer_field(field, loop)}}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{% if struct|has_fd %}
|
{% if struct|has_fd %}
|
||||||
return {retData, retFds};
|
return {retData, retFds};
|
||||||
|
@ -213,7 +213,7 @@
|
||||||
# Generate code for IPADataSerializer specialization, for deserializing
|
# Generate code for IPADataSerializer specialization, for deserializing
|
||||||
# \a struct, in the case that \a struct has file descriptors.
|
# \a struct, in the case that \a struct has file descriptors.
|
||||||
#}
|
#}
|
||||||
{%- macro deserializer_fd(struct, namespace) %}
|
{%- macro deserializer_fd(struct) %}
|
||||||
static {{struct|name_full}}
|
static {{struct|name_full}}
|
||||||
deserialize(std::vector<uint8_t> &data,
|
deserialize(std::vector<uint8_t> &data,
|
||||||
std::vector<SharedFD> &fds,
|
std::vector<SharedFD> &fds,
|
||||||
|
@ -245,7 +245,7 @@
|
||||||
size_t dataSize = std::distance(dataBegin, dataEnd);
|
size_t dataSize = std::distance(dataBegin, dataEnd);
|
||||||
[[maybe_unused]] size_t fdsSize = std::distance(fdsBegin, fdsEnd);
|
[[maybe_unused]] size_t fdsSize = std::distance(fdsBegin, fdsEnd);
|
||||||
{%- for field in struct.fields -%}
|
{%- for field in struct.fields -%}
|
||||||
{{deserializer_field(field, namespace, loop)}}
|
{{deserializer_field(field, loop)}}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@
|
||||||
# \a struct, in the case that \a struct has no file descriptors but requires
|
# \a struct, in the case that \a struct has no file descriptors but requires
|
||||||
# deserializers with file descriptors.
|
# deserializers with file descriptors.
|
||||||
#}
|
#}
|
||||||
{%- macro deserializer_fd_simple(struct, namespace) %}
|
{%- macro deserializer_fd_simple(struct) %}
|
||||||
static {{struct|name_full}}
|
static {{struct|name_full}}
|
||||||
deserialize(std::vector<uint8_t> &data,
|
deserialize(std::vector<uint8_t> &data,
|
||||||
[[maybe_unused]] std::vector<SharedFD> &fds,
|
[[maybe_unused]] std::vector<SharedFD> &fds,
|
||||||
|
@ -285,7 +285,7 @@
|
||||||
# Generate code for IPADataSerializer specialization, for deserializing
|
# Generate code for IPADataSerializer specialization, for deserializing
|
||||||
# \a struct, in the case that \a struct does not have file descriptors.
|
# \a struct, in the case that \a struct does not have file descriptors.
|
||||||
#}
|
#}
|
||||||
{%- macro deserializer_no_fd(struct, namespace) %}
|
{%- macro deserializer_no_fd(struct) %}
|
||||||
static {{struct|name_full}}
|
static {{struct|name_full}}
|
||||||
deserialize(std::vector<uint8_t> &data,
|
deserialize(std::vector<uint8_t> &data,
|
||||||
{%- if struct|needs_control_serializer %}
|
{%- if struct|needs_control_serializer %}
|
||||||
|
@ -312,7 +312,7 @@
|
||||||
|
|
||||||
size_t dataSize = std::distance(dataBegin, dataEnd);
|
size_t dataSize = std::distance(dataBegin, dataEnd);
|
||||||
{%- for field in struct.fields -%}
|
{%- for field in struct.fields -%}
|
||||||
{{deserializer_field(field, namespace, loop)}}
|
{{deserializer_field(field, loop)}}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue