]> Creatis software - gdcm.git/commitdiff
The highy time consuming method GetMacAdress is now called just once
authorjpr <jpr>
Tue, 7 Jun 2005 13:48:35 +0000 (13:48 +0000)
committerjpr <jpr>
Tue, 7 Jun 2005 13:48:35 +0000 (13:48 +0000)
src/gdcmUtil.cxx
src/gdcmUtil.h

index f20d854df1772de22c2c27dbcfe9a0dfbe525715..ce7000bf7dfcd0ef3dddf6ad267e612435c31a17 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmUtil.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/06/06 13:07:19 $
-  Version:   $Revision: 1.152 $
+  Date:      $Date: 2005/06/07 13:48:35 $
+  Version:   $Revision: 1.153 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -94,6 +94,7 @@ const std::string Util::GDCM_UID = "1.2.826.0.1.3680043.2.1143";
 std::string Util::RootUID        = GDCM_UID;
 const uint16_t Util::FMIV = 0x0001;
 uint8_t *Util::FileMetaInformationVersion = (uint8_t *)&FMIV;
+std::string Util::GDCM_MAC_ADRESS = GetMACAddress();
 
 //-------------------------------------------------------------------------
 // Public
@@ -389,7 +390,7 @@ std::string Util::DicomString(const char *s, size_t l)
  * \brief Create a /DICOM/ string:
  * It should a of even length (no odd length ever)
  * It can contain as many (if you are reading this from your
- * editor the following character is is backslash followed by zero
+ * editor the following character is backslash followed by zero
  * that needed to be escaped with an extra backslash for doxygen) \\0
  * as you want.
  * This function is similar to DicomString(const char*), 
@@ -789,7 +790,8 @@ std::string Util::CreateUniqueUID(const std::string &root)
 
    // A root was specified use it to forge our new UID:
    append += ".";
-   append += Util::GetMACAddress();
+   //append += Util::GetMACAddress(); // to save CPU time
+   append += Util::GDCM_MAC_ADRESS;
    append += ".";
    append += Util::GetCurrentDateTime();
 
index 4cb44015bbf3cde1b234a8616932729f3ddbce95..0804497e2ae466343e4db918a67c62c1c97b61fc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmUtil.h,v $
   Language:  C++
-  Date:      $Date: 2005/02/17 10:56:20 $
-  Version:   $Revision: 1.56 $
+  Date:      $Date: 2005/06/07 13:48:36 $
+  Version:   $Revision: 1.57 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -76,6 +76,7 @@ private:
    static const std::string GDCM_UID;
    static uint8_t *FileMetaInformationVersion;
    static const uint16_t FMIV;
+   static std::string GDCM_MAC_ADRESS;
 };
 
 GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const uint16_t &val);