You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2001/10/25 23:54:50 UTC

cvs commit: xml-xerces/c/src/util XMLDouble.cpp XMLDouble.hpp XMLFloat.cpp XMLFloat.hpp

peiyongz    01/10/25 14:54:50

  Modified:    c/src/util XMLDouble.cpp XMLDouble.hpp XMLFloat.cpp
                        XMLFloat.hpp
  Log:
  Apply XMLRegisterCleanup
  
  Revision  Changes    Path
  1.13      +33 -25    xml-xerces/c/src/util/XMLDouble.cpp
  
  Index: XMLDouble.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/XMLDouble.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XMLDouble.cpp	2001/09/20 13:11:41	1.12
  +++ XMLDouble.cpp	2001/10/25 21:54:50	1.13
  @@ -55,8 +55,11 @@
    */
   
   /*
  - * $Id: XMLDouble.cpp,v 1.12 2001/09/20 13:11:41 knoaman Exp $
  + * $Id: XMLDouble.cpp,v 1.13 2001/10/25 21:54:50 peiyongz Exp $
    * $Log: XMLDouble.cpp,v $
  + * Revision 1.13  2001/10/25 21:54:50  peiyongz
  + * Apply XMLRegisterCleanup
  + *
    * Revision 1.12  2001/09/20 13:11:41  knoaman
    * Regx  + misc. fixes
    *
  @@ -101,7 +104,7 @@
   // ---------------------------------------------------------------------------
   #include <util/XMLDouble.hpp>
   #include <util/PlatformUtils.hpp>
  -#include <util/XMLDeleterFor.hpp>
  +#include <util/XMLRegisterCleanup.hpp>
   #include <util/XMLString.hpp>
   #include <util/XMLUniDefs.hpp>
   #include <util/NumberFormatException.hpp>
  @@ -195,11 +198,13 @@
   // maxNegativeValue < minNegativeValue < 0 < minPositiveValue < maxPositiveValue
   // They are all "Inclusive value"
   //
  +
  +static XMLDouble*  maxNegativeValue = 0;
  +static XMLDouble*  minNegativeValue = 0;
  +static XMLDouble*  minPositiveValue = 0;
  +static XMLDouble*  maxPositiveValue = 0;
   
  -static XMLDouble*  maxNegativeValue;
  -static XMLDouble*  minNegativeValue;
  -static XMLDouble*  minPositiveValue;
  -static XMLDouble*  maxPositiveValue;
  +static XMLRegisterCleanup XMLDoubleCleanup;
   
   /***
    *   Algo:
  @@ -314,28 +319,11 @@
           isInitialized = true;  // set first to avoid recursion
   
           maxNegativeValue = new XMLDouble(DBL_MAX_NEGATIVE);
  -        XMLPlatformUtils::registerLazyData
  -        (
  -            new XMLDeleterFor<XMLDouble>(maxNegativeValue)
  -        );
  -
           minNegativeValue = new XMLDouble(DBL_MIN_NEGATIVE);
  -        XMLPlatformUtils::registerLazyData
  -        (
  -            new XMLDeleterFor<XMLDouble>(minNegativeValue)
  -        );
  -
           minPositiveValue = new XMLDouble(DBL_MIN_POSITIVE);
  -        XMLPlatformUtils::registerLazyData
  -        (
  -            new XMLDeleterFor<XMLDouble>(minPositiveValue)
  -        );
  -
           maxPositiveValue = new XMLDouble(DBL_MAX_POSITIVE);
  -        XMLPlatformUtils::registerLazyData
  -        (
  -            new XMLDeleterFor<XMLDouble>(maxPositiveValue)
  -        );
  +
  +        XMLDoubleCleanup.registerCleanup(reinitXMLDouble);
       }
   
       //
  @@ -537,3 +525,23 @@
       }
   }
   
  +// -----------------------------------------------------------------------
  +//  Notification that lazy data has been deleted
  +// -----------------------------------------------------------------------
  +void XMLDouble::reinitXMLDouble() {
  +
  +    isInitialized = false;
  +
  +    delete maxNegativeValue;
  +    maxNegativeValue = 0;
  +
  +    delete minNegativeValue;
  +    minNegativeValue = 0;
  +
  +    delete minPositiveValue;
  +    minPositiveValue = 0;
  +
  +    delete maxPositiveValue;
  +    maxPositiveValue = 0;
  +
  +}
  \ No newline at end of file
  
  
  
  1.7       +9 -1      xml-xerces/c/src/util/XMLDouble.hpp
  
  Index: XMLDouble.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/XMLDouble.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLDouble.hpp	2001/09/27 14:54:20	1.6
  +++ XMLDouble.hpp	2001/10/25 21:54:50	1.7
  @@ -55,8 +55,11 @@
    */
   
   /*
  - * $Id: XMLDouble.hpp,v 1.6 2001/09/27 14:54:20 peiyongz Exp $
  + * $Id: XMLDouble.hpp,v 1.7 2001/10/25 21:54:50 peiyongz Exp $
    * $Log: XMLDouble.hpp,v $
  + * Revision 1.7  2001/10/25 21:54:50  peiyongz
  + * Apply XMLRegisterCleanup
  + *
    * Revision 1.6  2001/09/27 14:54:20  peiyongz
    * DTV Reorganization: derived from XMLNumber
    *
  @@ -148,6 +151,11 @@
   
       static int            compareValues(const XMLDouble* const lValue
                                         , const XMLDouble* const rValue);
  +
  +    // -----------------------------------------------------------------------
  +    //  Notification that lazy data has been deleted
  +    // -----------------------------------------------------------------------
  +	static void reinitXMLDouble();   
   
   private:
   
  
  
  
  1.10      +33 -25    xml-xerces/c/src/util/XMLFloat.cpp
  
  Index: XMLFloat.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/XMLFloat.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XMLFloat.cpp	2001/09/20 13:11:41	1.9
  +++ XMLFloat.cpp	2001/10/25 21:54:50	1.10
  @@ -55,8 +55,11 @@
    */
   
   /*
  - * $Id: XMLFloat.cpp,v 1.9 2001/09/20 13:11:41 knoaman Exp $
  + * $Id: XMLFloat.cpp,v 1.10 2001/10/25 21:54:50 peiyongz Exp $
    * $Log: XMLFloat.cpp,v $
  + * Revision 1.10  2001/10/25 21:54:50  peiyongz
  + * Apply XMLRegisterCleanup
  + *
    * Revision 1.9  2001/09/20 13:11:41  knoaman
    * Regx  + misc. fixes
    *
  @@ -93,7 +96,7 @@
   // ---------------------------------------------------------------------------
   #include <util/XMLFloat.hpp>
   #include <util/PlatformUtils.hpp>
  -#include <util/XMLDeleterFor.hpp>
  +#include <util/XMLRegisterCleanup.hpp>
   #include <util/XMLString.hpp>
   #include <util/XMLUniDefs.hpp>
   #include <util/NumberFormatException.hpp>
  @@ -183,11 +186,13 @@
   // maxNegativeValue < minNegativeValue < 0 < minPositiveValue < maxPositiveValue
   // They are all "Inclusive value"
   //
  +
  +static XMLFloat*  maxNegativeValue = 0;
  +static XMLFloat*  minNegativeValue = 0;
  +static XMLFloat*  minPositiveValue = 0;
  +static XMLFloat*  maxPositiveValue = 0;
   
  -static XMLFloat*  maxNegativeValue;
  -static XMLFloat*  minNegativeValue;
  -static XMLFloat*  minPositiveValue;
  -static XMLFloat*  maxPositiveValue;
  +static XMLRegisterCleanup XMLFloatCleanup;
   
   /***
    *   Algo:
  @@ -302,28 +307,11 @@
           isInitialized = true;  // set first to avoid recursion
   
           maxNegativeValue = new XMLFloat(FLT_MAX_NEGATIVE);
  -        XMLPlatformUtils::registerLazyData
  -        (
  -            new XMLDeleterFor<XMLFloat>(maxNegativeValue)
  -        );
  -
           minNegativeValue = new XMLFloat(FLT_MIN_NEGATIVE);
  -        XMLPlatformUtils::registerLazyData
  -        (
  -            new XMLDeleterFor<XMLFloat>(minNegativeValue)
  -        );
  -
           minPositiveValue = new XMLFloat(FLT_MIN_POSITIVE);
  -        XMLPlatformUtils::registerLazyData
  -        (
  -            new XMLDeleterFor<XMLFloat>(minPositiveValue)
  -        );
  -
           maxPositiveValue = new XMLFloat(FLT_MAX_POSITIVE);
  -        XMLPlatformUtils::registerLazyData
  -        (
  -            new XMLDeleterFor<XMLFloat>(maxPositiveValue)
  -        );
  +
  +        XMLFloatCleanup.registerCleanup(reinitXMLFloat);
       }
   
       //
  @@ -525,3 +513,23 @@
       }
   }
   
  +// -----------------------------------------------------------------------
  +//  Notification that lazy data has been deleted
  +// -----------------------------------------------------------------------
  +void XMLFloat::reinitXMLFloat() {
  +
  +    isInitialized = false;
  +
  +    delete maxNegativeValue;
  +    maxNegativeValue = 0;
  +
  +    delete minNegativeValue;
  +    minNegativeValue = 0;
  +
  +    delete minPositiveValue;
  +    minPositiveValue = 0;
  +
  +    delete maxPositiveValue;
  +    maxPositiveValue = 0;
  +
  +}
  \ No newline at end of file
  
  
  
  1.5       +9 -1      xml-xerces/c/src/util/XMLFloat.hpp
  
  Index: XMLFloat.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/XMLFloat.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XMLFloat.hpp	2001/09/27 14:54:20	1.4
  +++ XMLFloat.hpp	2001/10/25 21:54:50	1.5
  @@ -55,8 +55,11 @@
    */
   
   /*
  - * $Id: XMLFloat.hpp,v 1.4 2001/09/27 14:54:20 peiyongz Exp $
  + * $Id: XMLFloat.hpp,v 1.5 2001/10/25 21:54:50 peiyongz Exp $
    * $Log: XMLFloat.hpp,v $
  + * Revision 1.5  2001/10/25 21:54:50  peiyongz
  + * Apply XMLRegisterCleanup
  + *
    * Revision 1.4  2001/09/27 14:54:20  peiyongz
    * DTV Reorganization: derived from XMLNumber
    *
  @@ -143,6 +146,11 @@
   
       static int            compareValues(const XMLFloat* const lValue
                                         , const XMLFloat* const rValue);
  +
  +    // -----------------------------------------------------------------------
  +    //  Notification that lazy data has been deleted
  +    // -----------------------------------------------------------------------
  +	static void reinitXMLFloat();   
   
   private:
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org