MeVisLab Toolbox Reference
DCMTree_TagInfo.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef DCM_TREE_TAG_INFO_H
14#define DCM_TREE_TAG_INFO_H
15
16#ifdef _MSC_VER
17 #pragma warning (push)
18 #pragma warning (disable : 4251 4350)
19#endif
20
21#include <istream>
22#include <ostream>
23
24#include <string>
25
26#include "DCMTree_Lib.h"
27#include "DCMTree_Defines.h"
28#include "DCMTree_TagId.h"
29#include "DCMTree_Dict.h"
30
31namespace DCMTree
32{
35 {
36 public:
39
43 TagInfo (const TagId &tagid, const Dict& dictionary);
44
48 TagInfo (const TagId &tagid,const Vr &vr,const TagValueMultiplicity &multiplicity);
49
51 TagInfo (const TagInfo &other);
52
54 ~TagInfo() override;
55
61 TagInfo &operator=(const TagInfo &other);
62
66 const TagId &id() const;
67
71 const Vr &vr() const;
72
77 bool isCodedString() const;
78
83
87 void setId (const TagId &tagid);
88
92 void setVr (const Vr &vr);
93
98
105 void fromStream (std::istream &in, bool readName, size_t maxSize = 0);
106
112 void toStream (std::ostream &out, bool writeName) const;
113
114 void serializeX (DCMTree_Serialization::Sink &sink) const override;
116
117 private:
118 TagId _id;
119 Vr _vr;
120 TagValueMultiplicity _multiplicity;
121 };
122
123 inline std::ostream &operator << (std::ostream &out,const TagInfo &t)
124 {
125 t.toStream (out, false);
126 return out;
127 }
128
129 inline std::istream &operator >> (std::istream &in,TagInfo &t)
130 {
131 t.fromStream (in, false);
132 return in;
133 }
134}
135
136#ifdef _MSC_VER
137 #pragma warning (pop)
138#endif
139
140#endif
141
142
#define DCMTREE_EXPORT
Class to wrap a tag ID.
Class to carry meta information about a specific tag.
const TagValueMultiplicity & multiplicity() const
Returns the multiplicity of this.
void deserializeX(DCMTree_Serialization::Source &source) override
Overwrites data of this object with data from source.
TagInfo & operator=(const TagInfo &other)
Assignment operator.
TagInfo(const TagId &tagid, const Vr &vr, const TagValueMultiplicity &multiplicity)
Creates a new instance that is initialized with the given values.
bool isCodedString() const
Checks whether the string encoding depends on the specific character set.
void fromStream(std::istream &in, bool readName, size_t maxSize=0)
Extracts this instance from the given stream.
void setMultiplicity(const TagValueMultiplicity &multiplicity)
Sets the multiplicity of this.
TagInfo(const TagId &tagid, const Dict &dictionary)
Creates a new instance.
void setId(const TagId &tagid)
Sets the TagId of this.
void toStream(std::ostream &out, bool writeName) const
Copies this instance recursively into the given stream.
~TagInfo() override
Destructor.
const Vr & vr() const
Returns the VR of this.
TagInfo()
Constructor.
TagInfo(const TagInfo &other)
Copy constructor.
void serializeX(DCMTree_Serialization::Sink &sink) const override
Writes data of this object to sink.
void setVr(const Vr &vr)
Sets the VR of this.
const TagId & id() const
Returns the TagId of this.
Interface that provides a method to deserialize an object.
Interface that provides a method to serialize an object.
Interface of a data sink for the serialization of objects.
Interface of a data source for the deserialization of objects.
Class to dump a DCMTree DICOM message into a human-readable file.
Vr
DICOM VR.
std::ostream & operator<<(std::ostream &out, const Message &m)
std::pair< unsigned, unsigned > TagValueMultiplicity
The multiplicity of a tag, first=min second=max.
std::istream & operator>>(std::istream &in, Message &m)