Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMMACRO_H
00016 #define GDCMMACRO_H
00017
00018 #include "gdcmTypes.h"
00019 #include "gdcmTag.h"
00020 #include "gdcmMacroEntry.h"
00021
00022 #include <map>
00023
00024 namespace gdcm
00025 {
00026
00027 class DataSet;
00028 class Usage;
00036 class GDCM_EXPORT Macro
00037 {
00038 public:
00039 typedef std::map<Tag, MacroEntry> MapModuleEntry;
00040 typedef std::vector<std::string> ArrayIncludeMacrosType;
00041
00042
00043
00044
00045
00046
00047
00048
00049 Macro() {}
00050 friend std::ostream& operator<<(std::ostream& _os, const Macro&_val);
00051
00052 void Clear() { ModuleInternal.clear(); }
00053
00055 void AddMacroEntry(const Tag& tag, const MacroEntry & module)
00056 {
00057 ModuleInternal.insert(
00058 MapModuleEntry::value_type(tag, module));
00059 }
00060
00063 bool FindMacroEntry(const Tag &tag) const;
00064 const MacroEntry& GetMacroEntry(const Tag &tag) const;
00065
00066 void SetName( const char *name) { Name = name; }
00067 const char *GetName() const { return Name.c_str(); }
00068
00069
00070
00071 bool Verify(const DataSet& ds, Usage const & usage) const;
00072
00073 private:
00074
00075
00076
00077 MapModuleEntry ModuleInternal;
00078 std::string Name;
00079 };
00080
00081 inline std::ostream& operator<<(std::ostream& _os, const Macro &_val)
00082 {
00083 _os << _val.Name << '\n';
00084 Macro::MapModuleEntry::const_iterator it = _val.ModuleInternal.begin();
00085 for(;it != _val.ModuleInternal.end(); ++it)
00086 {
00087 const Tag &t = it->first;
00088 const MacroEntry &de = it->second;
00089 _os << t << " " << de << '\n';
00090 }
00091
00092 return _os;
00093 }
00094
00095 }
00096
00097 #endif //GDCMMACRO_H
00098