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 <cstdint>
13#include <cstddef>
14#include <ostream>
15#include <string>
16
17#include "odil/odil.h"
18
19namespace odil
20{
21
26{
27public:
29 Tag(uint16_t group, uint16_t element);
30
32 Tag(uint32_t tag=0);
33
42 Tag(std::string const & string);
43
52 Tag(char const * string);
53
57 ~Tag() =default;
58 Tag(Tag const &) =default;
59 Tag(Tag &&) =default;
60 Tag & operator=(Tag const &) =default;
61 Tag & operator=(Tag &&) =default;
63
65 uint16_t group;
66
68 uint16_t element;
69
71 bool is_private() const;
72
79 std::string get_name() const;
80
82 bool operator==(Tag const & other) const;
83
85 bool operator!=(Tag const & other) const;
86
88 bool operator<(Tag const & other) const;
89
91 bool operator>(Tag const & other) const;
92
94 bool operator<=(Tag const & other) const;
95
97 bool operator>=(Tag const & other) const;
98
100 operator std::string() const;
101
102private:
103 void _from_string(std::string const & string);
104};
105
107ODIL_API std::ostream & operator<<(std::ostream & stream, Tag const & tag);
108
109}
110
111#endif // _5faf4691_e936_476e_8ad3_40f36a167a74
A DICOM element tag.
Definition: Tag.h:26
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:68
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:65
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