odil
C++11libraryfortheDICOMstandard
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=0);
30 
39  Tag(std::string const & string);
40 
49  Tag(char const * string);
50 
52  uint16_t group;
53 
55  uint16_t element;
56 
58  bool is_private() const;
59 
66  std::string get_name() const;
67 
69  bool operator==(Tag const & other) const;
70 
72  bool operator!=(Tag const & other) const;
73 
75  bool operator<(Tag const & other) const;
76 
78  bool operator>(Tag const & other) const;
79 
81  bool operator<=(Tag const & other) const;
82 
84  bool operator>=(Tag const & other) const;
85 
87  operator std::string() const;
88 
89 private:
90  void _from_string(std::string const & string);
91 };
92 
94 std::ostream & operator<<(std::ostream & stream, Tag const & tag);
95 
96 }
97 
98 #endif // _5faf4691_e936_476e_8ad3_40f36a167a74
bool is_private() const
Test whether the tag is private.
Definition: Tag.cpp:53
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:60
Definition: Association.cpp:39
A DICOM element tag.
Definition: Tag.h:22
bool operator==(Tag const &other) const
Equality test.
Definition: Tag.cpp:81
bool operator>=(Tag const &other) const
Loose superiority test.
Definition: Tag.cpp:120
bool operator<(Tag const &other) const
Strict inferiority test.
Definition: Tag.cpp:95
bool operator<=(Tag const &other) const
Loose inferiority test.
Definition: Tag.cpp:113
bool operator!=(Tag const &other) const
Difference test.
Definition: Tag.cpp:88
bool operator>(Tag const &other) const
Strict superiority test.
Definition: Tag.cpp:104
Tag(uint16_t group, uint16_t element)
Create a tag based on its group and element as two 16-bits words.
Definition: Tag.cpp:26