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
18namespace odil
19{
20
25{
26public:
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
101private:
102 void _from_string(std::string const & string);
103};
104
106ODIL_API std::ostream & operator<<(std::ostream & stream, Tag const & tag);
107
108}
109
110#endif // _5faf4691_e936_476e_8ad3_40f36a167a74
A DICOM element tag.
Definition: Tag.h:25
Tag(uint32_t tag=0)
Create a tag based on its group and element as one 32-bits word.
uint16_t element
Element of the tag.
Definition: Tag.h:67
bool operator<=(Tag const &other) const
Loose inferiority test.
bool operator<(Tag const &other) const
Strict inferiority test.
bool operator>=(Tag const &other) const
Loose superiority test.
Tag(std::string const &string)
Create a tag based on its name or string representation of its numeric value.
std::string get_name() const
Return the name of the tag.
Tag(uint16_t group, uint16_t element)
Create a tag based on its group and element as two 16-bits words.
uint16_t group
Group of the tag.
Definition: Tag.h:64
bool operator==(Tag const &other) const
Equality test.
bool operator>(Tag const &other) const
Strict superiority test.
Tag(char const *string)
Create a tag based on its name or string representation of its numeric value.
bool is_private() const
Test whether the tag is private.
bool operator!=(Tag const &other) const
Difference test.
Tag & operator=(Tag &&)=default
~Tag()=default
Tag(Tag const &)=default
Tag & operator=(Tag const &)=default
Tag(Tag &&)=default
Definition: Association.h:25
std::ostream & operator<<(std::ostream &stream, Tag const &tag)
Stream inserter.
#define ODIL_API
Definition: odil.h:28