odil
Tag.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 _5faf4691_e936_476e_8ad3_40f36a167a74
10 #define _5faf4691_e936_476e_8ad3_40f36a167a74
11 
12 #include <cstddef>
13 #include <ostream>
14 #include <string>
15 
16 namespace odil
17 {
18 
22 class Tag
23 {
24 public:
26  Tag(uint16_t group, uint16_t element);
27 
29  Tag(uint32_t tag);
30 
39  Tag(std::string const & name);
40 
49  Tag(char const * name);
50 
52  uint16_t group;
53 
55  uint16_t element;
56 
57  bool is_private() const;
58 
65  std::string get_name() const;
66 
68  bool operator==(Tag const & other) const;
69 
71  bool operator!=(Tag const & other) const;
72 
74  bool operator<(Tag const & other) const;
75 
77  bool operator>(Tag const & other) const;
78 
80  bool operator<=(Tag const & other) const;
81 
83  bool operator>=(Tag const & other) const;
84 
86  operator std::string() const;
87 
88 private:
89  void _from_string(std::string const & string);
90 };
91 
93 std::ostream & operator<<(std::ostream & stream, Tag const & tag);
94 
95 }
96 
97 #endif // _5faf4691_e936_476e_8ad3_40f36a167a74
uint16_t element
Element of the tag.
Definition: Tag.h:55
uint16_t group
Group of the tag.
Definition: Tag.h:52
std::string get_name() const
Return the name of the tag.
Definition: Tag.cpp:57
Definition: Association.cpp:39
A DICOM element tag.
Definition: Tag.h:22
bool operator==(Tag const &other) const
Equality test.
Definition: Tag.cpp:70
bool operator>=(Tag const &other) const
Loose superiority test.
Definition: Tag.cpp:109
bool operator<(Tag const &other) const
Strict inferiority test.
Definition: Tag.cpp:84
bool operator<=(Tag const &other) const
Loose inferiority test.
Definition: Tag.cpp:102
bool operator!=(Tag const &other) const
Difference test.
Definition: Tag.cpp:77
bool operator>(Tag const &other) const
Strict superiority test.
Definition: Tag.cpp:93
Tag(uint16_t group, uint16_t element)
Create a tag based on its group and element as two 16-bits words.
Definition: Tag.cpp:23