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: 2005/04/05 19:17:23 $
00007   Version:   $Revision: 1.17 $
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      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkMetaDataDictionary_h
00018 #define __itkMetaDataDictionary_h
00019 
00020 #include "itkMetaDataObjectBase.h"
00021 #include <vector>
00022 #include <map>
00023 #include <string>
00024 
00025 namespace itk
00026 {
00027 
00035 class ITKCommon_EXPORT MetaDataDictionary
00036 {
00037 public:
00038   typedef MetaDataDictionary Self;
00043   virtual void Print(std::ostream& os) const;
00044 
00045   // Declare the datastructure that will be used to hold the
00046   // dictionary. 
00047   class MetaDataDictionaryMapType 
00048     : public std::map<std::string, MetaDataObjectBase::Pointer>
00049       {
00050       };
00051 
00052   typedef MetaDataDictionaryMapType::iterator       Iterator;
00053   typedef MetaDataDictionaryMapType::const_iterator ConstIterator;
00054 
00055   // Constructor
00056   MetaDataDictionary();
00057   // Copy Constructor
00058   MetaDataDictionary(const MetaDataDictionary&);
00059   // operator =
00060   void operator=(const MetaDataDictionary&);
00061 
00062   // Destructor
00063   virtual ~MetaDataDictionary();
00064 
00068   std::vector<std::string> GetKeys() const;
00069 
00070   // Implement map's api. On some Micorsoft compilers, stl containers
00071   // cannot be exported. This causes problems when building DLL's.
00072   // Here we inherit privately from std::map and provide a simple
00073   // API. The implementation will be in the DLL.
00074   MetaDataObjectBase::Pointer &operator [](const std::string &);
00075   const MetaDataObjectBase   * operator [](const std::string &) const;
00076   bool HasKey (const std::string &);
00077 
00078 
00084   Iterator  Begin();
00085   ConstIterator  Begin() const;
00086 
00088   Iterator  End();
00089   ConstIterator  End() const;
00090 
00092   Iterator  Find(const std::string & key);
00093   ConstIterator  Find(const std::string & key) const;
00094 
00095 private:
00096   MetaDataDictionaryMapType *m_Dictionary;
00097 };
00098 
00099 }
00100 #endif // __itkMetaDataDictionary_h
00101 

Generated at Wed May 24 23:40:25 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000