]> Creatis software - gdcm.git/blob - src/gdcmGlobal.cxx
ENH: Adding 'gdcm' namespace. Be nice with me this was a ~13000 lines patch. Also...
[gdcm.git] / src / gdcmGlobal.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmGlobal.cxx,v $
5   Language:  C++
6   Date:      $Date: 2004/10/12 04:35:46 $
7   Version:   $Revision: 1.5 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #include "gdcmGlobal.h"
20 #include "gdcmDebug.h"
21
22 namespace gdcm 
23 {
24
25 /**
26  * \ingroup Globals
27  * \brief Pointer to a container, holding _all_ the Dicom Dictionaries.
28  */
29 DictSet         *Global::Dicts  = (DictSet *)0;
30
31 /**
32  * \ingroup Globals
33  * \brief   Pointer to a hash table containing the 'Value Representations'.
34  */
35 VR              *Global::ValRes     = (VR *)0;
36
37 /**
38  * \ingroup Globals
39  * \brief   Pointer to a hash table containing the Transfer Syntax codes
40  *          and their english description 
41  */
42 TS              *Global::TranSyn     = (TS *)0;
43
44 /**
45  * \ingroup Globals
46  * \brief   Pointer to the hash table containing the Dicom Elements
47  *          necessary to describe each part of a DICOMDIR 
48  */
49 DicomDirElement *Global::ddElem = (DicomDirElement *)0;
50
51 /**
52  * \ingroup Globals
53  * \brief   Global container
54  */
55 Global Glob;
56
57 /**
58  * \ingroup Global
59  * \brief   constructor : populates the various H Tables
60  */
61 Global::Global()
62 {
63    if (ValRes || TranSyn || Dicts || ddElem)
64    {
65       dbg.Verbose(0, "Global::Global : VR or TS or Dicts already allocated");
66    }
67    Dicts   = new DictSet();
68    ValRes  = new VR();
69    TranSyn = new TS();
70    ddElem  = new DicomDirElement();
71 }
72
73 /**
74  * \ingroup Global
75  * \brief   canonical destructor 
76  */
77 Global::~Global()
78 {
79    delete Dicts;
80    delete ValRes;
81    delete TranSyn;
82    delete ddElem;
83 }
84 /**
85  * \ingroup Global
86  * \brief   returns a pointer to the 'Value Representation Table' 
87  */
88 VR *Global::GetVR()
89 {
90    return ValRes;
91 }
92 /**
93  * \ingroup Global
94  * \brief   returns a pointer to the 'Transfert Syntax Table' 
95  */
96 TS *Global::GetTS()
97 {
98    return TranSyn;
99 }
100 /**
101  * \ingroup Global
102  * \brief   returns a pointer to Dictionaries Table 
103  */
104 DictSet *Global::GetDicts()
105 {
106    return Dicts;
107 }
108 /**
109  * \ingroup Global
110  * \brief   returns a pointer to the DicomDir related elements Table 
111  */
112 DicomDirElement *Global::GetDicomDirElements()
113 {
114    return ddElem;
115 }
116 } // end namespace gdcm