dbertoni    00/07/06 13:14:02

  Modified:    c/src/PlatformSupport Factory.hpp
  Log:
  Made a public version of the delete functor and changed the name of the 
protected one.
  
  Revision  Changes    Path
  1.5       +36 -5     xml-xalan/c/src/PlatformSupport/Factory.hpp
  
  Index: Factory.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/Factory.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Factory.hpp       2000/03/07 16:12:21     1.4
  +++ Factory.hpp       2000/07/06 20:14:02     1.5
  @@ -136,16 +136,16 @@
         *
         */
        #if defined(XALAN_NO_NAMESPACES)
  -     struct DeleteFactoryObjectFunctor : public unary_function<const 
FactoryObject*, void>
  +     struct ProtectedDeleteFactoryObjectFunctor : public 
unary_function<const FactoryObject*, void>
        #else
  -     struct DeleteFactoryObjectFunctor : public std::unary_function<const 
FactoryObject*, void>
  +     struct ProtectedDeleteFactoryObjectFunctor : public 
std::unary_function<const FactoryObject*, void>
        #endif
        {
        public:
   
  -             DeleteFactoryObjectFunctor(
  +             ProtectedDeleteFactoryObjectFunctor(
                        Factory&                theFactoryInstance,
  -                     bool                    fInReset = false) :
  +                     bool                    fInReset) :
                        m_factoryInstance(theFactoryInstance),
                        m_fInReset(fInReset)
                {
  @@ -165,7 +165,7 @@
                const bool      m_fInReset;
        };
   
  -     friend struct DeleteFactoryObjectFunctor;
  +     friend struct ProtectedDeleteFactoryObjectFunctor;
   
   private:
   
  @@ -335,6 +335,37 @@
        // Data members...
        Factory*        m_factory;
       Type*            m_object;
  +};
  +
  +
  +
  +/**
  + *
  + * A public functor for use with stl algorithms.
  + *
  + */
  +#if defined(XALAN_NO_NAMESPACES)
  +struct DeleteFactoryObjectFunctor : public unary_function<const 
FactoryObject*, void>
  +#else
  +struct DeleteFactoryObjectFunctor : public std::unary_function<const 
FactoryObject*, void>
  +#endif
  +{
  +public:
  +
  +     DeleteFactoryObjectFunctor(Factory&             theFactoryInstance) :
  +             m_factoryInstance(theFactoryInstance)
  +     {
  +     }
  +
  +     result_type
  +     operator()(argument_type        theFactoryObject) const
  +     {
  +             m_factoryInstance.returnObject(theFactoryObject);
  +     }
  +
  +private:
  +
  +     Factory&        m_factoryInstance;
   };
   
   
  
  
  

Reply via email to