[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. d4a32dd2ab30d95bc5547238412dfc04f8
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mathieu M. <ma...@us...> - 2021-02-09 05:56:56
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Grassroots DICOM".
The branch, release has been updated
via d4a32dd2ab30d95bc5547238412dfc04f88fbd1f (commit)
from 2d867a1f6582daa8e7953371a7a619276b2cfa20 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceforge.net/p/gdcm/gdcm/ci/d4a32dd2ab30d95bc5547238412dfc04f88fbd1f/
commit d4a32dd2ab30d95bc5547238412dfc04f88fbd1f
Author: V-Sarthou <val...@gm...>
Date: Mon Feb 8 15:02:28 2021 +0100
ENH: Dicts: Remove non thread safe code
Use static const variables instead of a single non-const static one.
diff --git a/Source/DataDictionary/gdcmDicts.cxx b/Source/DataDictionary/gdcmDicts.cxx
index 25fb83423..cd51dd00a 100644
--- a/Source/DataDictionary/gdcmDicts.cxx
+++ b/Source/DataDictionary/gdcmDicts.cxx
@@ -38,7 +38,6 @@ Dicts::~Dicts()
const DictEntry &Dicts::GetDictEntry(const Tag& tag, const char *owner) const
{
- static DictEntry Dummy;
if( tag.IsGroupLength() )
{
const DictEntry & de = PublicDict.GetDictEntry(tag);
@@ -49,12 +48,8 @@ const DictEntry &Dicts::GetDictEntry(const Tag& tag, const char *owner) const
}
else
{
- Dummy.SetName( "Generic Group Length" );
- Dummy.SetKeyword( "GenericGroupLength" );
bool retired = true; // Since DICOM 2008, all (but 0002,0004) group length are retired
- Dummy.SetVR( VR::UL );
- Dummy.SetVM( VM::VM1 );
- Dummy.SetRetired( retired );
+ static const DictEntry Dummy("Generic Group Length", "GenericGroupLength", VR::UL, VM::VM1, retired);
return Dummy;
}
}
@@ -78,13 +73,7 @@ const DictEntry &Dicts::GetDictEntry(const Tag& tag, const char *owner) const
// Check special private element: 0x0000 and [0x1,0xFF] are special cases:
if( tag.IsIllegal() )
{
- std::string pc ( "Illegal Element" );
- Dummy.SetName( pc.c_str() );
- std::string kw ( "IllegalElement" );
- Dummy.SetKeyword( kw.c_str() );
- Dummy.SetVR( VR::INVALID );
- Dummy.SetVM( VM::VM0 );
- Dummy.SetRetired( false ); // ??
+ static const DictEntry Dummy("Illegal Element", "IllegalElement", VR::INVALID, VM::VM0, false);
return Dummy;
}
else if( tag.IsPrivateCreator() )
@@ -93,36 +82,23 @@ const DictEntry &Dicts::GetDictEntry(const Tag& tag, const char *owner) const
assert( tag.GetElement() ); // Not a group length !
assert( tag.IsPrivate() );
assert( owner == nullptr );
- {
- static const char pc[] = "Private Creator";
- static const char kw[] = "PrivateCreator";
- Dummy.SetName( pc );
- Dummy.SetKeyword( kw );
- }
- Dummy.SetVR( VR::LO );
- Dummy.SetVM( VM::VM1 );
- Dummy.SetRetired( false );
+ static const DictEntry Dummy("Private Creator", "PrivateCreator", VR::LO, VM::VM1, false);
return Dummy;
}
else
{
if( owner && *owner )
{
- static const char pc[] = "Private Element Without Private Creator";
- static const char kw[] = "PrivateElementWithoutPrivateCreator";
- Dummy.SetName( pc );
- Dummy.SetKeyword( kw );
+ static const DictEntry Dummy("Private Element Without Private Creator",
+ "PrivateElementWithoutPrivateCreator", VR::INVALID, VM::VM0);
+ return Dummy;
}
else
{
- static const char pc[] = "Private Element With Empty Private Creator";
- static const char kw[] = "PrivateElementWithEmptyPrivateCreator";
- Dummy.SetName( pc );
- Dummy.SetKeyword( kw );
+ static const DictEntry Dummy("Private Element With Empty Private Creator",
+ "PrivateElementWithEmptyPrivateCreator", VR::INVALID, VM::VM0);
+ return Dummy;
}
- Dummy.SetVR( VR::INVALID );
- Dummy.SetVM( VM::VM0 );
- return Dummy;
}
}
}
diff --git a/Source/DataDictionary/gdcmDicts.h b/Source/DataDictionary/gdcmDicts.h
index eff220a18..169c1a7c8 100644
--- a/Source/DataDictionary/gdcmDicts.h
+++ b/Source/DataDictionary/gdcmDicts.h
@@ -38,7 +38,7 @@ public:
/// owner is null for public dict
/// \warning owner need to be set to appropriate owner for call to work. see
// DataSet::GetPrivateCreator
- /// NOT THREAD SAFE
+ /// THREAD SAFE
const DictEntry &GetDictEntry(const Tag& tag, const char *owner = nullptr) const;
const DictEntry &GetDictEntry(const PrivateTag& tag) const;
-----------------------------------------------------------------------
Summary of changes:
Source/DataDictionary/gdcmDicts.cxx | 42 ++++++++-----------------------------
Source/DataDictionary/gdcmDicts.h | 2 +-
2 files changed, 10 insertions(+), 34 deletions(-)
hooks/post-receive
--
Grassroots DICOM
|