Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef GDCMTABLE_H
00015 #define GDCMTABLE_H
00016
00017 #include "gdcmTableEntry.h"
00018 #include "gdcmTag.h"
00019
00020 #include <map>
00021
00022 namespace gdcm
00023 {
00024
00028 class Table
00029 {
00030 public:
00031 typedef std::map<Tag, TableEntry> MapTableEntry;
00032 Table() {}
00033 ~Table() {}
00034
00035 friend std::ostream& operator<<(std::ostream& _os, const Table &_val);
00036
00037 void InsertEntry(Tag const &tag, TableEntry const &te)
00038 {
00039 #ifndef NDEBUG
00040 MapTableEntry::size_type s = TableInternal.size();
00041 #endif
00042 TableInternal.insert(
00043 MapTableEntry::value_type(tag, te));
00044 assert( s < TableInternal.size() );
00045 }
00046
00047 const TableEntry &GetTableEntry(const Tag &tag) const
00048 {
00049 MapTableEntry::const_iterator it =
00050 TableInternal.find(tag);
00051 if (it == TableInternal.end())
00052 {
00053 assert( 0 && "Impossible" );
00054 return GetTableEntry(Tag(0,0));
00055 }
00056 return it->second;
00057 }
00058
00059 private:
00060 Table &operator=(const Table &_val);
00061 Table(const Table&_val);
00062
00063 MapTableEntry TableInternal;
00064 };
00065
00066 }
00067
00068 #endif //GDCMTABLE_H