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