00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #ifndef _GDCMVR_H_
00020 #define _GDCMVR_H_
00021 
00022 #include "gdcmRefCounter.h"
00023 #include "gdcmVRKey.h"
00024 
00025 #include <map>
00026 #include <string>
00027 #include <iostream>
00028 
00029 namespace GDCM_NAME_SPACE 
00030 {
00031 
00032 
00033 typedef std::string VRAtr;
00035 typedef std::map<VRKey, VRAtr> VRHT;
00036 
00037 
00042 class GDCM_EXPORT VR : public RefCounter
00043 {
00044    gdcmTypeMacro(VR);
00045 
00046 public:
00047    static VR *New() {return new VR();}
00048 
00049    virtual void Print(std::ostream &os = std::cout, 
00050                       std::string const & = "" );
00051 
00053    int Count(VRKey const &key) { return vr.count(key); };
00054 
00055    bool IsVROfBinaryRepresentable(VRKey const &tested);
00056    bool IsVROfStringRepresentable(VRKey const &tested);
00057 
00060    bool IsVROfSequence(VRKey const &tested) { return tested == "SQ"; }
00061 
00062 
00063 #if defined(_MSC_VER) && (_MSC_VER == 1200)
00064    bool IsValidVR(VRKey const &key);
00065 #else
00066 
00067    bool IsValidVR(VRKey const &key) { return vr.find(key) != vr.end(); }
00068 #endif
00069 
00070    unsigned short GetAtomicElementLength(VRKey const &tested);
00071 
00072 protected:
00073    VR();
00074    ~VR();
00075 
00076 private:
00077    VRHT vr;
00078 };
00079 } 
00080 
00081 
00082 #endif