]> Creatis software - gdcm.git/blob - src/gdcmGlobal.cxx
ENH: Minor cleanup, still removing stdio.h and co ...
[gdcm.git] / src / gdcmGlobal.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmGlobal.cxx,v $
5   Language:  C++
6   Date:      $Date: 2004/10/08 04:52:55 $
7   Version:   $Revision: 1.4 $
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 /**
23  * \ingroup Globals
24  * \brief Pointer to a container, holding _all_ the Dicom Dictionaries.
25  */
26 gdcmDictSet         *gdcmGlobal::Dicts  = (gdcmDictSet *)0;
27
28 /**
29  * \ingroup Globals
30  * \brief   Pointer to a hash table containing the 'Value Representations'.
31  */
32 gdcmVR              *gdcmGlobal::VR     = (gdcmVR *)0;
33
34 /**
35  * \ingroup Globals
36  * \brief   Pointer to a hash table containing the Transfer Syntax codes
37  *          and their english description 
38  */
39 gdcmTS              *gdcmGlobal::TS     = (gdcmTS *)0;
40
41 /**
42  * \ingroup Globals
43  * \brief   Pointer to the hash table containing the Dicom Elements
44  *          necessary to describe each part of a DICOMDIR 
45  */
46 gdcmDicomDirElement *gdcmGlobal::ddElem = (gdcmDicomDirElement *)0;
47
48 /**
49  * \ingroup Globals
50  * \brief   Global container
51  */
52 gdcmGlobal gdcmGlob;
53
54 /**
55  * \ingroup gdcmGlobal
56  * \brief   constructor : populates the various H Tables
57  */
58 gdcmGlobal::gdcmGlobal()
59 {
60    if (VR || TS || Dicts || ddElem)
61    {
62       dbg.Verbose(0, "gdcmGlobal::gdcmGlobal : VR or TS or Dicts already allocated");
63    }
64    Dicts  = new gdcmDictSet();
65    VR     = new gdcmVR();
66    TS     = new gdcmTS();
67    ddElem = new gdcmDicomDirElement();
68 }
69
70 /**
71  * \ingroup gdcmGlobal
72  * \brief   canonical destructor 
73  */
74 gdcmGlobal::~gdcmGlobal()
75 {
76    delete Dicts;
77    delete VR;
78    delete TS;
79    delete ddElem;
80 }
81 /**
82  * \ingroup gdcmGlobal
83  * \brief   returns a pointer to the 'Value Representation Table' 
84  */
85 gdcmVR *gdcmGlobal::GetVR()
86 {
87    return VR;
88 }
89 /**
90  * \ingroup gdcmGlobal
91  * \brief   returns a pointer to the 'Transfert Syntax Table' 
92  */
93 gdcmTS *gdcmGlobal::GetTS()
94 {
95    return TS;
96 }
97 /**
98  * \ingroup gdcmGlobal
99  * \brief   returns a pointer to Dictionaries Table 
100  */
101 gdcmDictSet *gdcmGlobal::GetDicts()
102 {
103    return Dicts;
104 }
105 /**
106  * \ingroup gdcmGlobal
107  * \brief   returns a pointer to the DicomDir related elements Table 
108  */
109 gdcmDicomDirElement *gdcmGlobal::GetDicomDirElements()
110 {
111    return ddElem;
112 }