# gdcmIOD.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004   Module:  $URL$
    00005
    00006   Copyright (c) 2006-2009 Mathieu Malaterre
    00007   All rights reserved.
    00008   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00009
    00010      This software is distributed WITHOUT ANY WARRANTY; without even
    00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00012      PURPOSE.  See the above copyright notice for more information.
    00013
    00014 =========================================================================*/
    00015 #ifndef __gdcmIOD_h
    00016 #define __gdcmIOD_h
    00017
    00018 #include "gdcmTypes.h"
    00019 #include "gdcmTag.h"
    00020 #include "gdcmIODEntry.h"
    00021
    00022 #include <vector>
    00023
    00024 namespace gdcm
    00025 {
    00026 class DataSet;
    00027
    00034 class GDCM_EXPORT IOD
    00035 {
    00036 public:
    00037   typedef std::vector<IODEntry> MapIODEntry;
    00038
    00039   IOD() {}
    00040   friend std::ostream& operator<<(std::ostream& _os, const IOD &_val);
    00041
    00042   void Clear() { IODInternal.clear(); }
    00043
    00044   void AddIODEntry(const IODEntry & iode)
    00045     {
    00046     IODInternal.push_back(iode);
    00047     }
    00048
    00049   unsigned int GetNumberOfIODs() const {
    00050     return IODInternal.size();
    00051   }
    00052
    00053   const IODEntry& GetIODEntry(unsigned int idx) const
    00054     {
    00055     return IODInternal[idx];
    00056     }
    00057
    00058 private:
    00059   //IOD &operator=(const IOD &_val); // purposely not implemented
    00060   //IOD(const IOD &_val); // purposely not implemented
    00061
    00062   MapIODEntry IODInternal;
    00063 };
    00064 //-----------------------------------------------------------------------------
    00065 inline std::ostream& operator<<(std::ostream& _os, const IOD &_val)
    00066 {
    00067   IOD::MapIODEntry::const_iterator it = _val.IODInternal.begin();
    00068   for(;it != _val.IODInternal.end(); ++it)
    00069     {
    00070     _os << *it << '\n';
    00071     }
    00072
    00073   return _os;
    00074 }
    00075
    00076 } // end namespace gdcm
    00077
    00078 #endif //__gdcmIOD_h
    00079