Program: gdcm
Module: $RCSfile: gdcmDictEntry.cxx,v $
Language: C++
- Date: $Date: 2005/10/19 13:17:04 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2005/11/28 15:30:04 $
+ Version: $Revision: 1.56 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param vm Value Multiplicity
* @param name description of the element
*/
-
DictEntry::DictEntry(uint16_t group, uint16_t elem,
VRKey const &vr,
TagName const &vm,
//-----------------------------------------------------------------------------
// Public
+/**
+ * \brief Class allocator
+ * @param group DICOM-Group Number
+ * @param elem DICOM-Element Number
+ * @param vr Value Representation
+ * @param vm Value Multiplicity
+ * @param name description of the element
+*/
+DictEntry *DictEntry::New(uint16_t group, uint16_t elem,
+ VRKey const &vr,
+ TagName const &vm,
+ TagName const &name)
+{
+ return new DictEntry(group,elem,vr,vm,name);
+}
+
/**
* \brief If-and only if-the V(alue) R(epresentation)
* \ is unset then overwrite it.
*/
void DictEntry::SetVR(VRKey const &vr)
{
- if ( IsVRUnknown() )
- {
- DicomEntry::SetVR(vr);
- }
- else
- {
- gdcmErrorMacro( "Overwriting VR might compromise a dictionary");
- }
+ gdcmAssertMacro( IsVRUnknown() );
+ DicomEntry::SetVR(vr);
}
/**
*/
void DictEntry::SetVM(TagName const &vm)
{
- if ( IsVMUnknown() )
- {
- VM = vm;
- }
- else
- {
- gdcmErrorMacro( "Overwriting VM might compromise a dictionary");
- }
+ gdcmAssertMacro( IsVMUnknown() );
+ VM = vm;
}
//-----------------------------------------------------------------------------
{
DicomEntry::Print(os,indent);
- VRKey vr;
std::ostringstream s;
if ( PrintLevel >= 1 )