GDCM 3.0.24
gdcmTable.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMTABLE_H
15#define GDCMTABLE_H
16
17#include "gdcmTableEntry.h"
18#include "gdcmTag.h"
19
20#include <map>
21
22namespace gdcm
23{
24
28class Table
29{
30public:
31 typedef std::map<Tag, TableEntry> MapTableEntry;
32 Table() = default;
33 ~Table() = default;
34 Table &operator=(const Table &_val) = delete;
35 Table(const Table&_val) = delete;
36
37 friend std::ostream& operator<<(std::ostream& _os, const Table &_val);
38
39 void InsertEntry(Tag const &tag, TableEntry const &te)
40 {
41#ifndef NDEBUG
42 MapTableEntry::size_type s = TableInternal.size();
43#endif
44 TableInternal.insert(
45 MapTableEntry::value_type(tag, te));
46 assert( s < TableInternal.size() );
47 }
48
49 const TableEntry &GetTableEntry(const Tag &tag) const
50 {
51 MapTableEntry::const_iterator it =
52 TableInternal.find(tag);
53 if (it == TableInternal.end())
54 {
55 assert( 0 && "Impossible" );
56 return GetTableEntry(Tag(0,0));
57 }
58 return it->second;
59 }
60
62};
63
64} // end namespace gdcm
65
66#endif //GDCMTABLE_H
TableEntry.
Definition gdcmTableEntry.h:28
Table.
Definition gdcmTable.h:29
~Table()=default
void InsertEntry(Tag const &tag, TableEntry const &te)
Definition gdcmTable.h:39
Table & operator=(const Table &_val)=delete
Table()=default
const TableEntry & GetTableEntry(const Tag &tag) const
Definition gdcmTable.h:49
Table(const Table &_val)=delete
friend std::ostream & operator<<(std::ostream &_os, const Table &_val)
std::map< Tag, TableEntry > MapTableEntry
Definition gdcmTable.h:31
MapTableEntry TableInternal
Definition gdcmTable.h:61
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
Definition gdcmASN1.h:21