# gdcmMacroEntry.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-2010 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 #if 0
    00016 #ifndef GDCMMACROENTRY_H
    00017 #define GDCMMACROENTRY_H
    00018
    00019 #include "gdcmTypes.h"
    00020 #include "gdcmType.h"
    00021
    00022 #include <string>
    00023
    00024 namespace gdcm
    00025 {
    00031 class GDCM_EXPORT MacroEntry
    00032 {
    00033 public:
    00034   MacroEntry(const char *name = "", const char *type = "3", const char *description = ""):Name(name)/*,Type(type)*/,DescriptionField(description) {
    00035     DataElementType = Type::GetTypeType(type);
    00036   }
    00037   virtual ~MacroEntry() {} // important
    00038   friend std::ostream& operator<<(std::ostream& _os, const MacroEntry &_val);
    00039
    00040   void SetName(const char *name) { Name = name; }
    00041   const char *GetName() const { return Name.c_str(); }
    00042
    00043   void SetType(const Type &type) { DataElementType = type; }
    00044   const Type &GetType() const { return DataElementType; }
    00045
    00046   /*
    00047    * WARNING: 'Description' is currently a std::string, but it might change in the future
    00048    * do not expect it to remain the same, and always use the ModuleEntry::Description typedef
    00049    * instead.
    00050    */
    00051   typedef std::string Description;
    00052   void SetDescription(const char *d) { DescriptionField = d; }
    00053   const Description & GetDescription() const { return DescriptionField; }
    00054
    00055 protected:
    00056   // PS 3.3 repeats the name of an attribute, but often contains typos
    00057   // for now we will not use this info, but instead access the DataDict instead
    00058   std::string Name;
    00059
    00060   // An attribute, encoded as a Data Element, may or may not be required in a
    00061   // Data Set, depending on that Attribute's Data Element Type.
    00062   Type DataElementType;
    00063
    00064   // TODO: for now contains the raw description (with enumerated values, defined terms...)
    00065   Description DescriptionField;
    00066 };
    00067 //-----------------------------------------------------------------------------
    00068 inline std::ostream& operator<<(std::ostream& _os, const MacroEntry &_val)
    00069 {
    00070   _os << _val.Name << "\t" << _val.DataElementType << "\t" << _val.DescriptionField;
    00071   return _os;
    00072 }
    00073
    00074
    00075 } // end namespace gdcm
    00076
    00077 #endif //GDCMMODULEENTRY_H
    00078 #endif
    00079
    00080 #ifndef GDCMMACROENTRY_H
    00081 #define GDCMMACROENTRY_H
    00082 #include "gdcmModuleEntry.h"
    00083 #endif