Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkMetaDataDictionary.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003 Program:   Insight Segmentation & Registration Toolkit
00004 Module:    $RCSfile: itkMetaDataDictionary.h,v $
00005 Language:  C++
00006 Date:      $Date: 2004/10/29 18:25:09 $
00007 Version:   $Revision: 1.16 $
00008 
00009 Copyright (c) Insight Software Consortium. All rights reserved.
00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012 Portions of this code are covered under the VTK copyright.
00013 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015 This software is distributed WITHOUT ANY WARRANTY; without even
00016 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00017 PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef MetaDataDictionary_h_h
00021 #define MetaDataDictionary_h_h
00022 
00023 #if defined(_MSC_VER)
00024 #pragma warning ( disable : 4786 )
00025 #endif
00026 
00027 #include <vector>
00028 #include <map>
00029 #include <string>
00030 #include "itkMetaDataObjectBase.h"
00031 
00032 namespace itk
00033 {
00034 
00042   class ITKCommon_EXPORT MetaDataDictionary
00043     {
00044       public:
00045         typedef MetaDataDictionary Self;
00050         virtual void Print(std::ostream& os) const;
00051 
00052         // Declare the datastructure that will be used to hold the
00053         // dictionary. 
00054         class MetaDataDictionaryMapType 
00055           : public std::map<std::string, MetaDataObjectBase::Pointer>
00056         {
00057         };
00058 
00059         typedef MetaDataDictionaryMapType::iterator       Iterator;
00060         typedef MetaDataDictionaryMapType::const_iterator ConstIterator;
00061 
00062         // Constructor
00063         MetaDataDictionary();
00064         // Copy Constructor
00065         MetaDataDictionary(const MetaDataDictionary&);
00066         // operator =
00067         void operator=(const MetaDataDictionary&);
00068 
00069         // Destructor
00070         virtual ~MetaDataDictionary();
00071 
00075       std::vector<std::string> GetKeys() const;
00076       
00077         // Implement map's api. On some Micorsoft compilers, stl containers
00078         // cannot be exported. This causes problems when building DLL's.
00079         // Here we inherit privately from std::map and provide a simple
00080         // API. The implementation will be in the DLL.
00081         MetaDataObjectBase::Pointer &operator [](const std::string &);
00082         const MetaDataObjectBase   * operator [](const std::string &) const;
00083         bool HasKey (const std::string &);
00084 
00085 
00087         Iterator  Begin();
00088         ConstIterator  Begin() const;
00089 
00091         Iterator  End();
00092         ConstIterator  End() const;
00093 
00095         Iterator  Find(const std::string & key);
00096         ConstIterator  Find(const std::string & key) const;
00097 
00098 
00099     private:
00100         MetaDataDictionaryMapType *m_Dictionary;
00101     };
00102 }
00103 #endif// MetaDataDictionary_h_h
00104 

Generated at Wed Mar 30 00:03:39 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000