Odil
A C++11 library for the DICOM standard
Tag.h
Go to the documentation of this file.
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 #include "odil/odil.h"
17 
18 namespace odil
19 {
20 
25 {
26 public:
28  Tag(uint16_t group, uint16_t element);
29 
31  Tag(uint32_t tag=0);
32 
41  Tag(std::string const & string);
42 
51  Tag(char const * string);
52 
56  ~Tag() =default;
57  Tag(Tag const &) =default;
58  Tag(Tag &&) =default;
59  Tag & operator=(Tag const &) =default;
60  Tag & operator=(Tag &&) =default;
62 
64  uint16_t group;
65 
67  uint16_t element;
68 
70  bool is_private() const;
71 
78  std::string get_name() const;
79 
81  bool operator==(Tag const & other) const;
82 
84  bool operator!=(Tag const & other) const;
85 
87  bool operator<(Tag const & other) const;
88 
90  bool operator>(Tag const & other) const;
91 
93  bool operator<=(Tag const & other) const;
94 
96  bool operator>=(Tag const & other) const;
97 
99  operator std::string() const;
100 
101 private:
102  void _from_string(std::string const & string);
103 };
104 
106 ODIL_API std::ostream & operator<<(std::ostream & stream, Tag const & tag);
107 
108 }
109 
110 #endif // _5faf4691_e936_476e_8ad3_40f36a167a74
odil::Tag::operator==
bool operator==(Tag const &other) const
Equality test.
odil::Tag::Tag
Tag(std::string const &string)
Create a tag based on its name or string representation of its numeric value.
odil::Tag::group
uint16_t group
Group of the tag.
Definition: Tag.h:64
odil::Tag::operator=
Tag & operator=(Tag const &)=default
odil::Tag::~Tag
~Tag()=default
odil
Definition: Association.h:25
ODIL_API
#define ODIL_API
Definition: odil.h:28
odil::Tag::Tag
Tag(uint32_t tag=0)
Create a tag based on its group and element as one 32-bits word.
odil::Tag::Tag
Tag(uint16_t group, uint16_t element)
Create a tag based on its group and element as two 16-bits words.
odil::Tag::operator>
bool operator>(Tag const &other) const
Strict superiority test.
odil::Tag
A DICOM element tag.
Definition: Tag.h:25
odil.h
odil::Tag::operator<
bool operator<(Tag const &other) const
Strict inferiority test.
odil::Tag::get_name
std::string get_name() const
Return the name of the tag.
odil::Tag::operator>=
bool operator>=(Tag const &other) const
Loose superiority test.
odil::Tag::is_private
bool is_private() const
Test whether the tag is private.
odil::Tag::element
uint16_t element
Element of the tag.
Definition: Tag.h:67
odil::Tag::Tag
Tag(char const *string)
Create a tag based on its name or string representation of its numeric value.
odil::operator<<
std::ostream & operator<<(std::ostream &stream, Tag const &tag)
Stream inserter.
odil::Tag::operator=
Tag & operator=(Tag &&)=default
odil::Tag::operator<=
bool operator<=(Tag const &other) const
Loose inferiority test.
odil::Tag::Tag
Tag(Tag const &)=default
odil::Tag::operator!=
bool operator!=(Tag const &other) const
Difference test.
odil::Tag::Tag
Tag(Tag &&)=default