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