GDCM  2.2.0
gdcmModuleEntry.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program: GDCM (Grassroots DICOM). A DICOM library
00004 
00005   Copyright (c) 2006-2011 Mathieu Malaterre
00006   All rights reserved.
00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 #ifndef GDCMMODULEENTRY_H
00015 #define GDCMMODULEENTRY_H
00016 
00017 #include "gdcmTypes.h"
00018 #include "gdcmType.h"
00019 
00020 #include <string>
00021 
00022 namespace gdcm
00023 {
00029 class GDCM_EXPORT ModuleEntry
00030 {
00031 public:
00032   ModuleEntry(const char *name = "", const char *type = "3", const char *description = ""):Name(name)/*,Type(type)*/,DescriptionField(description) {
00033     DataElementType = Type::GetTypeType(type);
00034   }
00035   virtual ~ModuleEntry() {} // important
00036   friend std::ostream& operator<<(std::ostream& _os, const ModuleEntry &_val);
00037 
00038   void SetName(const char *name) { Name = name; }
00039   const char *GetName() const { return Name.c_str(); }
00040 
00041   void SetType(const Type &type) { DataElementType = type; }
00042   const Type &GetType() const { return DataElementType; }
00043 
00044   /*
00045    * WARNING: 'Description' is currently a std::string, but it might change in the future
00046    * do not expect it to remain the same, and always use the ModuleEntry::Description typedef
00047    * instead.
00048    */
00049   typedef std::string Description;
00050   void SetDescription(const char *d) { DescriptionField = d; }
00051   const Description & GetDescription() const { return DescriptionField; }
00052 
00053 protected:
00054   // PS 3.3 repeats the name of an attribute, but often contains typos
00055   // for now we will not use this info, but instead access the DataDict instead
00056   std::string Name;
00057 
00058   // An attribute, encoded as a Data Element, may or may not be required in a
00059   // Data Set, depending on that Attribute's Data Element Type.
00060   Type DataElementType;
00061 
00062   // TODO: for now contains the raw description (with enumerated values, defined terms...)
00063   Description DescriptionField;
00064 };
00065 //-----------------------------------------------------------------------------
00066 inline std::ostream& operator<<(std::ostream& _os, const ModuleEntry &_val)
00067 {
00068   _os << _val.Name << "\t" << _val.DataElementType << "\t" << _val.DescriptionField;
00069   return _os;
00070 }
00071 
00072 typedef ModuleEntry MacroEntry;
00073 
00074 
00075 } // end namespace gdcm
00076 
00077 #endif //GDCMMODULEENTRY_H

Generated on Sun Jun 3 2012 15:26:48 for GDCM by doxygen 1.8.0
SourceForge.net Logo