File: registry_group.cpp.tmpl

package info (click to toggle)
odil 0.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 5,092 kB
  • sloc: cpp: 54,080; python: 3,896; xml: 182; makefile: 94
file content (42 lines) | stat: -rw-r--r-- 1,223 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*************************************************************************
 * odil - Copyright (C) Universite de Strasbourg
 * Distributed under the terms of the CeCILL-B license, as published by
 * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 * for details.
 ************************************************************************/

#include <map>
#include <string>
#include <tuple>

#include "odil/ElementsDictionary.h"
#include "odil/Tag.h"

namespace odil
{

namespace registry
{

void update_{{ group }}(
    ElementsDictionary & public_dictionary,
    std::map<std::string, odil::Tag> & public_tags)
{

{% for entry in elements_dictionary %}
    public_dictionary.emplace({%
            if entry[0] is string
        %}std::string("{{ entry[0] }}"){%
            else %}Tag({{ "0x%04x, 0x%04x"|format(*entry[0]) }}){%
            endif %}, ElementsDictionaryEntry("{{ entry[1] }}", "{{ entry[2] }}",  "{{ entry[3] }}", "{{ entry[4] }}"));
{% endfor %}

{% for entry in elements_dictionary %}{% if not entry[0] is string %}
    public_tags.emplace("{{ entry[2] }}", Tag({{ "0x%04x, 0x%04x"|format(*entry[0]) }}));
{% endif %}{% endfor %}
}

}

}