GDCM  2.4.5
gdcmMacroEntry.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #if 0
15 #ifndef GDCMMACROENTRY_H
16 #define GDCMMACROENTRY_H
17 
18 #include "gdcmTypes.h"
19 #include "gdcmType.h"
20 
21 #include <string>
22 
23 namespace gdcm
24 {
31 {
32 public:
33  MacroEntry(const char *name = "", const char *type = "3", const char *description = ""):Name(name)/*,Type(type)*/,DescriptionField(description) {
34  DataElementType = Type::GetTypeType(type);
35  }
36  virtual ~MacroEntry() {} // important
37  friend std::ostream& operator<<(std::ostream& _os, const MacroEntry &_val);
38 
39  void SetName(const char *name) { Name = name; }
40  const char *GetName() const { return Name.c_str(); }
41 
42  void SetType(const Type &type) { DataElementType = type; }
43  const Type &GetType() const { return DataElementType; }
44 
45  /*
46  * WARNING: 'Description' is currently a std::string, but it might change in the future
47  * do not expect it to remain the same, and always use the ModuleEntry::Description typedef
48  * instead.
49  */
50  typedef std::string Description;
51  void SetDescription(const char *d) { DescriptionField = d; }
52  const Description & GetDescription() const { return DescriptionField; }
53 
54 protected:
55  // PS 3.3 repeats the name of an attribute, but often contains typos
56  // for now we will not use this info, but instead access the DataDict instead
57  std::string Name;
58 
59  // An attribute, encoded as a Data Element, may or may not be required in a
60  // Data Set, depending on that Attribute's Data Element Type.
61  Type DataElementType;
62 
63  // TODO: for now contains the raw description (with enumerated values, defined terms...)
64  Description DescriptionField;
65 };
66 //-----------------------------------------------------------------------------
67 inline std::ostream& operator<<(std::ostream& _os, const MacroEntry &_val)
68 {
69  _os << _val.Name << "\t" << _val.DataElementType << "\t" << _val.DescriptionField;
70  return _os;
71 }
72 
73 
74 } // end namespace gdcm
75 
76 #endif //GDCMMODULEENTRY_H
77 #endif
78 
79 #ifndef GDCMMACROENTRY_H
80 #define GDCMMACROENTRY_H
81 #include "gdcmModuleEntry.h"
82 #endif
ModuleEntry MacroEntry
Definition: gdcmModuleEntry.h:72
static TypeType GetTypeType(const char *type)
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:88
Definition: gdcmASN1.h:20

Generated on Fri Sep 25 2015 17:58:23 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo