2 Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved
4 This file is part of Embedded Proto.
6 Embedded Proto is open source software: you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as published
8 by the Free Software Foundation, version 3 of the license.
10 Embedded Proto is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License
for more details.
15 You should have received a copy of the GNU General Public License
16 along with Embedded Proto. If
not, see <https:
18 For commercial and closed source application please visit:
26 Johan Huizingalaan 763a
30 {%
if field.oneof is
not none %}
31 inline void clear_{{field.get_name()}}()
33 if(
id::{{field.get_variable_id_name()}} == {{field.get_which_oneof()}})
35 {{field.get_which_oneof()}} = id::NOT_SET;
36 {{field.get_variable_name()}}.set({{field.get_default_value()}});
39 inline void set_{{field.get_name()}}(
const {{field.get_type()}}::FIELD_TYPE& value)
41 if(
id::{{field.get_variable_id_name()}} != {{field.get_which_oneof()}})
43 init_{{field.get_oneof_name()}}(id::{{field.get_variable_id_name()}});
45 {{field.get_variable_name()}}.set(value);
47 inline void set_{{field.get_name()}}(
const {{field.get_type()}}::FIELD_TYPE&& value)
49 if(
id::{{field.get_variable_id_name()}} != {{field.get_which_oneof()}})
51 init_{{field.get_oneof_name()}}(id::{{field.get_variable_id_name()}});
53 {{field.get_variable_name()}}.set(value);
56 inline void clear_{{field.get_name()}}() { {{field.get_variable_name()}}.clear(); }
57 inline void set_{{field.get_name()}}(
const {{field.get_type()}}& value) { {{field.get_variable_name()}} = value; }
58 inline void set_{{field.get_name()}}(
const {{field.get_type()}}&& value) { {{field.get_variable_name()}} = value; }
59 inline {{field.get_type()}}& mutable_{{field.get_name()}}() {
return {{field.get_variable_name()}}; }
61 inline const {{field.get_type()}}& get_{{field.get_name()}}()
const {
return {{field.get_variable_name()}}; }
62 inline {{field.get_type()}}::FIELD_TYPE {{field.get_name()}}()
const {
return {{field.get_variable_name()}}.get(); }