File: registry.cpp.tmpl

package info (click to toggle)
odil 0.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,212 kB
  • sloc: cpp: 54,791; python: 3,963; javascript: 464; xml: 182; makefile: 94
file content (59 lines) | stat: -rw-r--r-- 1,640 bytes parent folder | download | duplicates (5)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*************************************************************************
 * 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 "odil/registry.h"

#include <map>
#include <string>

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

namespace odil
{

namespace registry
{

{% for group in groups %}
void update_{{ group }}(ElementsDictionary &, std::map<std::string, odil::Tag> &);
{% endfor %}

void update_uids_dictionary(UIDsDictionary & uids_dictionary)
{
{% for entry in uids %}
    uids_dictionary.emplace("{{ entry[0] }}", UIDsDictionaryEntry("{{ entry[1] }}", "{{ entry[2] }}",  "{{ entry[3] }}"));
{% endfor %}
}

bool update(
    odil::ElementsDictionary & public_dictionary,
    std::map<std::string, odil::Tag> & public_tags,
    odil::UIDsDictionary & uids_dictionary)
{
{% for group in groups %}
    update_{{ group }}(public_dictionary, public_tags);
{% endfor %}

    update_uids_dictionary(uids_dictionary);

    return true;
}

}

}

odil::ElementsDictionary odil::registry::public_dictionary = {};
std::map<std::string, odil::Tag> odil::registry::public_tags = {};
odil::UIDsDictionary odil::registry::uids_dictionary = {};
bool const odil::registry::dummy = odil::registry::update(
    odil::registry::public_dictionary,
    odil::registry::public_tags,
    odil::registry::uids_dictionary);