GDCM  2.4.5
gdcmIODs.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 GDCMIODS_H
15 #define GDCMIODS_H
16 
17 #include "gdcmTypes.h"
18 #include "gdcmIOD.h"
19 
20 #include <map>
21 
22 namespace gdcm
23 {
30 {
31 public:
32  typedef std::string IODName;
33  typedef std::map<IODName, IOD> IODMapType;
34 
35  IODs() {}
36  friend std::ostream& operator<<(std::ostream& _os, const IODs &_val);
37 
38  void Clear() { IODsInternal.clear(); }
39 
40  void AddIOD(const char *name , const IOD & module )
41  {
42  IODsInternal.insert(
43  IODMapType::value_type(name, module));
44  }
45  const IOD &GetIOD(const char *name) const
46  {
47  //return IODsInternal[name];
48  IODMapType::const_iterator it = IODsInternal.find( name );
49  assert( it != IODsInternal.end() );
50  assert( it->first == name );
51  return it->second;
52  }
53 
54  typedef IODMapType::const_iterator IODMapTypeConstIterator;
55  IODMapTypeConstIterator Begin() const { return IODsInternal.begin(); }
56  IODMapTypeConstIterator End() const { return IODsInternal.end(); }
57 
58 private:
59  IODMapType IODsInternal;
60 };
61 //-----------------------------------------------------------------------------
62 inline std::ostream& operator<<(std::ostream& _os, const IODs &_val)
63 {
64  IODs::IODMapType::const_iterator it = _val.IODsInternal.begin();
65  for(;it != _val.IODsInternal.end(); ++it)
66  {
67  const std::string &name = it->first;
68  const IOD &m = it->second;
69  _os << name << " " << m << '\n';
70  }
71 
72  return _os;
73 }
74 
75 
76 } // end namespace gdcm
77 
78 #endif //GDCMIODS_H
IODMapTypeConstIterator Begin() const
Definition: gdcmIODs.h:55
Class for representing a IODs.
Definition: gdcmIODs.h:29
void AddIOD(const char *name, const IOD &module)
Definition: gdcmIODs.h:40
std::map< IODName, IOD > IODMapType
Definition: gdcmIODs.h:33
void Clear()
Definition: gdcmIODs.h:38
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
IODs()
Definition: gdcmIODs.h:35
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:88
IODMapTypeConstIterator End() const
Definition: gdcmIODs.h:56
const IOD & GetIOD(const char *name) const
Definition: gdcmIODs.h:45
IODMapType::const_iterator IODMapTypeConstIterator
Definition: gdcmIODs.h:54
Class for representing a IOD.
Definition: gdcmIOD.h:34
Definition: gdcmASN1.h:20
std::string IODName
Definition: gdcmIODs.h:32

Generated on Fri Sep 25 2015 17:58:23 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo