GDCM 3.2.1

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
22 namespace gdcm
23{
24
28 class Table
29{
30 public:
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#ifndef NDEBUG
47 gdcm_assert( s < TableInternal.size() );
48#endif
49 }
50
51 const TableEntry &GetTableEntry(const Tag &tag) const
52 {
53 MapTableEntry::const_iterator it =
54 TableInternal.find(tag);
55 if (it == TableInternal.end())
56 {
57 gdcm_assert( 0 && "Impossible" );
58 return GetTableEntry(Tag(0,0));
59 }
60 return it->second;
61 }
62
63 MapTableEntry TableInternal;
64};
65
66} // end namespace gdcm
67
68#endif //GDCMTABLE_H
gdcm::TableEntry
TableEntry.
Definition gdcmTableEntry.h:28
gdcm::Table::~Table
~Table()=default
gdcm::Table::InsertEntry
void InsertEntry(Tag const &tag, TableEntry const &te)
Definition gdcmTable.h:39
gdcm::Table::operator=
Table & operator=(const Table &_val)=delete
gdcm::Table::Table
Table()=default
gdcm::Table::GetTableEntry
const TableEntry & GetTableEntry(const Tag &tag) const
Definition gdcmTable.h:51
gdcm::Table::Table
Table(const Table &_val)=delete
gdcm::Table::operator<<
friend std::ostream & operator<<(std::ostream &_os, const Table &_val)
gdcm::Table::MapTableEntry
std::map< Tag, TableEntry > MapTableEntry
Definition gdcmTable.h:31
gdcm::Table::TableInternal
MapTableEntry TableInternal
Definition gdcmTable.h:63
gdcm::Tag
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
gdcm_assert
#define gdcm_assert(cond)
Definition gdcmException.h:104
gdcmTableEntry.h
gdcmTag.h
gdcm
Definition gdcmASN1.h:21