gdcmGlobal.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// Implementation detail was shamelessly borowed from the VTK excellent
// implementation of debug leak manager singleton:
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkDebugLeaks.cxx,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMGLOBAL_H
#define GDCMGLOBAL_H
#include "gdcmTypes.h"
namespace gdcm
{
class GlobalInternal;
class Dicts;
class Defs;
class GDCM_EXPORT Global // why expose the symbol I think I only need to expose the instance...
{
friend std::ostream& operator<<(std::ostream &_os, const Global &g);
public:
Global();
~Global();
Global &operator=(const Global &_val) = delete;
Global(const Global &_val) = delete;
Dicts const &GetDicts() const;
Dicts &GetDicts();
Defs const &GetDefs() const;
static Global& GetInstance();
bool LoadResourcesFiles();
bool Append(const char *path);
bool Prepend(const char *path);
protected:
const char *Locate(const char *resfile) const;
private:
// PIMPL:
// but we could have also directly exposed a Dicts *Internals;
static GlobalInternal *Internals;
};
//-----------------------------------------------------------------------------
inline std::ostream& operator<<(std::ostream &os, const Global &g)
{
(void)g;
return os;
}
// This instance will show up in any translation unit that uses
// Global or that has a singleton. It will make sure
// Global is initialized before it is used and is the last
// static object destroyed.
static Global GlobalInstance;
} // end namespace gdcm
#endif //GDCMGLOBAL_H
gdcm::Defs
FIXME I do not like the name 'Defs'.
Definition gdcmDefs.h:33
gdcm::Dicts
Class to manipulate the sum of knowledge (all the dict user load).
Definition gdcmDicts.h:29
gdcm::Global
Global.
Definition gdcmGlobal.h:50
gdcm::Global::GetDefs
Defs const & GetDefs() const
gdcm::Global::Prepend
bool Prepend(const char *path)
gdcm::Global::Append
bool Append(const char *path)
gdcm::Global::Global
Global(const Global &_val)=delete
gdcm::Global::GetDicts
Dicts const & GetDicts() const
gdcm::Global::GetDicts
Dicts & GetDicts()
gdcm::Global::Global
Global()
gdcm::Global::LoadResourcesFiles
bool LoadResourcesFiles()
gdcm::Global::Locate
const char * Locate(const char *resfile) const
Locate a resource file.
gdcm::Global::~Global
~Global()
gdcm::Global::operator=
Global & operator=(const Global &_val)=delete
gdcm::Global::GetInstance
static Global & GetInstance()
return the singleton instance
gdcm::Global::operator<<
friend std::ostream & operator<<(std::ostream &_os, const Global &g)
Definition gdcmGlobal.h:93
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88
gdcm::GlobalInstance
static Global GlobalInstance
Definition gdcmGlobal.h:103