odil
C++11libraryfortheDICOMstandard
ElementsDictionary.h
1 /*************************************************************************
2  * odil - Copyright (C) Universite de Strasbourg
3  * Distributed under the terms of the CeCILL-B license, as published by
4  * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5  * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6  * for details.
7  ************************************************************************/
8 
9 #ifndef _f4b88e07_d515_41be_ad1b_37899ec6451e
10 #define _f4b88e07_d515_41be_ad1b_37899ec6451e
11 
12 #include <map>
13 #include <string>
14 
15 #include <odil/Tag.h>
16 
17 namespace odil
18 {
19 
22  {
23  public:
25  enum class Type
26  {
27  Tag,
28  String,
29  None
30  };
31 
34 
36  ElementsDictionaryKey(Tag const & value);
37 
39  ElementsDictionaryKey(std::string const & value);
40 
42  Type const & get_type() const;
43 
45  Tag const & get_tag() const;
46 
48  std::string const & get_string() const;
49 
51  void set(Tag const value);
52 
54  void set(std::string const & value);
55 
57  bool operator<(ElementsDictionaryKey const & other) const;
58 
60  bool operator==(ElementsDictionaryKey const & other) const;
61 
62  private:
63  Type _type;
64  Tag _tag;
65  std::string _string;
66  };
67 
72 {
74  std::string name;
75 
77  std::string keyword;
78 
80  std::string vr;
81 
83  std::string vm;
84 
87  std::string const & name="", std::string const & keyword="",
88  std::string const & vr="", std::string const & vm="");
89 };
90 
91 typedef
92  std::map<ElementsDictionaryKey, ElementsDictionaryEntry> ElementsDictionary;
93 
94 ElementsDictionary::const_iterator
95 find(ElementsDictionary const & dictionary, Tag const & tag);
96 
97 }
98 
99 #endif // _f4b88e07_d515_41be_ad1b_37899ec6451e
Tag const & get_tag() const
Return the tag value or raise an exception if type is not Tag.
Definition: ElementsDictionary.cpp:46
std::string keyword
Brief name.
Definition: ElementsDictionary.h:77
Definition: Association.cpp:39
A DICOM element tag.
Definition: Tag.h:22
Type const & get_type() const
Return the type.
Definition: ElementsDictionary.cpp:39
ElementsDictionaryKey()
Create a key with type equal to None.
Definition: ElementsDictionary.cpp:19
std::string vm
Multiplicity.
Definition: ElementsDictionary.h:83
Type
Type of the key.
Definition: ElementsDictionary.h:25
std::string vr
Type.
Definition: ElementsDictionary.h:80
bool operator==(ElementsDictionaryKey const &other) const
Comparator.
Definition: ElementsDictionary.cpp:108
std::string name
Full name.
Definition: ElementsDictionary.h:74
std::string const & get_string() const
Return the string value or raise an exception if type is not String.
Definition: ElementsDictionary.cpp:57
bool operator<(ElementsDictionaryKey const &other) const
Comparator.
Definition: ElementsDictionary.cpp:84
Key of a dictionary of DICOM elements.
Definition: ElementsDictionary.h:21
Entry in a dictionary of DICOM elements.
Definition: ElementsDictionary.h:71