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