MeVisLabToolboxReference
MeVis/Foundation/Sources/DicomTree/MLDicomTree/DCMTree_TagInfo.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // **InsertLicense** code
00003 //-----------------------------------------------------------------------------
00005 
00010 //-----------------------------------------------------------------------------
00011 
00012 #ifndef CLASS_DCMTREE_TAGINFO
00013 #define CLASS_DCMTREE_TAGINFO
00014 
00015 #include <istream>
00016 #include <ostream>
00017 
00018 #include <string>
00019 
00020 #include "DCMTree_Lib.h"
00021 #include "DCMTree_Defines.h"
00022 #include "DCMTree_TagId.h"
00023 #include "DCMTree_Dict.h"
00024 
00025 #ifdef _MSC_VER
00026   #pragma warning (push)
00027   #pragma warning (disable : 4251)
00028 #endif
00029 
00030 namespace DCMTree
00031 {
00033   class DCMTREE_EXPORT TagInfo:public DCMTree_Serialization::Serializable,public DCMTree_Serialization::Deserializable
00034   {
00035   public:
00037     TagInfo();
00038 
00042     TagInfo (const TagId &tagid, const Dict& dictionary);
00043 
00047     TagInfo (const TagId &tagid,const Vr &vr,const TagValueMultiplicity &multiplicity);
00048 
00050     TagInfo (const TagInfo &other);
00051 
00053     ~TagInfo();
00054 
00060     TagInfo &operator=(const TagInfo &other);
00061 
00065     const TagId &id() const;
00066 
00070     const Vr &vr() const;
00071 
00076     bool isCodedString() const;
00077 
00081     const TagValueMultiplicity &multiplicity() const;
00082 
00086     void setId (const TagId &tagid);
00087 
00091     void setVr (const Vr &vr);
00092 
00096     void setMultiplicity (const TagValueMultiplicity &multiplicity);
00097 
00103     void fromStream (std::istream &in, bool readName);
00104 
00110     void toStream (std::ostream &out, bool writeName) const;
00111 
00112     virtual void serializeX (DCMTree_Serialization::Sink &sink) const;
00113     virtual void deserializeX (DCMTree_Serialization::Source &source);
00114 
00115   private:
00116     TagId _id;
00117     Vr _vr;
00118     TagValueMultiplicity _multiplicity;
00119   };
00120 
00121   inline std::ostream &operator << (std::ostream &out,const TagInfo &t)
00122   {
00123     t.toStream (out, false);
00124     return out;
00125   }
00126 
00127   inline std::istream &operator >> (std::istream &in,TagInfo &t)
00128   {
00129     t.fromStream (in, false);
00130     return in;
00131   }
00132 }
00133 
00134 #ifdef _MSC_VER
00135   #pragma warning (pop)
00136 #endif
00137 
00138 #endif
00139 
00140