]> Creatis software - gdcm.git/blob - src/gdcmGlobal.cxx
* Erroneous leading white fix:
[gdcm.git] / src / gdcmGlobal.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmGlobal.cxx,v $
5   Language:  C++
6   Date:      $Date: 2004/06/20 18:08:47 $
7   Version:   $Revision: 1.2 $
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.htm 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 #include <stdio.h>
22 #include <ctype.h>   // For isspace
23 #include <string.h>  // CLEANME: could this be only string ? Related to Win32 ?
24
25 /**
26  * \ingroup Globals
27  * \brief Pointer to a container, holding _all_ the Dicom Dictionaries.
28  */
29 gdcmDictSet         *gdcmGlobal::Dicts  = (gdcmDictSet *)0;
30
31 /**
32  * \ingroup Globals
33  * \brief   Pointer to a hash table containing the 'Value Representations'.
34  */
35 gdcmVR              *gdcmGlobal::VR     = (gdcmVR *)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 gdcmTS              *gdcmGlobal::TS     = (gdcmTS *)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 gdcmDicomDirElement *gdcmGlobal::ddElem = (gdcmDicomDirElement *)0;
50
51 /**
52  * \ingroup Globals
53  * \brief   Global container
54  */
55 gdcmGlobal gdcmGlob;
56
57 /**
58  * \ingroup gdcmGlobal
59  * \brief   constructor : populates the various H Tables
60  */
61 gdcmGlobal::gdcmGlobal(void) {
62    if (VR || TS || Dicts || ddElem)
63       dbg.Verbose(0, "gdcmGlobal::gdcmGlobal : VR or TS or Dicts already allocated");
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    delete Dicts;
76    delete VR;
77    delete TS;
78    delete ddElem;
79 }
80 /**
81  * \ingroup gdcmGlobal
82  * \brief   returns a pointer to the 'Value Representation Table' 
83  */
84 gdcmVR *gdcmGlobal::GetVR(void) {
85    return VR;
86 }
87 /**
88  * \ingroup gdcmGlobal
89  * \brief   returns a pointer to the 'Transfert Syntax Table' 
90  */
91 gdcmTS *gdcmGlobal::GetTS(void) {
92    return TS;
93 }
94 /**
95  * \ingroup gdcmGlobal
96  * \brief   returns a pointer to Dictionaries Table 
97  */
98 gdcmDictSet *gdcmGlobal::GetDicts(void) {
99    return Dicts;
100 }
101 /**
102  * \ingroup gdcmGlobal
103  * \brief   returns a pointer to the DicomDir related elements Table 
104  */
105 gdcmDicomDirElement *gdcmGlobal::GetDicomDirElements(void) {
106    return ddElem;
107 }