Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMIODS_H
00016 #define GDCMIODS_H
00017
00018 #include "gdcmTypes.h"
00019 #include "gdcmIOD.h"
00020
00021 #include <map>
00022
00023 namespace gdcm
00024 {
00030 class GDCM_EXPORT IODs
00031 {
00032 public:
00033 typedef std::string IODName;
00034 typedef std::map<IODName, IOD> IODMapType;
00035
00036 IODs() {}
00037 friend std::ostream& operator<<(std::ostream& _os, const IODs &_val);
00038
00039 void Clear() { IODsInternal.clear(); }
00040
00041 void AddIOD(const char *name , const IOD & module )
00042 {
00043 IODsInternal.insert(
00044 IODMapType::value_type(name, module));
00045 }
00046 const IOD &GetIOD(const char *name) const
00047 {
00048
00049 IODMapType::const_iterator it = IODsInternal.find( name );
00050 assert( it != IODsInternal.end() );
00051 assert( it->first == name );
00052 return it->second;
00053 }
00054
00055 typedef IODMapType::const_iterator IODMapTypeConstIterator;
00056 IODMapTypeConstIterator Begin() const { return IODsInternal.begin(); }
00057 IODMapTypeConstIterator End() const { return IODsInternal.end(); }
00058
00059 private:
00060 IODMapType IODsInternal;
00061 };
00062
00063 inline std::ostream& operator<<(std::ostream& _os, const IODs &_val)
00064 {
00065 IODs::IODMapType::const_iterator it = _val.IODsInternal.begin();
00066 for(;it != _val.IODsInternal.end(); ++it)
00067 {
00068 const std::string &name = it->first;
00069 const IOD &m = it->second;
00070 _os << name << " " << m << '\n';
00071 }
00072
00073 return _os;
00074 }
00075
00076
00077 }
00078
00079 #endif //GDCMIODS_H
00080