-
Notifications
You must be signed in to change notification settings - Fork 21
/
registry.cpp.tmpl
59 lines (46 loc) · 1.6 KB
/
registry.cpp.tmpl
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);