[GME-commit] GMESRC/GME/Include/xalanc/Include XalanDeque.hpp, NONE, 1.1 XalanList.hpp, NONE, 1.1 XalanMap.hpp, NONE, 1.1 XalanMemMgrAutoPtr.hpp, NONE, 1.1 XalanMemMgrHelper.hpp, NONE, 1.1 XalanMemMngArrayAllocate.hpp, NONE, 1.1 XalanMemoryManagement.hpp, NONE, 1.1 XalanObjectStackCache.hpp, NONE, 1.1 XalanSet.hpp, NONE, 1.1 XalanVector.hpp, NONE, 1.1 AIXDefinitions.hpp, 1.1.1.1, 1.2 GCCDefinitions.hpp, 1.1.1.1, 1.2 HPUXDefinitions.hpp, 1.1.1.1, 1.2 IntelDefinitions.hpp, 1.1.1.1, 1.2 OS390Definitions.hpp, 1.1.1.1, 1.2 OS400Definitions.hpp, 1.1.1.1, 1.2 PlatformDefinitions.hpp, 1.1.1.1, 1.2 STLHelper.hpp, 1.1.1.1, 1.2 SolarisDefinitions.hpp, 1.1.1.1, 1.2 TRU64Definitions.hpp, 1.1.1.1, 1.2 VCPPDefinitions.hpp, 1.3, 1.4 XalanAutoPtr.hpp, 1.1.1.1, 1.2 XalanObjectCache.hpp, 1.1.1.1, 1.2 XalanVersion.hpp, 1.1.1.1, 1.2
Log messages of CVS commits
gme-commit at list.isis.vanderbilt.edu
Tue Feb 19 14:14:05 CST 2008
- Previous message: [GME-commit] GMESRC/GME/Include/xalanc/ICUBridge ICUFormatNumberFunctor.hpp, NONE, 1.1 ICUBridge.hpp, 1.1.1.1, 1.2 ICUBridgeCleanup.hpp, 1.1.1.1, 1.2 ICUBridgeCollationCompareFunctor.hpp, 1.1.1.1, 1.2 ICUBridgeCollationCompareFunctorImpl.hpp, 1.1.1.1, 1.2 ICUBridgeDefinitions.hpp, 1.1.1.1, 1.2 ICUXalanNumberFormatFactory.hpp, 1.1.1.1, 1.2 ICUXalanNumberFormatProxy.hpp, 1.1.1.1, 1.2
- Next message: [GME-commit] GMESRC/GME/Include/xalanc/TestXPath NodeNameTreeWalker.hpp, 1.1.1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /project/gme-repository/GMESRC/GME/Include/xalanc/Include
In directory escher:/tmp/cvs-serv25974/Include
Modified Files:
AIXDefinitions.hpp GCCDefinitions.hpp HPUXDefinitions.hpp
IntelDefinitions.hpp OS390Definitions.hpp OS400Definitions.hpp
PlatformDefinitions.hpp STLHelper.hpp SolarisDefinitions.hpp
TRU64Definitions.hpp VCPPDefinitions.hpp XalanAutoPtr.hpp
XalanObjectCache.hpp XalanVersion.hpp
Added Files:
XalanDeque.hpp XalanList.hpp XalanMap.hpp
XalanMemMgrAutoPtr.hpp XalanMemMgrHelper.hpp
XalanMemMngArrayAllocate.hpp XalanMemoryManagement.hpp
XalanObjectStackCache.hpp XalanSet.hpp XalanVector.hpp
Log Message:
Xalan1.10 include files.
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: STLHelper.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/STLHelper.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** STLHelper.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- STLHelper.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(STLHELPERS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(STLHELPERS_HEADER_GUARD_1357924680)
***************
*** 70,110 ****
XALAN_CPP_NAMESPACE_BEGIN
/**
* Functor to delete objects, used in STL iteration algorithms.
*/
! template <class T>
#if defined(XALAN_NO_STD_NAMESPACE)
! struct DeleteFunctor : public unary_function<const T*, void>
#else
! struct DeleteFunctor : public std::unary_function<const T*, void>
#endif
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<const T*, void> BaseClassType;
#else
! typedef std::unary_function<const T*, void> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! /**
! * Delete the object pointed to by argument.
! *
! * @param thePointer pointer to object to be deleted
! */
! result_type
! operator()(argument_type thePointer) const
! {
! #if defined(XALAN_CANNOT_DELETE_CONST)
! delete (T*)thePointer;
! #else
! delete thePointer;
! #endif
! }
};
--- 29,133 ----
+ #include <xalanc/Include/XalanMap.hpp>
+
+
+
XALAN_CPP_NAMESPACE_BEGIN
+ template<class Type>
+ struct
+ XalanDestroyFunctor
+ {
+ void
+ operator()(Type& theArg)
+ {
+ theArg.~Type();
+ }
+
+ void
+ operator()(Type* theArg)
+ {
+ theArg->~Type();
+ }
+
+ void
+ operator()(const Type* theArg)
+ {
+ (*this)(const_cast<Type*>(theArg));
+ }
+
+ void
+ operator()(
+ Type* theArg,
+ MemoryManagerType& theMemoryManager)
+ {
+ if (theArg != 0)
+ {
+ (*this)(*theArg);
+
+ theMemoryManager.deallocate(theArg);
+ }
+ }
+
+ void
+ operator()(
+ const Type* theArg,
+ MemoryManagerType& theMemoryManager)
+ {
+ (*this)(const_cast<Type*>(theArg), theMemoryManager);
+ }
+ };
+
+
+
+ template<class Type>
+ XalanDestroyFunctor<Type>
+ makeXalanDestroyFunctor(const Type* /* theType */)
+ {
+ return XalanDestroyFunctor<Type>();
+ }
+
+
+
/**
* Functor to delete objects, used in STL iteration algorithms.
*/
! template <class Type>
#if defined(XALAN_NO_STD_NAMESPACE)
! struct DeleteFunctor : public unary_function<const Type*, void>
#else
! struct DeleteFunctor : public std::unary_function<const Type*, void>
#endif
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<const Type*, void> BaseClassType;
#else
! typedef std::unary_function<const Type*, void> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! DeleteFunctor(MemoryManagerType& theManager) :
! m_memoryManager(theManager)
! {
! }
!
! /**
! * Delete the object pointed to by argument.
! *
! * @param thePointer pointer to object to be deleted
! */
! result_type
! operator()(argument_type thePointer) const
! {
! makeXalanDestroyFunctor(thePointer)(thePointer, m_memoryManager);
! }
!
! private:
!
! MemoryManagerType& m_memoryManager;
};
***************
*** 125,149 ****
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<PairType, PairType::first_type> BaseClassType;
#else
! typedef std::unary_function<PairType, typename PairType::first_type> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! typedef PairType value_type;
! /**
! * Retrieve the key of a key-value pair.
! *
! * @param thePair key-value pair
! * @return key
! */
! result_type
! operator()(const argument_type& thePair) const
! {
! return thePair.first;
! }
};
--- 148,172 ----
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<PairType, PairType::first_type> BaseClassType;
#else
! typedef std::unary_function<PairType, typename PairType::first_type> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! typedef PairType value_type;
! /**
! * Retrieve the key of a key-value pair.
! *
! * @param thePair key-value pair
! * @return key
! */
! result_type
! operator()(const argument_type& thePair) const
! {
! return thePair.first;
! }
};
***************
*** 162,186 ****
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<PairType, PairType::second_type> BaseClassType;
#else
! typedef std::unary_function<PairType, typename PairType::second_type> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! typedef PairType value_type;
! /**
! * Retrieve the value of a key-value pair.
! *
! * @param thePair key-value pair
! * @return value
! */
! result_type
! operator()(const argument_type& thePair) const
! {
! return thePair.second;
! }
};
--- 185,209 ----
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<PairType, PairType::second_type> BaseClassType;
#else
! typedef std::unary_function<PairType, typename PairType::second_type> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! typedef PairType value_type;
! /**
! * Retrieve the value of a key-value pair.
! *
! * @param thePair key-value pair
! * @return value
! */
! result_type
! operator()(const argument_type& thePair) const
! {
! return thePair.second;
! }
};
***************
*** 200,224 ****
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<Type, void> BaseClassType;
#else
! typedef std::unary_function<Type, void> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! typedef Type value_type;
! /**
! * Retrieve the value of a key-value pair.
! *
! * @param thePair key-value pair
! * @return value
! */
! result_type
! operator()(argument_type& theArg) const
! {
! theArg.clear();
! }
};
--- 223,247 ----
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<Type, void> BaseClassType;
#else
! typedef std::unary_function<Type, void> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! typedef Type value_type;
! /**
! * Retrieve the value of a key-value pair.
! *
! * @param thePair key-value pair
! * @return value
! */
! result_type
! operator()(argument_type& theArg) const
! {
! theArg.clear();
! }
};
***************
*** 236,267 ****
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<const typename T::value_type&, void> BaseClassType;
#else
! typedef std::unary_function<const typename T::value_type&, void> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! /**
! * Delete the value object in a map value pair. The value of the pair must
! * be of pointer type.
! *
! * @param thePair key-value pair
! */
! result_type
! operator()(argument_type thePair) const
! {
! delete thePair.second;
! }
};
! template<class T>
! MapValueDeleteFunctor<T>
! makeMapValueDeleteFunctor(const T& /* theMap */)
{
! return MapValueDeleteFunctor<T>();
}
--- 259,299 ----
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<const typename T::value_type&, void> BaseClassType;
#else
! typedef std::unary_function<const typename T::value_type&, void> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! MapValueDeleteFunctor(MemoryManagerType& theManager) :
! m_memoryManager(theManager)
! {
! }
!
! /**
! * Delete the value object in a map value pair. The value of the pair must
! * be of pointer type.
! *
! * @param thePair key-value pair
! */
! result_type
! operator()(argument_type thePair) const
! {
! makeXalanDestroyFunctor(thePair.second)(thePair.second, m_memoryManager);
! }
!
! private:
!
! MemoryManagerType& m_memoryManager;
};
! template<class MapType>
! MapValueDeleteFunctor<MapType>
! makeMapValueDeleteFunctor(MapType& theMap)
{
! return MapValueDeleteFunctor<MapType>(theMap.getMemoryManager());
}
***************
*** 285,325 ****
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef binary_function<const T*, const T*, bool> BaseClassType;
#else
! typedef std::binary_function<const T*, const T*, bool> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::first_argument_type first_argument_type;
! typedef typename BaseClassType::second_argument_type second_argument_type;
! /**
! * Compare the values of two objects.
! *
! *
! * @param theLHS first object to compare
! * @param theRHS second object to compare
! * @return true if objects are the same
! */
! result_type
! operator()(
! first_argument_type theLHS,
! second_argument_type theRHS) const
! {
! while(*theLHS && *theRHS)
! {
! if (*theLHS != *theRHS)
! {
! break;
! }
! else
! {
! theLHS++;
! theRHS++;
! }
! }
! return *theLHS < *theRHS ? true : false;
! }
};
--- 317,440 ----
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef binary_function<const T*, const T*, bool> BaseClassType;
#else
! typedef std::binary_function<const T*, const T*, bool> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::first_argument_type first_argument_type;
! typedef typename BaseClassType::second_argument_type second_argument_type;
! /**
! * Compare the values of two objects.
! *
! *
! * @param theLHS first object to compare
! * @param theRHS second object to compare
! * @return true if objects are the same
! */
! result_type
! operator()(
! first_argument_type theLHS,
! second_argument_type theRHS) const
! {
! while(*theLHS && *theRHS)
! {
! if (*theLHS != *theRHS)
! {
! break;
! }
! else
! {
! theLHS++;
! theRHS++;
! }
! }
! return *theLHS < *theRHS ? true : false;
! }
! };
!
!
!
! template<class T>
! struct equal_null_terminated_arrays : public XALAN_STD_QUALIFIER binary_function<const T*, const T*, bool>
! {
! typedef XALAN_STD_QUALIFIER binary_function<const T*, const T*, bool> BaseClassType;
!
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::first_argument_type first_argument_type;
! typedef typename BaseClassType::second_argument_type second_argument_type;
! /**
! * Compare the values of two objects.
! *
! *
! * @param theLHS first object to compare
! * @param theRHS second object to compare
! * @return true if objects are the same
! */
! result_type
! operator()(
! first_argument_type theLHS,
! second_argument_type theRHS) const
! {
! while(*theLHS && *theRHS)
! {
! if (*theLHS != *theRHS)
! {
! return false;
! }
! else
! {
! ++theLHS;
! ++theRHS;
! }
! }
!
! if (*theLHS || *theRHS)
! {
! return false;
! }
! else
! {
! return true;
! }
! }
! };
!
!
!
! template <class T>
! struct hash_null_terminated_arrays : public XALAN_STD_QUALIFIER unary_function<const T*, size_t>
! {
! typedef XALAN_STD_QUALIFIER unary_function<const T*, size_t> BaseClassType;
!
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
!
! result_type
! operator() (argument_type theKey) const
! {
! const T* theRawBuffer = theKey;
!
! result_type theHashValue = 0;
!
! while (*theRawBuffer)
! {
! theHashValue = 5 * theHashValue + *theRawBuffer;
! ++theRawBuffer;
! }
!
! return ++theHashValue;
! }
! };
!
!
!
! template<>
! struct XalanMapKeyTraits<const XalanDOMChar*>
! {
! typedef hash_null_terminated_arrays<XalanDOMChar> Hasher;
! typedef equal_null_terminated_arrays<XalanDOMChar> Comparator;
};
***************
*** 331,363 ****
public:
! CollectionClearGuard(CollectionType& theCollection) :
! m_collection(&theCollection)
! {
! }
! ~CollectionClearGuard()
! {
! if (m_collection != 0)
! {
! m_collection->clear();
! }
! }
! void
! release()
! {
! m_collection = 0;
! }
private:
! // Not implemented...
! CollectionClearGuard(const CollectionClearGuard<CollectionType>&);
! CollectionClearGuard<CollectionType>&
! operator=(const CollectionClearGuard<CollectionType>&);
! // Data members...
! CollectionType* m_collection;
};
--- 446,478 ----
public:
! CollectionClearGuard(CollectionType& theCollection) :
! m_collection(&theCollection)
! {
! }
! ~CollectionClearGuard()
! {
! if (m_collection != 0)
! {
! m_collection->clear();
! }
! }
! void
! release()
! {
! m_collection = 0;
! }
private:
! // Not implemented...
! CollectionClearGuard(const CollectionClearGuard<CollectionType>&);
! CollectionClearGuard<CollectionType>&
! operator=(const CollectionClearGuard<CollectionType>&);
! // Data members...
! CollectionType* m_collection;
};
***************
*** 369,408 ****
public:
! CollectionDeleteGuard(CollectionType& theCollection) :
! m_collection(&theCollection)
! {
! }
! ~CollectionDeleteGuard()
! {
! if (m_collection != 0)
! {
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::for_each;
#endif
! // Delete all of the objects in the temp vector.
! for_each(m_collection->begin(),
! m_collection->end(),
! DeleteFunctorType());
! }
! }
! void
! release()
! {
! m_collection = 0;
! }
private:
! // Not implemented...
! CollectionDeleteGuard(const CollectionDeleteGuard<CollectionType, DeleteFunctorType>&);
! CollectionDeleteGuard<CollectionType, DeleteFunctorType>&
! operator=(const CollectionDeleteGuard<CollectionType, DeleteFunctorType>&);
! // Data members...
! CollectionType* m_collection;
};
--- 484,523 ----
public:
! CollectionDeleteGuard(CollectionType& theCollection) :
! m_collection(&theCollection)
! {
! }
! ~CollectionDeleteGuard()
! {
! if (m_collection != 0)
! {
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::for_each;
#endif
! // Delete all of the objects in the temp vector.
! for_each(m_collection->begin(),
! m_collection->end(),
! DeleteFunctorType(m_collection->getMemoryManager()));
! }
! }
! void
! release()
! {
! m_collection = 0;
! }
private:
! // Not implemented...
! CollectionDeleteGuard(const CollectionDeleteGuard<CollectionType, DeleteFunctorType>&);
! CollectionDeleteGuard<CollectionType, DeleteFunctorType>&
! operator=(const CollectionDeleteGuard<CollectionType, DeleteFunctorType>&);
! // Data members...
! CollectionType* m_collection;
};
***************
*** 417,438 ****
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef binary_function<const T*, const T*, bool> BaseClassType;
#else
! typedef std::binary_function<const T*, const T*, bool> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::first_argument_type first_argument_type;
! typedef typename BaseClassType::second_argument_type second_argument_type;
! result_type
! operator()(
! first_argument_type theLHS,
! second_argument_type theRHS) const
! {
! assert(theLHS != 0 && theRHS != 0);
! return *theLHS == *theRHS;
! }
};
--- 532,553 ----
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef binary_function<const T*, const T*, bool> BaseClassType;
#else
! typedef std::binary_function<const T*, const T*, bool> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::first_argument_type first_argument_type;
! typedef typename BaseClassType::second_argument_type second_argument_type;
! result_type
! operator()(
! first_argument_type theLHS,
! second_argument_type theRHS) const
! {
! assert(theLHS != 0 && theRHS != 0);
! return *theLHS == *theRHS;
! }
};
***************
*** 447,475 ****
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<const T*, bool> BaseClassType;
#else
! typedef std::unary_function<const T*, bool> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! pointer_equals_predicate(argument_type theArg) :
! m_arg(theArg)
! {
! }
! result_type
! operator()(
! argument_type theOther) const
! {
! assert(theOther != 0);
! return *theOther == *m_arg;
! }
private:
! const argument_type m_arg;
};
--- 562,590 ----
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef unary_function<const T*, bool> BaseClassType;
#else
! typedef std::unary_function<const T*, bool> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::argument_type argument_type;
! pointer_equals_predicate(argument_type theArg) :
! m_arg(theArg)
! {
! }
! result_type
! operator()(
! argument_type theOther) const
! {
! assert(theOther != 0);
! return *theOther == *m_arg;
! }
private:
! const argument_type m_arg;
};
***************
*** 484,516 ****
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef binary_function<const T*, const T*, bool> BaseClassType;
#else
! typedef std::binary_function<const T*, const T*, bool> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::first_argument_type first_argument_type;
! typedef typename BaseClassType::second_argument_type second_argument_type;
! result_type
! operator()(
! first_argument_type theLHS,
! second_argument_type theRHS) const
! {
! assert(theLHS != 0 && theRHS != 0);
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::less;
#endif
! return less<T>()(*theLHS, *theRHS);
! }
};
XALAN_CPP_NAMESPACE_END
! #endif // STLHELPERS_HEADER_GUARD_1357924680
--- 599,653 ----
{
#if defined(XALAN_NO_STD_NAMESPACE)
! typedef binary_function<const T*, const T*, bool> BaseClassType;
#else
! typedef std::binary_function<const T*, const T*, bool> BaseClassType;
#endif
! typedef typename BaseClassType::result_type result_type;
! typedef typename BaseClassType::first_argument_type first_argument_type;
! typedef typename BaseClassType::second_argument_type second_argument_type;
! result_type
! operator()(
! first_argument_type theLHS,
! second_argument_type theRHS) const
! {
! assert(theLHS != 0 && theRHS != 0);
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::less;
#endif
! return less<T>()(*theLHS, *theRHS);
! }
};
+ template<class T>
+ struct pointer_equal : public XALAN_STD_QUALIFIER binary_function<const T*, const T*, bool>
+ {
+ typedef XALAN_STD_QUALIFIER binary_function<const T*, const T*, bool> BaseClassType;
+
+ typedef typename BaseClassType::result_type result_type;
+ typedef typename BaseClassType::first_argument_type first_argument_type;
+ typedef typename BaseClassType::second_argument_type second_argument_type;
+
+ result_type
+ operator()(
+ first_argument_type theLHS,
+ second_argument_type theRHS) const
+ {
+ assert(theLHS != 0 && theRHS != 0);
+ return XALAN_STD_QUALIFIER equal_to<T>()(*theLHS, *theRHS);
+ }
+ };
+
+
+
+
XALAN_CPP_NAMESPACE_END
! #endif // STLHELPERS_HEADER_GUARD_1357924680
--- NEW FILE: XalanMemMngArrayAllocate.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(XALANMEMMGRARRAYALLOCATE_HEADER_GUARD_1357924680)
#define XALANMEMMGRARRAYALLOCATE_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
XALAN_CPP_NAMESPACE_BEGIN
template <class Type>
class XalanMemMngArrayAllocate
{
typedef typename XalanMemMgrAutoPtrArray<Type>::size_type size_type;
public:
static Type*
allocate( size_t size,
MemoryManagerType& memoryManager)
{
XalanMemMgrAutoPtrArray<Type> theGuard ( memoryManager,
(Type*)memoryManager.allocate( sizeof(Type)*size),
size_type(size) );
size_t allocated = 0;
for ( Type* runPtr = theGuard.get() ; allocated < size ; ++ allocated )
{
new ( runPtr + allocated ) Type();
++theGuard;
}
Type* theResult = theGuard.get();
theGuard.release();
return theResult;
}
static Type*
allocateMemMgr( size_t size,
MemoryManagerType& memoryManager)
{
XalanMemMgrAutoPtrArray<Type> theGuard ( memoryManager,
(Type*)memoryManager.allocate( sizeof(Type)*size),
size_type(size) );
size_t allocated = 0;
for ( Type* runPtr = theGuard.get() ; allocated < size ; ++ allocated )
{
new ( runPtr + allocated ) Type(memoryManager);
++theGuard;
}
Type* theResult = theGuard.get();
theGuard.release();
return theResult;
}
static void
deallocate ( Type* ptr,
size_t size,
MemoryManagerType& memoryManager)
{
assert ( ptr != 0 );
Type* runPtr = ptr;
for ( size_t i = 0; i < size ; ++i )
{
runPtr->~Type();
}
memoryManager.deallocate ( ptr);
}
};
XALAN_CPP_NAMESPACE_END
#endif // if !defined(XALANMEMMGRARRAYALLOCATE_HEADER_GUARD_1357924680)
Index: PlatformDefinitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/PlatformDefinitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PlatformDefinitions.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- PlatformDefinitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,61 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(PLATFORMDEFINITIONS_HEADER_GUARD_1357924680)
#define PLATFORMDEFINITIONS_HEADER_GUARD_1357924680
#if defined(_MSC_VER)
#include "VCPPDefinitions.hpp"
--- 1,24 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(PLATFORMDEFINITIONS_HEADER_GUARD_1357924680)
#define PLATFORMDEFINITIONS_HEADER_GUARD_1357924680
+ #if defined(__cplusplus)
+ #include "xercesc/util/XercesDefs.hpp"
+ #endif
+
#if defined(_MSC_VER)
#include "VCPPDefinitions.hpp"
***************
*** 130,138 ****
-
- // Yuck!!!! Have to include this here because there's no way to handle
- // the new namespace macros without it!
- #include "xercesc/util/XercesDefs.hpp"
-
#if defined(XERCES_HAS_CPP_NAMESPACE)
#define XALAN_USING_XERCES(NAME) XALAN_USING(XERCES_CPP_NAMESPACE, NAME)
--- 93,96 ----
***************
*** 148,151 ****
--- 106,134 ----
#define XALAN_DECLARE_XERCES_STRUCT(NAME) struct NAME;
#endif
+
+
+
+ #include <cstddef>
+
+
+
+ XALAN_CPP_NAMESPACE_BEGIN
+ #if defined(XALAN_USE_NATIVE_WCHAR_T)
+ typedef wchar_t XalanDOMChar;
+ #else
+ // UTF-16 character...
+ typedef unsigned short XalanDOMChar;
+ #endif
+
+ template<bool value>
+ struct XalanCompileErrorBoolean
+ {
+ char foo[value];
+ };
+
+ XALAN_CPP_NAMESPACE_END
+
+
+ #define XALAN_STATIC_ASSERT(expr) XALAN_CPP_NAMESPACE_QUALIFIER XalanCompileErrorBoolean<bool(expr)>()
--- NEW FILE: XalanVector.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author David Bertoni (david_n_bertoni at us.ibm.com)
* @author Matthew Hoyt (mhoyt at ca.ibm.com)
[...1161 lines suppressed...]
operator>=(
const XalanVector<Type>& theLHS,
const XalanVector<Type>& theRHS)
{
return !(theLHS < theRHS);
}
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
XALAN_CPP_NAMESPACE_END
#endif // XALANVECTOR_HEADER_GUARD_1357924680
Index: OS390Definitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/OS390Definitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** OS390Definitions.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- OS390Definitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(OS390DEFINITIONS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(OS390DEFINITIONS_HEADER_GUARD_1357924680)
***************
*** 79,84 ****
#define XALAN_EXPLICIT_SCOPE_IN_TEMPLATE_BUG
! #define XALAN_NEW_STD_ALLOCATOR
#define XALAN_HAS_CPP_NAMESPACE
#endif // OS390DEFINITIONS_HEADER_GUARD_1357924680
--- 38,47 ----
#define XALAN_EXPLICIT_SCOPE_IN_TEMPLATE_BUG
! //#define XALAN_NEW_STD_ALLOCATOR
! #define XALAN_HAS_STD_ITERATORS
! #define XALAN_HAS_STD_DISTANCE
#define XALAN_HAS_CPP_NAMESPACE
+ #define XALAN_NO_REENTRANT_TIME_FUNCTIONS
+ #define XALAN_POSIX2_AVAILABLE
#endif // OS390DEFINITIONS_HEADER_GUARD_1357924680
--- NEW FILE: XalanList.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Matthew Hoyt (mhoyt at ca.ibm.com)
*/
#if !defined(XALANLIST_HEADER_GUARD_1357924680)
#define XALANLIST_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <xalanc/Include/PlatformDefinitions.hpp>
#include <cstddef>
#include <algorithm>
#include <cassert>
#include <new>
#include <iterator>
#include <stdexcept>
#include <xalanc/Include/XalanMemoryManagement.hpp>
XALAN_CPP_NAMESPACE_BEGIN
template <class Value>
struct XalanListIteratorTraits
{
typedef Value value_type;
typedef Value& reference;
typedef Value* pointer;
};
template <class Value>
struct XalanListConstIteratorTraits
{
typedef Value value_type;
typedef const Value& reference;
typedef const Value* pointer;
};
template<class XalanListTraits, class Node>
struct XalanListIteratorBase
{
typedef typename XalanListTraits::value_type value_type;
typedef typename XalanListTraits::reference reference;
typedef typename XalanListTraits::pointer pointer;
typedef ptrdiff_t difference_type;
typedef XALAN_STD_QUALIFIER bidirectional_iterator_tag iterator_category;
typedef XalanListIteratorBase<XalanListIteratorTraits<value_type>, Node> iterator;
XalanListIteratorBase(Node& node) :
currentNode(&node)
{
}
XalanListIteratorBase(const iterator& theRhs) :
currentNode(theRhs.currentNode)
{
}
XalanListIteratorBase operator++()
{
currentNode = currentNode->next;
return *this;
}
XalanListIteratorBase operator++(int)
{
Node& origNode = *currentNode;
currentNode = currentNode->next;
return XalanListIteratorBase(origNode);
}
XalanListIteratorBase operator--()
{
currentNode = currentNode->prev;
return *this;
}
XalanListIteratorBase operator-(difference_type decrement) const
{
Node* node = currentNode;
while (decrement > 0)
{
node = node->prev;
--decrement;
};
return XalanListIteratorBase(*node);
}
reference operator*() const
{
return currentNode->value;
}
pointer operator->() const
{
return ¤tNode->value;
}
const XalanListIteratorBase & operator=(const XalanListIteratorBase& theRhs)
{
currentNode = theRhs.currentNode;
return *this;
}
bool operator!=(const XalanListIteratorBase& theRhs) const
{
return !operator==(theRhs);
}
bool operator==(const XalanListIteratorBase& theRhs) const
{
return currentNode == theRhs.currentNode;
}
Node& node()
{
return *currentNode;
}
Node* currentNode;
};
/**
* Xalan implementation of a doubly linked list
*/
template <class Type>
class XalanList
{
public:
typedef Type value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
typedef XalanList<value_type> ThisType;
struct Node
{
Node(
const value_type & theValue,
Node& prevNode,
Node& nextNode) :
value(theValue),
prev(&prevNode),
next(&nextNode)
{
}
value_type value;
Node* prev;
Node* next;
};
typedef XalanListIteratorBase<XalanListIteratorTraits<value_type>, Node> iterator;
typedef XalanListIteratorBase<XalanListConstIteratorTraits<value_type>, Node> const_iterator;
#if defined(XALAN_HAS_STD_ITERATORS)
typedef XALAN_STD_QUALIFIER reverse_iterator<iterator> reverse_iterator_;
typedef XALAN_STD_QUALIFIER reverse_iterator<const_iterator> const_reverse_iterator_;
#elif defined(XALAN_RW_NO_CLASS_PARTIAL_SPEC)
typedef XALAN_STD_QUALIFIER reverse_iterator<
iterator,
XALAN_STD_QUALIFIER bidirectional_iterator_tag,
value_type> reverse_iterator_;
typedef XALAN_STD_QUALIFIER reverse_iterator<
const_iterator,
XALAN_STD_QUALIFIER bidirectional_iterator_tag,
const value_type> const_reverse_iterator_;
#else
typedef XALAN_STD_QUALIFIER reverse_iterator<iterator, value_type> reverse_iterator_;
typedef XALAN_STD_QUALIFIER reverse_iterator<const_iterator, value_type, const_reference> const_reverse_iterator_;
#endif
typedef reverse_iterator_ reverse_iterator;
typedef const_reverse_iterator_ const_reverse_iterator;
typedef typename MemoryManagedConstructionTraits<value_type>::Constructor Constructor;
XalanList(
MemoryManagerType& theManager) :
m_memoryManager(&theManager),
m_listHead(0),
m_freeListHeadPtr(0)
{
}
~XalanList()
{
if (m_listHead != 0)
{
iterator pos = begin();
while (pos != end())
{
destroyNode(pos++.node());
}
Node * freeNode = m_freeListHeadPtr;
while (freeNode != 0)
{
Node * nextNode = freeNode->next;
deallocate(freeNode);
freeNode = nextNode;
}
deallocate(m_listHead);
}
}
MemoryManagerType&
getMemoryManager()
{
assert(m_memoryManager != 0 );
return *m_memoryManager;
}
const MemoryManagerType&
getMemoryManager() const
{
assert(m_memoryManager != 0 );
return *m_memoryManager;
}
iterator
begin()
{
return iterator(*(getListHead().next));
}
const_iterator
begin() const
{
return const_iterator(*(getListHead().next));
}
iterator
end()
{
return iterator(getListHead());
}
const_iterator
end() const
{
return const_iterator(getListHead());
}
reverse_iterator
rbegin()
{
return reverse_iterator(end());
}
const_reverse_iterator
rbegin() const
{
return const_reverse_iterator(end());
}
reverse_iterator
rend()
{
return reverse_iterator(begin());
}
const_reverse_iterator
rend() const
{
return const_reverse_iterator(begin());
}
reference
front()
{
return *begin();
}
reference
back()
{
return *(--end());
}
size_type
size() const
{
size_type size = 0;
const_iterator item = begin();
while (item != end())
{
++size;
++item;
}
return size;
}
bool
empty() const
{
return (begin() == end()) != 0;
}
void
push_back(const value_type& data)
{
constructNode(data, end());
}
void
push_front(const value_type& data)
{
constructNode(data, begin());
}
void
pop_front()
{
erase(begin());
}
void
pop_back()
{
erase(--end());
}
iterator
insert(const iterator& pos, const value_type& value)
{
return iterator(constructNode(value,pos));
}
void
erase(iterator pos)
{
assert(pos != end());
freeNode(pos.node());
}
void
splice(
iterator pos,
#if defined(NDEBUG)
ThisType& /* list */,
#else
ThisType& list,
#endif
iterator toInsert)
{
assert(m_memoryManager == list.m_memoryManager);
if (pos != toInsert)
{
Node & posNode = pos.node();
Node & toInsertNode = toInsert.node();
toInsertNode.prev->next = toInsertNode.next;
toInsertNode.next->prev = toInsertNode.prev;
toInsertNode.prev = posNode.prev;
toInsertNode.next = &posNode;
posNode.prev->next = &toInsertNode;
posNode.prev = &toInsertNode;
}
}
void
splice(
iterator pos,
#if defined(NDEBUG)
ThisType& /* list */,
#else
ThisType& list,
#endif
iterator toInsertFirst,
iterator toInsertLast)
{
assert(m_memoryManager == list.m_memoryManager);
if (toInsertFirst != toInsertLast)
{
Node & posNode = pos.node();
Node & toInsertFirstNode = toInsertFirst.node();
Node & toInsertLastNode = *(toInsertLast.node().prev);
toInsertFirstNode.prev->next = toInsertLastNode.next;
toInsertLastNode.next->prev = toInsertFirstNode.prev;
toInsertFirstNode.prev = posNode.prev;
toInsertLastNode.next = &posNode;
posNode.prev->next = &toInsertFirstNode;
posNode.prev = &toInsertLastNode;
}
}
void
clear()
{
iterator pos = begin();
while (pos != end())
{
freeNode(pos++.node());
}
}
void swap(ThisType& theRHS)
{
#if defined(XALAN_NO_STD_NAMESPACE)
::swap(m_memoryManager, theRHS.m_memoryManager);
::swap(m_listHead, theRHS.m_listHead);
::swap(m_freeListHeadPtr, theRHS.m_freeListHeadPtr);
#else
XALAN_STD_QUALIFIER swap(m_memoryManager, theRHS.m_memoryManager);
XALAN_STD_QUALIFIER swap(m_listHead, theRHS.m_listHead);
XALAN_STD_QUALIFIER swap(m_freeListHeadPtr, theRHS.m_freeListHeadPtr);
#endif
}
protected:
Node& constructNode(const value_type& data, iterator pos)
{
Node * newNode = 0;
Node * nextFreeNode = 0;
if (m_freeListHeadPtr != 0)
{
newNode = m_freeListHeadPtr;
nextFreeNode = m_freeListHeadPtr->next;
}
else
{
m_freeListHeadPtr = allocate(1);
newNode = m_freeListHeadPtr;
}
Constructor::construct(&newNode->value, data, *m_memoryManager);
new (&newNode->prev) Node*(pos.node().prev);
new (&newNode->next) Node*(&(pos.node()));
pos.node().prev->next = newNode;
pos.node().prev = newNode;
m_freeListHeadPtr = nextFreeNode;
return *newNode;
}
void freeNode(Node& node)
{
node.prev->next = node.next;
node.next->prev = node.prev;
node.~Node();
node.prev = 0;
node.next = m_freeListHeadPtr;
m_freeListHeadPtr = &node;
}
void destroyNode(Node& node)
{
assert(&node != m_listHead);
node.~Node();
deallocate(&node);
}
Node& getListHead()
{
if (0 == m_listHead)
{
m_listHead = allocate(1);
m_listHead->next = m_listHead;
m_listHead->prev = m_listHead;
}
return *m_listHead;
}
Node& getListHead() const
{
return const_cast<XalanList*>(this)->getListHead();
}
Node*
allocate(size_type size)
{
const size_type theBytesNeeded = size * sizeof(Node);
assert(m_memoryManager != 0);
void* pointer = m_memoryManager->allocate(theBytesNeeded);
assert( pointer != 0 );
return (Node*) pointer;
}
void
deallocate(Node* pointer)
{
assert(m_memoryManager != 0);
m_memoryManager->deallocate(pointer);
}
MemoryManagerType * m_memoryManager;
Node* m_listHead;
Node* m_freeListHeadPtr;
private:
// not defined
XalanList();
XalanList(const XalanList& theRhs);
XalanList& operator=(const XalanList& theRhs);
};
XALAN_CPP_NAMESPACE_END
#endif // XALANLIST_HEADER_GUARD_1357924680
Index: XalanAutoPtr.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/XalanAutoPtr.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** XalanAutoPtr.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- XalanAutoPtr.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(XALANAUTOPTR_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(XALANAUTOPTR_HEADER_GUARD_1357924680)
--- NEW FILE: XalanDeque.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Matthew Hoyt (mhoyt at ca.ibm.com)
*/
#if !defined(XALANDEQUE_HEADER_GUARD_1357924680)
#define XALANDEQUE_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <xalanc/Include/PlatformDefinitions.hpp>
#include <xalanc/Include/XalanVector.hpp>
#include <xalanc/Include/XalanMemoryManagement.hpp>
XALAN_CPP_NAMESPACE_BEGIN
template <class Value>
struct XalanDequeIteratorTraits
{
typedef Value value_type;
typedef Value& reference;
typedef Value* pointer;
typedef const Value& const_reference;
};
template <class Value>
struct XalanDequeConstIteratorTraits
{
typedef Value value_type;
typedef const Value& reference;
typedef const Value* pointer;
typedef const Value& const_reference;
};
template <class XalanDequeTraits, class XalanDeque>
struct XalanDequeIterator
{
typedef size_t size_type;
typedef typename XalanDequeTraits::value_type value_type;
typedef typename XalanDequeTraits::reference reference;
typedef typename XalanDequeTraits::pointer pointer;
typedef typename XalanDequeTraits::const_reference const_reference;
typedef ptrdiff_t difference_type;
typedef XalanDequeIterator<XalanDequeIteratorTraits<value_type>, XalanDeque> Iterator;
typedef XALAN_STD_QUALIFIER random_access_iterator_tag iterator_category;
XalanDequeIterator(XalanDeque* deque,
size_type pos) :
m_deque(deque),
m_pos(pos)
{
}
XalanDequeIterator(const Iterator & iterator) :
m_deque(iterator.m_deque),
m_pos(iterator.m_pos)
{
}
XalanDequeIterator& operator=(const Iterator & iterator)
{
m_deque = iterator.m_deque;
m_pos = iterator.m_pos;
return *this;
}
XalanDequeIterator& operator++()
{
++m_pos;
return *this;
}
XalanDequeIterator operator++(int)
{
XalanDequeIterator temp = *this;
++m_pos;
return temp;
}
XalanDequeIterator& operator--()
{
--m_pos;
return *this;
}
pointer operator->()
{
return &(*m_deque[m_pos]);
}
reference operator*()
{
return (*m_deque)[m_pos];
}
const_reference operator*() const
{
return (*m_deque)[m_pos];
}
XalanDequeIterator operator+(difference_type difference) const
{
return XalanDequeIterator(m_deque, m_pos + difference);
}
XalanDequeIterator operator-(difference_type difference) const
{
return XalanDequeIterator(m_deque, m_pos - difference);
}
difference_type operator-(const XalanDequeIterator &theRhs) const
{
return m_pos - theRhs.m_pos;
}
bool operator==(const XalanDequeIterator & theRhs) const
{
return (theRhs.m_deque == m_deque)
&& theRhs.m_pos == m_pos;
}
bool operator!=(const XalanDequeIterator & theRhs) const
{
return !(theRhs == *this);
}
XalanDeque* m_deque;
size_type m_pos;
};
/**
* Xalan implementation of deque
*/
template <class Type, class ConstructionTraits = MemoryManagedConstructionTraits<Type> >
class XalanDeque
{
public:
typedef size_t size_type;
typedef Type value_type;
typedef Type& reference;
typedef const Type& const_reference;
typedef XalanVector<Type, ConstructionTraits> BlockType;
typedef XalanVector<BlockType*> BlockIndexType;
typedef XalanDeque<Type, ConstructionTraits> ThisType;
typedef XalanDequeIterator<XalanDequeIteratorTraits<value_type>, ThisType> iterator;
typedef XalanDequeIterator<XalanDequeConstIteratorTraits<value_type>, ThisType> const_iterator;
#if defined(XALAN_HAS_STD_ITERATORS)
typedef XALAN_STD_QUALIFIER reverse_iterator<iterator> reverse_iterator_;
typedef XALAN_STD_QUALIFIER reverse_iterator<const_iterator> const_reverse_iterator_;
#elif defined(XALAN_RW_NO_CLASS_PARTIAL_SPEC)
typedef XALAN_STD_QUALIFIER reverse_iterator<
iterator,
XALAN_STD_QUALIFIER random_access_iterator_tag,
value_type> reverse_iterator_;
typedef XALAN_STD_QUALIFIER reverse_iterator<
const_iterator,
XALAN_STD_QUALIFIER random_access_iterator_tag,
const value_type> const_reverse_iterator_;
#else
typedef XALAN_STD_QUALIFIER reverse_iterator<iterator, value_type> reverse_iterator_;
typedef XALAN_STD_QUALIFIER reverse_iterator<const_iterator, value_type, const_reference> const_reverse_iterator_;
#endif
typedef reverse_iterator_ reverse_iterator;
typedef const_reverse_iterator_ const_reverse_iterator;
XalanDeque(
MemoryManagerType& memoryManager,
size_type initialSize = 0,
size_type blockSize = 10) :
m_memoryManager(&memoryManager),
m_blockSize(blockSize),
m_blockIndex(memoryManager,
initialSize / blockSize + (initialSize % blockSize == 0 ? 0 : 1)),
m_freeBlockVector(memoryManager)
{
typename ConstructionTraits::Constructor::ConstructableType defaultValue(*m_memoryManager);
XALAN_STD_QUALIFIER fill_n(XALAN_STD_QUALIFIER back_inserter(*this), initialSize, defaultValue.value);
}
XalanDeque(const XalanDeque& theRhs, MemoryManagerType& memoryManager) :
m_memoryManager(&memoryManager),
m_blockSize(theRhs.m_blockSize),
m_blockIndex(*theRhs.m_memoryManager,
theRhs.size() / theRhs.m_blockSize + (theRhs.size() % theRhs.m_blockSize == 0 ? 0 : 1)),
m_freeBlockVector(memoryManager)
{
XALAN_STD_QUALIFIER copy(theRhs.begin(), theRhs.end(), XALAN_STD_QUALIFIER back_inserter(*this));
}
static XalanDeque*
create(
MemoryManagerType& theManager,
size_type initialSize = 0,
size_type blockSize = 10)
{
typedef XalanDeque ThisType;
XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
ThisType* theResult = theGuard.get();
new (theResult) ThisType(theManager, initialSize, blockSize);
theGuard.release();
return theResult;
}
~XalanDeque()
{
clear();
typename BlockIndexType::iterator iter = m_freeBlockVector.begin();
while (iter != m_freeBlockVector.end())
{
(*iter)->~XalanVector<Type, ConstructionTraits>();
deallocate(*iter);
++iter;
}
}
iterator begin()
{
return iterator(this, 0);
}
const_iterator begin() const
{
return const_iterator(const_cast<XalanDeque*>(this), 0);
}
iterator end()
{
return iterator(this, size());
}
const_iterator end() const
{
return const_iterator(const_cast<XalanDeque*>(this), size());
}
const_reverse_iterator rbegin() const
{
return const_reverse_iterator(end());
}
const_reverse_iterator rend() const
{
return const_reverse_iterator(begin());
}
bool empty() const
{
return m_blockIndex.empty();
}
size_type size() const
{
if (m_blockIndex.empty())
{
return 0;
}
else
{
return (m_blockIndex.size() - 1) * m_blockSize
+ m_blockIndex.back()->size();
}
}
value_type& back()
{
return m_blockIndex.back()->back();
}
value_type& operator[](size_type index)
{
BlockType & block = *(m_blockIndex[index / m_blockSize]);
return block[index % m_blockSize];
}
const value_type& operator[](size_type index) const
{
BlockType & block = *(m_blockIndex[index / m_blockSize]);
return block[index % m_blockSize];
}
void clear()
{
typename BlockIndexType::iterator iter = m_blockIndex.begin();
m_freeBlockVector.reserve(m_freeBlockVector.size() + m_blockIndex.size());
while (iter != m_blockIndex.end())
{
(*iter)->clear();
m_freeBlockVector.push_back(*iter);
++iter;
}
m_blockIndex.clear();
}
void push_back(const value_type & value)
{
if (m_blockIndex.empty() ||
m_blockIndex.back()->size() >= m_blockSize)
{
m_blockIndex.push_back(getNewBlock());
}
m_blockIndex.back()->push_back(value);
}
void pop_back()
{
BlockType & lastBlock = *(m_blockIndex.back());
lastBlock.pop_back();
if (lastBlock.empty())
{
m_freeBlockVector.push_back(&lastBlock);
m_blockIndex.pop_back();
}
}
void resize(size_type newSize)
{
typename ConstructionTraits::Constructor::ConstructableType defaultValue(*m_memoryManager);
if (newSize > size())
{
for (size_type i = 0; i < newSize - size(); ++i)
{
push_back(defaultValue.value);
}
}
else
{
for (size_type i = 0; i < size() - newSize; ++i)
{
pop_back();
}
}
}
void swap(XalanDeque& theRhs)
{
MemoryManagerType* tempMemoryManager = m_memoryManager;
m_memoryManager = theRhs.m_memoryManager;
theRhs.m_memoryManager = tempMemoryManager;
theRhs.m_blockIndex.swap(m_blockIndex);
theRhs.m_freeBlockVector.swap(m_freeBlockVector);
}
XalanDeque & operator=(const XalanDeque & theRhs)
{
clear();
XALAN_STD_QUALIFIER copy(theRhs.begin(), theRhs.end(), XALAN_STD_QUALIFIER back_inserter(*this));
return *this;
}
MemoryManagerType&
getMemoryManager()
{
assert (m_memoryManager != 0);
return *m_memoryManager;
}
protected:
BlockType* getNewBlock()
{
BlockType * newBlock;
if (m_freeBlockVector.empty())
{
newBlock = allocate(1);
new (&*newBlock) BlockType(*m_memoryManager, m_blockSize);
}
else
{
newBlock = m_freeBlockVector.back();
m_freeBlockVector.pop_back();
}
assert (newBlock != 0);
return newBlock;
}
BlockType*
allocate(size_type size)
{
const size_type theBytesNeeded = size * sizeof(BlockType);
BlockType* pointer = (BlockType*)m_memoryManager->allocate(theBytesNeeded);
assert(pointer != 0);
return pointer;
}
void
deallocate(BlockType* pointer)
{
m_memoryManager->deallocate(pointer);
}
MemoryManagerType* m_memoryManager;
const size_type m_blockSize;
BlockIndexType m_blockIndex;
BlockIndexType m_freeBlockVector;
private:
// Not implemented
XalanDeque();
XalanDeque(const XalanDeque&);
};
XALAN_CPP_NAMESPACE_END
#endif // XALANDEQUE_HEADER_GUARD_1357924680
Index: VCPPDefinitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/VCPPDefinitions.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** VCPPDefinitions.hpp 12 Oct 2004 21:06:06 -0000 1.3
--- VCPPDefinitions.hpp 19 Feb 2008 20:14:03 -0000 1.4
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(VCPPDEFINITIONS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(VCPPDEFINITIONS_HEADER_GUARD_1357924680)
***************
*** 59,63 ****
! #pragma warning(disable: 4127 4251 4511 4512 4514 4702 4710 4711 4786 4097; error: 4150 4172 4238 4239 4715)
--- 18,22 ----
! #pragma warning(disable: 4127 4251 4511 4512 4514 4702 4710 4711 4786 4097 4503 4786; error: 4150 4172 4238 4239 4715)
***************
*** 74,85 ****
! #if __INTEL_COMPILER >= 600
! #define XALAN_INLINE_INITIALIZATION
! #elif _MSC_VER >= 1300
! #define XALAN_INLINE_INITIALIZATION
! #define XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG
! #define XALAN_NEW_STD_ALLOCATOR
#else
! #define XALAN_NO_COVARIANT_RETURN_TYPE
#endif
--- 33,49 ----
! #if _MSC_VER >= 1300
! #define XALAN_INLINE_INITIALIZATION
! #if !defined(__INTEL_COMPILER)
! #define XALAN_INLINE_INITIALIZATION_IS_DEFINITION_BUG
! #endif
! #define XALAN_NEW_STD_ALLOCATOR
! #define XALAN_HAS_STD_ITERATORS
! #if _MSC_VER == 1300
! #define XALAN_VCPP_USE_PTRIT
! #endif
#else
! #define XALAN_REQUIRES_QUALIFIED_DESTRUCTOR
! #define XALAN_NO_COVARIANT_RETURN_TYPE
#endif
***************
*** 87,94 ****
#define XALAN_NEWLINE_IS_CRLF
#define XALAN_HAS_CPP_NAMESPACE
! //#define XALAN_CLASSIC_IOSTREAMS //GME
! //#define XALAN_NO_STD_NAMESPACE //GME
! //#define XALAN_NO_STD_ALLOCATORS //GME
! #define XALAN_UNALIGNED
#endif // VCPPDEFINITIONS_HEADER_GUARD_1357924680
--- 51,57 ----
#define XALAN_NEWLINE_IS_CRLF
#define XALAN_HAS_CPP_NAMESPACE
! #define XALAN_HAS_STD_DISTANCE
! #define XALAN_NO_REENTRANT_TIME_FUNCTIONS
!
#endif // VCPPDEFINITIONS_HEADER_GUARD_1357924680
Index: IntelDefinitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/IntelDefinitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** IntelDefinitions.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- IntelDefinitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(INTELDEFINITIONS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(INTELDEFINITIONS_HEADER_GUARD_1357924680)
***************
*** 73,82 ****
#define XALAN_HAS_CPP_NAMESPACE
#define XALAN_XALANDOMCHAR_USHORT_MISMATCH
#define XALAN_POSIX2_AVAILABLE
#define XALAN_INLINE_INITIALIZATION
-
- #define XALAN_UNALIGNED
--- 32,41 ----
+ #define XALAN_HAS_STD_ITERATORS
+ #define XALAN_HAS_STD_DISTANCE
#define XALAN_HAS_CPP_NAMESPACE
#define XALAN_XALANDOMCHAR_USHORT_MISMATCH
#define XALAN_POSIX2_AVAILABLE
#define XALAN_INLINE_INITIALIZATION
--- NEW FILE: XalanMemoryManagement.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680)
#define XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <xalanc/Include/PlatformDefinitions.hpp>
#include <cstddef>
#include <new>
#include <xercesc/framework/MemoryManager.hpp>
XALAN_CPP_NAMESPACE_BEGIN
typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType;
XALAN_USING_XERCES(MemoryManager)
class XalanAllocationGuard
{
public:
#if defined(XALAN_STRICT_ANSI_HEADERS)
typedef std::size_t size_type;
#else
typedef size_t size_type;
#endif
XalanAllocationGuard(
MemoryManager& theMemoryManager,
void* thePointer) :
m_memoryManager(theMemoryManager),
m_pointer(thePointer)
{
}
XalanAllocationGuard(
MemoryManager& theMemoryManager,
size_type theSize) :
m_memoryManager(theMemoryManager),
m_pointer(theMemoryManager.allocate(theSize))
{
}
~XalanAllocationGuard()
{
if (m_pointer != 0)
{
m_memoryManager.deallocate(m_pointer);
}
}
void*
get() const
{
return m_pointer;
}
void
release()
{
m_pointer = 0;
}
private:
// Data members...
MemoryManager& m_memoryManager;
void* m_pointer;
};
template<class Type>
void
XalanDestroy(Type& theArg)
{
theArg.~Type();
}
template<class Type>
void
XalanDestroy(Type* theArg)
{
if (theArg != 0)
{
theArg->~Type();
}
}
template<class Type>
void
XalanDestroy(
MemoryManager& theMemoryManager,
Type* theArg)
{
if (theArg != 0)
{
XalanDestroy(*theArg);
theMemoryManager.deallocate(theArg);
}
}
template<class Type>
void
XalanDestroy(
MemoryManager& theMemoryManager,
Type& theArg)
{
XalanDestroy(theArg);
theMemoryManager.deallocate(&theArg);
}
template<class Type>
Type*
XalanConstruct(
MemoryManager& theMemoryManager,
Type*& theInstance)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
theInstance =
new (theGuard.get()) Type;
theGuard.release();
return theInstance;
}
template<
class Type,
class Param1Type>
Type*
XalanConstruct(
MemoryManager& theMemoryManager,
Type*& theInstance,
const Param1Type& theParam1)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
theInstance =
new (theGuard.get()) Type(theParam1);
theGuard.release();
return theInstance;
}
template<
class Type,
class Param1Type>
Type*
XalanConstruct(
MemoryManager& theMemoryManager,
Type*& theInstance,
Param1Type& theParam1)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
theInstance =
new (theGuard.get()) Type(theParam1);
theGuard.release();
return theInstance;
}
template<
class Type,
class Param1Type,
class Param2Type>
Type*
XalanConstruct(
MemoryManager& theMemoryManager,
Type*& theInstance,
Param1Type& theParam1,
const Param2Type& theParam2)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
theInstance =
new (theGuard.get()) Type(theParam1, theParam2);
theGuard.release();
return theInstance;
}
template<
class Type,
class Param1Type,
class Param2Type,
class Param3Type>
Type*
XalanConstruct(
MemoryManager& theMemoryManager,
Type*& theInstance,
Param1Type& theParam1,
const Param2Type& theParam2,
Param3Type& theParam3)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
theInstance =
new (theGuard.get()) Type(theParam1, theParam2, theParam3);
theGuard.release();
return theInstance;
}
template<
class Type,
class Param1Type,
class Param2Type,
class Param3Type,
class Param4Type,
class Param5Type>
Type*
XalanConstruct(
MemoryManager& theMemoryManager,
Type*& theInstance,
Param1Type& theParam1,
Param2Type& theParam2,
const Param3Type& theParam3,
const Param4Type& theParam4,
const Param5Type& theParam5)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
theInstance =
new (theGuard.get()) Type(theParam1, theParam2, theParam3, theParam4, theParam5);
theGuard.release();
return theInstance;
}
template<
class Type,
class Param1Type,
class Param2Type,
class Param3Type,
class Param4Type,
class Param5Type,
class Param6Type>
Type*
XalanConstruct(
MemoryManager& theMemoryManager,
Type*& theInstance,
Param1Type& theParam1,
Param2Type& theParam2,
const Param3Type& theParam3,
const Param4Type& theParam4,
const Param5Type& theParam5,
const Param6Type& theParam6)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
theInstance =
new (theGuard.get()) Type(theParam1, theParam2, theParam3, theParam4, theParam5, theParam6);
theGuard.release();
return theInstance;
}
template<class Type>
Type*
XalanCopyConstruct(
MemoryManager& theMemoryManager,
const Type& theSource)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
Type* const theInstance =
new (theGuard.get()) Type(theSource);
theGuard.release();
return theInstance;
}
template<
class Type,
class Param1Type>
Type*
XalanCopyConstruct(
MemoryManager& theMemoryManager,
const Type& theSource,
Param1Type& theParam1)
{
XalanAllocationGuard theGuard(
theMemoryManager,
sizeof(Type));
Type* const theInstance =
new (theGuard.get()) Type(theSource, theParam1);
theGuard.release();
return theInstance;
}
class XALAN_PLATFORM_EXPORT XalanMemMgrs
{
public:
static MemoryManager&
getDummyMemMgr();
static MemoryManager&
getDefaultXercesMemMgr();
static MemoryManager&
getDefault()
{
return getDefaultXercesMemMgr();
}
};
#if defined (XALAN_DEVELOPMENT)
#define XALAN_DEFAULT_CONSTRUCTOR_MEMORY_MGR
#define XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR
#define XALAN_DEFAULT_MEMMGR = XalanMemMgrs::getDummyMemMgr()
#else
#define XALAN_DEFAULT_CONSTRUCTOR_MEMORY_MGR = XalanMemMgrs::getDefaultXercesMemMgr()
#define XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR XALAN_DEFAULT_CONSTRUCTOR_MEMORY_MGR
#define XALAN_DEFAULT_MEMMGR = XalanMemMgrs::getDefaultXercesMemMgr()
#endif
template <class C>
struct ConstructValueWithNoMemoryManager
{
ConstructValueWithNoMemoryManager(MemoryManager& /*mgr*/) :
value()
{
}
C value;
};
template <class C>
struct ConstructValueWithMemoryManager
{
ConstructValueWithMemoryManager(MemoryManager& mgr) :
value(mgr)
{
}
C value;
};
template <class C>
struct ConstructWithNoMemoryManager
{
typedef ConstructValueWithNoMemoryManager<C> ConstructableType;
static C* construct(C* address, MemoryManager& /* mgr */)
{
return (C*) new (address) C;
}
static C* construct(C* address, const C& theRhs, MemoryManager& /* mgr */)
{
return (C*) new (address) C(theRhs);
}
};
template <class C>
struct ConstructWithMemoryManager
{
typedef ConstructValueWithMemoryManager<C> ConstructableType;
static C* construct(C* address, MemoryManager& mgr)
{
return (C*) new (address) C(mgr);
}
static C* construct(C* address, const C& theRhs, MemoryManager& mgr)
{
return (C*) new (address) C(theRhs, mgr);
}
};
template <class C>
struct MemoryManagedConstructionTraits
{
typedef ConstructWithNoMemoryManager<C> Constructor;
};
#define XALAN_USES_MEMORY_MANAGER(Type) \
template<> \
struct MemoryManagedConstructionTraits<Type> \
{ \
typedef ConstructWithMemoryManager<Type> Constructor; \
};
template <class C>
struct ConstructWithMemoryManagerTraits
{
typedef ConstructWithMemoryManager<C> Constructor;
};
template <class C>
struct ConstructWithNoMemoryManagerTraits
{
typedef ConstructWithNoMemoryManager<C> Constructor;
};
XALAN_CPP_NAMESPACE_END
#endif // XALANMEMORYMANAGEMENT_HEADER_GUARD_1357924680
--- NEW FILE: XalanMemMgrAutoPtr.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(XALANMEMMGRAUTOPTR_HEADER_GUARD_1357924680)
#define XALANMEMMGRAUTOPTR_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
#include <xalanc/Include/XalanMemoryManagement.hpp>
#include <cstddef>
#include <cassert>
#include <utility>
XALAN_CPP_NAMESPACE_BEGIN
XALAN_USING_XERCES(MemoryManager)
// An auto_ptr-like class that supports the MemoryManager class.
template<
class Type,
bool toCallDestructor = true>
class XalanMemMgrAutoPtr
{
public:
typedef XALAN_STD_QUALIFIER pair<MemoryManager*, Type*> AutoPtrPairType;
class MemMgrAutoPtrData : public AutoPtrPairType
{
public:
MemMgrAutoPtrData():
AutoPtrPairType(0,0)
{
}
MemMgrAutoPtrData(
MemoryManager* memoryManager,
Type* dataPointer):
AutoPtrPairType(memoryManager, dataPointer)
{
invariants();
}
bool
isInitilized()const
{
return this->first != 0 && this->second != 0;
}
void
deallocate()
{
invariants();
if ( isInitilized() )
{
if ( toCallDestructor )
{
this->second->~Type();
}
this->first->deallocate(this->second);
}
}
void
reset(
MemoryManager* memoryManager ,
Type* dataPointer)
{
invariants();
this->first = memoryManager;
this->second = dataPointer;
invariants();
}
private:
void
invariants() const
{
assert(
isInitilized() ||
(this->first == 0 && this->second == 0));
}
};
XalanMemMgrAutoPtr(
MemoryManager& theManager,
Type* ptr) :
m_pointerInfo(&theManager, ptr)
{
}
XalanMemMgrAutoPtr() :
m_pointerInfo()
{
}
XalanMemMgrAutoPtr(const XalanMemMgrAutoPtr<Type, toCallDestructor>& theSource) :
m_pointerInfo(((XalanMemMgrAutoPtr<Type>&)theSource).release())
{
}
XalanMemMgrAutoPtr<Type,toCallDestructor>&
operator=(XalanMemMgrAutoPtr<Type,toCallDestructor>& theRHS)
{
if (this != &theRHS)
{
m_pointerInfo.deallocate();
m_pointerInfo = theRHS.release();
}
return *this;
}
~XalanMemMgrAutoPtr()
{
m_pointerInfo.deallocate();
}
Type&
operator*() const
{
return *m_pointerInfo.second;
}
Type*
operator->() const
{
return m_pointerInfo.second;
}
Type*
get() const
{
return m_pointerInfo.second;
}
MemoryManager*
getMemoryManager()
{
return m_pointerInfo.first;
}
const MemoryManager*
getMemoryManager() const
{
return m_pointerInfo.first;
}
MemMgrAutoPtrData
release()
{
MemMgrAutoPtrData tmp = m_pointerInfo;
m_pointerInfo.reset(0, 0);
return MemMgrAutoPtrData(tmp);
}
Type*
releasePtr()
{
MemMgrAutoPtrData tmp = release();
return tmp.second;
}
void
reset(
MemoryManager* theManager = 0,
Type* thePointer = 0)
{
m_pointerInfo.deallocate();
m_pointerInfo.reset(theManager, thePointer);
}
private:
// data member
MemMgrAutoPtrData m_pointerInfo;
};
template<class Type>
class XalanMemMgrAutoPtrArray
{
public:
#if defined(XALAN_STRICT_ANSI_HEADERS)
typedef std::size_t size_type;
#else
typedef size_t size_type;
#endif
class MemMgrAutoPtrArrayData
{
public:
MemMgrAutoPtrArrayData():
m_memoryManager(0),
m_dataArray(0),
m_size(0)
{
}
MemMgrAutoPtrArrayData(
MemoryManager* memoryManager,
Type* dataPointer,
size_type size):
m_memoryManager(memoryManager),
m_dataArray(dataPointer),
m_size(size)
{
invariants();
}
bool
isInitilized()const
{
return m_memoryManager != 0 && m_dataArray != 0 && m_size != 0;
}
void
deallocate()
{
invariants();
if ( isInitilized() )
{
assert ( m_dataArray != 0 );
for ( size_type i = 0; i < m_size ; ++i )
{
m_dataArray[i].~Type();
}
m_memoryManager->deallocate(m_dataArray);
}
}
void
reset(
MemoryManager* theMemoryManager,
Type* thePointer,
size_type size)
{
invariants();
m_memoryManager = theMemoryManager;
m_dataArray = thePointer;
m_size = size;
invariants();
}
MemoryManager* m_memoryManager;
Type* m_dataArray;
size_type m_size;
private:
void
invariants()const
{
assert(
isInitilized() ||
(m_memoryManager == 0 && m_dataArray == 0 && m_size == 0));
}
};
XalanMemMgrAutoPtrArray(
MemoryManager& theManager,
Type* ptr,
size_type size) :
m_pointerInfo(
&theManager,
ptr,
size)
{
}
XalanMemMgrAutoPtrArray() :
m_pointerInfo()
{
}
XalanMemMgrAutoPtrArray(const XalanMemMgrAutoPtrArray<Type>& theSource) :
m_pointerInfo(((XalanMemMgrAutoPtr<Type>&)theSource).release())
{
}
XalanMemMgrAutoPtrArray<Type>&
operator=(XalanMemMgrAutoPtrArray<Type>& theRHS)
{
if (this != &theRHS)
{
m_pointerInfo.deallocate();
m_pointerInfo = theRHS.release();
}
return *this;
}
~XalanMemMgrAutoPtrArray()
{
m_pointerInfo.deallocate();
}
Type&
operator*() const
{
return *m_pointerInfo.m_dataArray;
}
Type*
operator->() const
{
return m_pointerInfo.m_dataArray;
}
Type*
get() const
{
return m_pointerInfo.m_dataArray;
}
size_type
getSize()const
{
return m_pointerInfo.m_size;
}
MemoryManager*
getMemoryManager()
{
return m_pointerInfo.m_memoryManager;
}
const MemoryManager*
getMemoryManager() const
{
return m_pointerInfo.m_memoryManager;
}
XalanMemMgrAutoPtrArray<Type>&
operator++ ()
{
++m_pointerInfo.m_size;
return *this;
}
/* Since this class is not reference-counted, I don't see how this
could work, since the destruction of the temporary will free
the controlled pointer.
XalanMemMgrAutoPtrArray<Type>
operator++ (int)
{
XalanMemMgrAutoPtrArray<Type> temp = *this;
++*this;
return temp;
}
*/
MemMgrAutoPtrArrayData
release()
{
MemMgrAutoPtrArrayData tmp = m_pointerInfo;
m_pointerInfo.reset(0, 0, 0);
return MemMgrAutoPtrArrayData(tmp);
}
Type*
releasePtr()
{
MemMgrAutoPtrArrayData tmp = release();
return tmp.m_dataArray;
}
void
reset(
MemoryManager* theManager = 0,
Type* thePointer = 0 ,
size_type size = 0)
{
m_pointerInfo.deallocate();
m_pointerInfo.reset(theManager, thePointer, size);
}
Type&
operator[](size_type index) const
{
return m_pointerInfo.m_dataArray[index];
}
private:
// data member
MemMgrAutoPtrArrayData m_pointerInfo;
};
XALAN_CPP_NAMESPACE_END
#endif // if !defined(XALANMEMMGRAUTOPTR_HEADER_GUARD_1357924680)
Index: GCCDefinitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/GCCDefinitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** GCCDefinitions.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- GCCDefinitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(GCCDEFINITIONS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(GCCDEFINITIONS_HEADER_GUARD_1357924680)
***************
*** 80,86 ****
#endif
- // As of 3.1, std::numeric_limits<double> is broken, so
- // we don't use it.
- #define XALAN_NO_STD_NUMERIC_LIMITS
#define XALAN_SGI_BASED_STL
#define XALAN_XALANDOMCHAR_USHORT_MISMATCH
--- 39,42 ----
***************
*** 88,93 ****
#define XALAN_INLINE_INITIALIZATION
#define XALAN_HAS_CPP_NAMESPACE
! #define XALAN_UNALIGNED
#endif // GCCDEFINITIONS_HEADER_GUARD_1357924680
--- 44,57 ----
#define XALAN_INLINE_INITIALIZATION
#define XALAN_HAS_CPP_NAMESPACE
+ #define XALAN_HAS_STD_ITERATORS
+ #define XALAN_HAS_STD_DISTANCE
! #define XALAN_NO_STD_NUMERIC_LIMITS
!
! #if defined(CYGWIN)
! #if defined(WIN32)
! #undef WIN32
! #endif
! #endif
#endif // GCCDEFINITIONS_HEADER_GUARD_1357924680
Index: XalanVersion.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/XalanVersion.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** XalanVersion.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- XalanVersion.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,56 ****
/*
! * The Apache Software License, Version 1.1
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache\@apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation, and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com . For more information
! * on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
***************
*** 158,162 ****
#define XALAN_VERSION_MAJOR 1
! #define XALAN_VERSION_MINOR 7
#define XALAN_VERSION_REVISION 0
--- 118,122 ----
#define XALAN_VERSION_MAJOR 1
! #define XALAN_VERSION_MINOR 10
#define XALAN_VERSION_REVISION 0
***************
*** 179,182 ****
--- 139,143 ----
#define CAT2_SEP_NIL(a, b) #a #b
#define CAT2_RAW_NUMERIC(a, b) a ## b
+ #define CAT2_RAW_NUMERIC_SEP_UNDERSCORE(a, b) a ## _ ## b
// two argument macro invokers
***************
*** 185,188 ****
--- 146,150 ----
#define INVK_CAT2_STR_SEP_NIL(a,b) CAT2_SEP_NIL(a,b)
#define INVK_CAT2_RAW_NUMERIC(a,b) CAT2_RAW_NUMERIC(a,b)
+ #define INVK_CAT2_RAW_NUMERIC_SEP_UNDERSCORE(a,b) CAT2_RAW_NUMERIC_SEP_UNDERSCORE(a,b)
// ---------------------------------------------------------------------------
Index: HPUXDefinitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/HPUXDefinitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** HPUXDefinitions.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- HPUXDefinitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
/* Patch from Trevor Smigiel */
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
/* Patch from Trevor Smigiel */
***************
*** 73,77 ****
#if defined(_HP_NAMESPACE_STD)
! #define XALAN_MODERN_STL
#else
#if defined(RWSTD_MULTI_THREAD) && !defined(__HPACC_THREAD_SAFE_RB_TREE)
--- 32,37 ----
#if defined(_HP_NAMESPACE_STD)
! #define XALAN_HAS_STD_ITERATORS
! #define XALAN_HAS_STD_DISTANCE
#else
#if defined(RWSTD_MULTI_THREAD) && !defined(__HPACC_THREAD_SAFE_RB_TREE)
***************
*** 82,86 ****
#define XALAN_NO_STD_ALLOCATORS
#define XALAN_SGI_BASED_STL
- #define XALAN_NO_STD_NUMERIC_LIMITS
#endif
--- 42,45 ----
***************
*** 90,94 ****
#define XALAN_INLINE_INITIALIZATION
- #define XALAN_UNALIGNED
--- 49,52 ----
--- NEW FILE: XalanSet.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Matthew Hoyt (mhoyt at ca.ibm.com)
*/
#if !defined(XALANSET_HEADER_GUARD_1357924680)
#define XALANSET_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <xalanc/Include/PlatformDefinitions.hpp>
#include <xalanc/Include/XalanMap.hpp>
#include <xalanc/Include/XalanMemoryManagement.hpp>
XALAN_CPP_NAMESPACE_BEGIN
template <class Value, class MapIterator>
struct XalanSetIterator
{
typedef Value value_type;
typedef Value& reference;
typedef Value* pointer;
XalanSetIterator(const MapIterator & iter) :
m_mapIterator(iter)
{
}
reference operator*() const
{
return m_mapIterator->first;
};
bool operator==(const XalanSetIterator& theRhs) const
{
return theRhs.m_mapIterator == m_mapIterator;
}
bool operator!=(const XalanSetIterator& theRhs) const
{
return !(theRhs == *this);
}
XalanSetIterator operator++()
{
++m_mapIterator;
return *this;
}
XalanSetIterator operator++(int)
{
XalanSetIterator orig(m_mapIterator);
++(*this);
return orig;
}
protected:
MapIterator m_mapIterator;
};
/**
* Xalan set implementation.
*
* Set relies on the XalanMap hashtable. Users must ensure the right key
* traits specialization is aviable to define the proper hash functor.
*/
template <class Value>
class XalanSet
{
public:
typedef Value value_type;
typedef size_t size_type;
typedef XalanMap<value_type, bool> SetMapType;
typedef XalanSetIterator<value_type, typename SetMapType::iterator> iterator;
typedef XalanSetIterator<const value_type, typename SetMapType::const_iterator> const_iterator;
XalanSet(MemoryManagerType& theMemoryManager) :
m_map(theMemoryManager)
{
}
XalanSet(const XalanSet& other,
MemoryManagerType& theMemoryManager) :
m_map(other.m_map, theMemoryManager)
{
}
MemoryManagerType&
getMemoryManager()
{
return m_map.getMemoryManager();
}
const_iterator begin() const
{
return m_map.begin();
}
const_iterator end() const
{
return m_map.end();
}
size_type size() const {
return m_map.size();
}
size_type count(const value_type & value) const
{
if (find(value) != end())
{
return 1;
}
else
{
return 0;
}
}
const_iterator find(const value_type& value) const
{
return m_map.find(value);
}
void insert(const value_type& value)
{
typedef typename SetMapType::value_type MapValueType;
m_map.insert(value, true);
}
size_type erase(const value_type& value)
{
return m_map.erase(value);
}
void clear()
{
m_map.clear();
}
SetMapType m_map;
};
XALAN_CPP_NAMESPACE_END
#endif // XALANSET_HEADER_GUARD_1357924680
--- NEW FILE: XalanMemMgrHelper.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(XALANMEMMGRHELPER_HEADER_GUARD_1357924680)
#define XALANMEMMGRHELPER_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
XALAN_CPP_NAMESPACE_BEGIN
template <class Type>
inline Type*
cloneObjWithMemMgr(const Type& other, MemoryManagerType& theManager)
{
XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type)));
Type* theResult = theGuard.get();
new (theResult) Type(other, theManager);
theGuard.release();
return theResult;
}
template <class Type>
inline Type*
cloneObj(const Type& other, MemoryManagerType& theManager)
{
XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type)));
Type* theResult = theGuard.get();
new (theResult) Type(other);
theGuard.release();
return theResult;
}
template <class Type>
class CreateObjFunctor
{
public:
Type*
operator()(MemoryManagerType& theManager)
{
XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type)));
Type* theResult = theGuard.get();
new (theResult) Type(theManager);
theGuard.release();
return theResult;
}
};
template <class Type>
inline void
destroyObjWithMemMgr(const Type* ptr, MemoryManagerType& theManager)
{
if (ptr != 0)
{
Type* const nonConstPointer =
#if defined(XALAN_OLD_STYLE_CASTS)
(const Type*)ptr;
#else
const_cast<Type*>(ptr);
#endif
nonConstPointer->~Type();
theManager.deallocate(nonConstPointer);
}
}
XALAN_CPP_NAMESPACE_END
#endif // if !defined(XALANMEMMGRHELPER_HEADER_GUARD_1357924680)
--- NEW FILE: XalanMap.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(XALANMAP_HEADER_GUARD_1357924680)
#define XALANMAP_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <xalanc/Include/PlatformDefinitions.hpp>
#include <cstddef>
#include <algorithm>
#include <functional>
#include <utility>
#include <xalanc/Include/XalanVector.hpp>
#include <xalanc/Include/XalanList.hpp>
XALAN_CPP_NAMESPACE_BEGIN
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4189)
#endif
typedef size_t size_type;
template <class Key>
class XalanHasher : public XALAN_STD_QUALIFIER unary_function<Key, size_type>
{
public:
size_type operator()(const Key& key) const
{
const char *byteArray = reinterpret_cast<const char*>(&key);
size_type result = 0;
for (size_type i = 0; i < sizeof(Key); ++i)
{
result = (result << 1) ^ byteArray[i];
}
return result;
}
};
template <class Key>
struct XalanMapKeyTraits
{
typedef XalanHasher<Key> Hasher;
typedef XALAN_STD_QUALIFIER equal_to<Key> Comparator;
};
template <class Key>
struct XalanHashMemberPointer
{
size_type operator() (const Key * key) const
{
assert (key != 0);
return key->hash();
}
};
template <class Key>
struct XalanHashMemberReference
{
size_type operator() (const Key& key) const
{
return key.hash();
}
};
template <class Value>
struct XalanMapIteratorTraits
{
typedef Value value_type;
typedef Value& reference;
typedef Value* pointer;
};
template <class Value>
struct XalanMapConstIteratorTraits
{
typedef Value value_type;
typedef const Value& reference;
typedef const Value* pointer;
};
template <class XalanMapTraits, class BaseIterator>
struct XalanMapIterator
{
typedef typename XalanMapTraits::value_type value_type;
typedef typename XalanMapTraits::reference reference;
typedef typename XalanMapTraits::pointer pointer;
typedef ptrdiff_t difference_type;
typedef XALAN_STD_QUALIFIER bidirectional_iterator_tag iterator_category;
typedef XalanMapIterator<
XalanMapIteratorTraits<value_type>,
BaseIterator> Iterator;
XalanMapIterator(const Iterator & theRhs) :
baseIterator(theRhs.baseIterator)
{
}
XalanMapIterator(const BaseIterator & theRhs) :
baseIterator(theRhs)
{
}
XalanMapIterator operator++(int)
{
XalanMapIterator temp(*this);
++baseIterator;
return temp;
}
XalanMapIterator& operator++()
{
++baseIterator;
return *this;
}
reference operator*() const
{
return *baseIterator->value;
}
pointer operator->() const
{
return baseIterator->value;
}
bool operator==(const XalanMapIterator& theRhs) const
{
return theRhs.baseIterator == baseIterator;
}
bool operator!=(const XalanMapIterator& theRhs) const
{
return !(theRhs == *this);
}
BaseIterator baseIterator;
};
/**
* Xalan implementation of a hashtable.
*
*/
template <
class Key,
class Value,
class KeyTraits = XalanMapKeyTraits<Key> >
class XalanMap
{
public:
/**
* Each map entry is stored in a linked list where an entry
* consists of a pointer to the key/value pair and a flag to indicate
* whether the entry has been erased.
* The hash buckets are a vector of pointers into the entry list.
* Deleted entries are spliced into another list and marked 'erased'.
*/
typedef Key key_type;
typedef Value data_type;
typedef size_t size_type;
typedef XALAN_STD_QUALIFIER pair<const key_type, data_type> value_type;
struct Entry
{
value_type* value;
bool erased;
Entry(value_type* theValue) :
value(theValue),
erased(false)
{
}
};
typedef XalanList<Entry> EntryListType;
typedef XalanVector<typename EntryListType::iterator> BucketType;
typedef XalanVector<BucketType, ConstructWithMemoryManagerTraits<BucketType> > BucketTableType;
typedef typename EntryListType::iterator EntryListIterator;
typedef typename BucketTableType::iterator TableIterator;
typedef typename BucketType::iterator BucketIterator;
typedef XalanMapIterator<
XalanMapIteratorTraits<value_type>,
typename EntryListType::iterator> iterator;
typedef XalanMapIterator<
XalanMapConstIteratorTraits<value_type>,
typename EntryListType::iterator> const_iterator;
typedef typename MemoryManagedConstructionTraits<key_type>::Constructor FirstConstructor;
typedef typename MemoryManagedConstructionTraits<data_type>::Constructor SecondConstructor;
enum
{
eDefaultMinBuckets = 29u,
eDefaultEraseThreshold = 50u,
eMinimumBucketSize = 5u
};
XalanMap(
MemoryManagerType& theMemoryManager,
float loadFactor = 0.75,
size_type minBuckets = eDefaultMinBuckets,
size_type eraseThreshold = eDefaultEraseThreshold) :
m_memoryManager(&theMemoryManager),
m_loadFactor(loadFactor),
m_minBuckets(minBuckets),
m_size(0),
m_entries(theMemoryManager),
m_freeEntries(theMemoryManager),
m_buckets(theMemoryManager),
m_eraseCount(0),
m_eraseThreshold(eraseThreshold)
{
}
XalanMap(
const XalanMap& theRhs,
MemoryManagerType& theMemoryManager) :
m_memoryManager(&theMemoryManager),
m_loadFactor(theRhs.m_loadFactor),
m_minBuckets(theRhs.m_minBuckets),
m_size(0),
m_entries(theMemoryManager),
m_freeEntries(theMemoryManager),
m_buckets(
size_type(m_loadFactor * theRhs.size()) + 1,
BucketType(*m_memoryManager),
theMemoryManager),
m_eraseCount(0),
m_eraseThreshold(theRhs.m_eraseThreshold)
{
const_iterator entry = theRhs.begin();
while(entry != theRhs.end())
{
insert(*entry);
++entry;
}
assert(m_size == theRhs.m_size);
}
MemoryManagerType&
getMemoryManager()
{
assert (m_memoryManager != 0);
return *m_memoryManager;
}
~XalanMap()
{
doRemoveEntries();
if (!m_buckets.empty())
{
EntryListIterator toRemove = m_freeEntries.begin();
while(toRemove != m_freeEntries.end())
{
deallocate(toRemove->value);
++toRemove;
}
}
}
XalanMap&
operator=(const XalanMap& theRhs)
{
XalanMap theTemp(theRhs, *m_memoryManager);
swap(theTemp);
return *this;
}
size_type size() const
{
return m_size;
}
bool empty() const
{
return m_size == 0;
}
iterator begin()
{
return m_entries.begin();
}
const_iterator begin() const
{
return const_cast<XalanMap*>(this)->begin();
}
iterator end()
{
return m_entries.end();
}
const_iterator end() const
{
return const_cast<XalanMap*>(this)->end();
}
iterator find(const key_type& key)
{
if (m_size != 0)
{
assert(m_buckets.empty() == false);
const size_type index = doHash(key);
assert(index < m_buckets.size());
BucketType& bucket = m_buckets[index];
BucketIterator pos = bucket.begin();
while (pos != bucket.end())
{
if (!(*pos)->erased && m_equals(key, (*pos)->value->first))
{
return iterator(*pos);
}
++pos;
}
}
return end();
}
const_iterator find(const key_type& key) const
{
return const_cast<XalanMap *>(this)->find(key);
}
data_type & operator[](const key_type& key)
{
iterator pos = find(key);
if (pos == end())
{
pos = doCreateEntry(key);
}
return (*pos).second;
}
void
insert(const value_type& value)
{
insert(value.first, value.second);
}
void insert(const key_type& key, const data_type& data)
{
const const_iterator pos = find(key);
if (pos == end())
{
doCreateEntry(key, &data);
}
}
void erase(iterator pos)
{
if (pos != end())
{
doErase(pos);
}
}
size_type erase(const key_type& key)
{
const iterator pos = find(key);
if (pos != end())
{
doErase(pos);
return 1;
}
else
{
return 0;
}
}
void clear()
{
doRemoveEntries();
TableIterator bucketPos = m_buckets.begin();
while (bucketPos != m_buckets.end())
{
bucketPos->clear();
++bucketPos;
}
m_eraseCount = 0;
assert(0 == m_size);
assert(m_entries.empty());
}
void swap(XalanMap& theRhs)
{
const size_type tempSize = m_size;
m_size = theRhs.m_size;
theRhs.m_size = tempSize;
MemoryManagerType* const tempMemoryManager = m_memoryManager;
m_memoryManager = theRhs.m_memoryManager;
theRhs.m_memoryManager = tempMemoryManager;
const size_type tempEraseCount = m_eraseCount;
m_eraseCount = theRhs.m_eraseCount;
theRhs.m_eraseCount = tempEraseCount;
const size_type tempEraseTheshold = m_eraseThreshold;
m_eraseThreshold = theRhs.m_eraseThreshold;
theRhs.m_eraseThreshold = tempEraseTheshold;
m_entries.swap(theRhs.m_entries);
m_freeEntries.swap(theRhs.m_freeEntries);
m_buckets.swap(theRhs.m_buckets);
}
protected:
iterator doCreateEntry(const key_type & key, const data_type* data = 0)
{
// if there are no buckets, create initial minimum set of buckets
if (m_buckets.empty())
{
m_buckets.insert(
m_buckets.begin(),
m_minBuckets,
BucketType(*m_memoryManager));
}
// if the load factor has been reached, rehash
if (size_type(m_loadFactor * size()) > m_buckets.size())
{
rehash();
}
const size_type index = doHash(key);
if (m_freeEntries.empty())
{
m_freeEntries.push_back(Entry(allocate(1)));
}
// insert a new entry as the first position in the bucket
Entry& newEntry = m_freeEntries.back();
newEntry.erased = false;
FirstConstructor::construct(
const_cast<key_type*>(&newEntry.value->first),
key,
*m_memoryManager);
if (data != 0)
{
SecondConstructor::construct(
&newEntry.value->second,
*data,
*m_memoryManager);
}
else
{
SecondConstructor::construct(
&newEntry.value->second,
*m_memoryManager);
}
m_entries.splice(m_entries.end(), m_freeEntries, --m_freeEntries.end());
m_buckets[index].push_back(--m_entries.end());
++m_size;
return iterator(--m_entries.end());
}
void doRemoveEntry(const iterator & toRemovePos)
{
value_type& toRemove = *toRemovePos;
#if defined(_MSC_VER) && _MSC_VER <= 1300
toRemove.value_type::~value_type();
#else
toRemove.~value_type();
#endif
m_freeEntries.splice(
m_freeEntries.end(),
m_entries,
toRemovePos.baseIterator);
toRemovePos.baseIterator->erased = true;
--m_size;
}
void
doRemoveEntries()
{
while(size() > 0)
{
doRemoveEntry(begin());
}
}
void
doErase(iterator pos)
{
assert(pos != end());
doRemoveEntry(pos);
++m_eraseCount;
if (m_eraseCount == m_eraseThreshold)
{
compactBuckets();
m_eraseCount = 0;
}
}
size_type
doHash(
const Key& key,
size_type modulus) const
{
return m_hash(key) % modulus;
}
size_type doHash(const Key & key) const
{
return doHash(key, m_buckets.size());
}
void rehash()
{
// grow the number of buckets by 60%
const size_type theNewSize = size_type(1.6 * size());
BucketTableType temp(
theNewSize,
BucketType(*m_memoryManager),
*m_memoryManager);
// rehash each entry assign to bucket and insert into list
EntryListIterator entryPos = m_entries.begin();
while (entryPos != m_entries.end())
{
const size_type index =
doHash(
entryPos->value->first,
theNewSize);
temp[index].push_back(entryPos);
++entryPos;
}
// Now that we've rebuilt the buckets, swap the rebuilt
// buckets with our existing buckets.
m_buckets.swap(temp);
}
value_type*
allocate(size_type size)
{
const size_type theBytesNeeded = size * sizeof(value_type);
assert(m_memoryManager != 0);
void* pointer = m_memoryManager->allocate(theBytesNeeded);
assert(pointer != 0);
return reinterpret_cast<value_type*>(pointer);
}
void
deallocate(value_type* pointer)
{
assert(m_memoryManager != 0);
m_memoryManager->deallocate(pointer);
}
static size_type
calculateNewBucketCapacity(
size_type theCurrentSize,
size_type theExtraCapacity)
{
assert(theExtraCapacity > theCurrentSize);
// We'll use the current extra capacity a convenient number.
// Perhaps a better choice would be to determine how much
// of the extra capacity to keep, but we really need to
// figure out how to keep the buckets compacted during
// removal of an item.
return theCurrentSize == 0 ?
eMinimumBucketSize :
theExtraCapacity;
}
void
compactBuckets()
{
for(TableIterator i = m_buckets.begin();
i != m_buckets.end();
++i)
{
BucketType& theCurrentBucket = *i;
BucketIterator j = theCurrentBucket.begin();
while(j != theCurrentBucket.end())
{
if ((*j)->erased == true)
{
j = theCurrentBucket.erase(j);
}
else
{
++j;
}
}
// Now we should do something if the
// bucket has a much greater capacity
// than the number of items in it.
const size_type theCurrentSize =
theCurrentBucket.size();
const size_type theExtraCapacity =
theCurrentBucket.capacity() - theCurrentSize;
if (theExtraCapacity > theCurrentSize)
{
const size_type theNewCapacity =
calculateNewBucketCapacity(
theCurrentSize,
theExtraCapacity);
// Create a copy of the bucket, and
// give it the new capacity of the extra
// capacity.
BucketType theTempBucket(
theCurrentBucket,
*m_memoryManager,
theNewCapacity);
theCurrentBucket.swap(theTempBucket);
}
}
}
// Data members...
typename KeyTraits::Hasher m_hash;
typename KeyTraits::Comparator m_equals;
MemoryManagerType* m_memoryManager;
float m_loadFactor;
const size_type m_minBuckets;
size_type m_size;
EntryListType m_entries;
EntryListType m_freeEntries;
BucketTableType m_buckets;
size_type m_eraseCount;
size_type m_eraseThreshold;
private:
// These are not implemented.
XalanMap();
XalanMap(const XalanMap&);
};
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
XALAN_CPP_NAMESPACE_END
#endif // XALANMAP_HEADER_GUARD_1357924680
Index: SolarisDefinitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/SolarisDefinitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** SolarisDefinitions.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- SolarisDefinitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(SOLARISDEFINITIONS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(SOLARISDEFINITIONS_HEADER_GUARD_1357924680)
***************
*** 105,116 ****
// I don't know if this is their bug, or ours...
#define XALAN_NO_STD_ALLOCATORS
- #define XALAN_NO_STD_NUMERIC_LIMITS
#define XALAN_XALANDOMCHAR_USHORT_MISMATCH
#define XALAN_POSIX2_AVAILABLE
!
! #define XALAN_UNALIGNED
!
!
#endif // SOLARISDEFINITIONS_HEADER_GUARD_1357924680
--- 64,72 ----
// I don't know if this is their bug, or ours...
#define XALAN_NO_STD_ALLOCATORS
+ #define XALAN_RW_NO_CLASS_PARTIAL_SPEC
#define XALAN_XALANDOMCHAR_USHORT_MISMATCH
#define XALAN_POSIX2_AVAILABLE
! #define XALAN_NO_STD_NUMERIC_LIMITS
#endif // SOLARISDEFINITIONS_HEADER_GUARD_1357924680
Index: AIXDefinitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/AIXDefinitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AIXDefinitions.hpp 8 Apr 2004 07:56:03 -0000 1.1.1.1
--- AIXDefinitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(AIXDEFINITIONS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(AIXDEFINITIONS_HEADER_GUARD_1357924680)
***************
*** 86,89 ****
--- 45,50 ----
#define XALAN_NEW_STD_ALLOCATOR
#define XALAN_HAS_CPP_NAMESPACE
+ #define XALAN_HAS_STD_ITERATORS
+ #define XALAN_HAS_STD_DISTANCE
#else
***************
*** 107,111 ****
#define XALAN_STLPORT_STL
#define XALAN_TEMPLATE_FUNCTION_NO_DEFAULT_PARAMETERS
- #define XALAN_NO_STD_NUMERIC_LIMITS
#define XALAN_NO_USING_DECLARATION
--- 68,71 ----
***************
*** 116,122 ****
#endif
-
-
- #define XALAN_UNALIGNED
--- 76,79 ----
Index: TRU64Definitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/TRU64Definitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** TRU64Definitions.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- TRU64Definitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(TRU64DEFINITIONS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(TRU64DEFINITIONS_HEADER_GUARD_1357924680)
***************
*** 80,84 ****
#define XALAN_INLINE_INITIALIZATION
#define XALAN_LSTRSUPPORT
! #define XALAN_MODERN_STL
#if defined(__STD_STRICT_ANSI) || defined(__STD_STRICT_ANSI_ERRORS)
--- 39,45 ----
#define XALAN_INLINE_INITIALIZATION
#define XALAN_LSTRSUPPORT
! #define XALAN_HAS_STD_ITERATORS
! #define XALAN_HAS_STD_DISTANCE
! #define XALAN_NO_REENTRANT_TIME_FUNCTIONS
#if defined(__STD_STRICT_ANSI) || defined(__STD_STRICT_ANSI_ERRORS)
***************
*** 86,90 ****
#endif
- #define XALAN_UNALIGNED __unaligned
--- 47,50 ----
--- NEW FILE: XalanObjectStackCache.hpp ---
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(XALAN_OBJECTSTACKCACHE_HEADER_GUARD)
#define XALAN_OBJECTSTACKCACHE_HEADER_GUARD
#include <algorithm>
#include <xalanc/Include/XalanVector.hpp>
#include <xalanc/Include/STLHelper.hpp>
#include <xalanc/Include/XalanAutoPtr.hpp>
#include <xalanc/Include/XalanObjectCache.hpp>
XALAN_CPP_NAMESPACE_BEGIN
template<
class ObjectType,
#if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS)
class CreateFunctorType,
class DeleteFunctorType,
class ResetFunctorType>
#else
class CreateFunctorType = DefaultCacheCreateFunctor<ObjectType>,
class DeleteFunctorType = DeleteFunctor<ObjectType>,
class ResetFunctorType = DefaultCacheResetFunctor<ObjectType> >
#endif
class XalanObjectStackCache
{
public:
typedef XalanVector<ObjectType*> VectorType;
typedef ObjectType CacheObjectType;
explicit
XalanObjectStackCache(MemoryManagerType& theManager,
unsigned int initialListSize = 0) :
m_createFunctor(),
m_deleteFunctor(theManager),
m_stack(theManager),
m_numObjectsOnStack(0)
{
m_stack.reserve(initialListSize);
}
~XalanObjectStackCache()
{
#if !defined(XALAN_NO_STD_NAMESPACE)
using std::for_each;
#endif
for_each(
m_stack.begin(),
m_stack.end(),
m_deleteFunctor);
}
ObjectType*
get()
{
if (m_stack.size() == m_numObjectsOnStack)
{
ObjectType* const theNewObject = m_createFunctor(m_stack.getMemoryManager());
m_stack.push_back(theNewObject);
++m_numObjectsOnStack;
return theNewObject;
}
else
{
return m_stack[m_numObjectsOnStack++];
}
}
ObjectType*
top()
{
assert (m_numObjectsOnStack > 0);
return m_stack[m_numObjectsOnStack-1];
}
ObjectType*
release()
{
assert(m_numObjectsOnStack > 0);
return m_stack[--m_numObjectsOnStack];
}
void
reset()
{
typename VectorType::iterator iterator;
for (iterator = m_stack.begin(); iterator < m_stack.end(); iterator++)
{
m_resetFunctor(*iterator);
}
}
// Functors for various operations...
CreateFunctorType m_createFunctor;
DeleteFunctorType m_deleteFunctor;
ResetFunctorType m_resetFunctor;
private:
// There are not defined...
XalanObjectStackCache(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
XalanObjectStackCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>&
operator=(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
// Data members...
VectorType m_stack;
typename VectorType::size_type m_numObjectsOnStack;
};
template<class ObjectType>
class XalanObjectStackCacheDefault : public XalanObjectStackCache<ObjectType, DefaultCacheCreateFunctor<ObjectType>, DeleteFunctor<ObjectType>, DefaultCacheResetFunctor<ObjectType> >
{
public:
typedef XalanObjectStackCache<ObjectType, DefaultCacheCreateFunctor<ObjectType>, DeleteFunctor<ObjectType>, DefaultCacheResetFunctor<ObjectType> > BaseClassType;
explicit
XalanObjectStackCacheDefault(unsigned int initialListSize = 0) :
BaseClassType(initialListSize)
{
}
};
XALAN_CPP_NAMESPACE_END
#endif
Index: OS400Definitions.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/OS400Definitions.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** OS400Definitions.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- OS400Definitions.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(OS400DEFINITIONS_HEADER_GUARD_1357924680)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(OS400DEFINITIONS_HEADER_GUARD_1357924680)
***************
*** 106,110 ****
#define XALAN_STLPORT_STL
#define XALAN_TEMPLATE_FUNCTION_NO_DEFAULT_PARAMETERS
- #define XALAN_NO_STD_NUMERIC_LIMITS
#define XALAN_NO_USING_DECLARATION
--- 65,68 ----
***************
*** 116,121 ****
#endif
-
- #define XALAN_UNALIGNED
#endif // OS400DEFINITIONS_HEADER_GUARD_1357924680
--- 74,77 ----
Index: XalanObjectCache.hpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Include/xalanc/Include/XalanObjectCache.hpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** XalanObjectCache.hpp 8 Apr 2004 07:56:04 -0000 1.1.1.1
--- XalanObjectCache.hpp 19 Feb 2008 20:14:03 -0000 1.2
***************
*** 1,57 ****
/*
! * The Apache Software License, Version 1.1
! *
! *
! * Copyright (c) 1999-2004 The Apache Software Foundation. All rights
! * reserved.
! *
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
! *
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
! *
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Xalan" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact apache at apache.org.
*
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
*
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
*
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation and was
! * originally based on software copyright (c) 1999, International
! * Business Machines, Inc., http://www.ibm.com. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
*/
#if !defined(XALAN_OBJECTCACHE_HEADER_GUARD)
--- 1,16 ----
/*
! * Copyright 1999-2004 The Apache Software Foundation.
*
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
! * http://www.apache.org/licenses/LICENSE-2.0
*
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
*/
#if !defined(XALAN_OBJECTCACHE_HEADER_GUARD)
***************
*** 61,70 ****
#include <algorithm>
- #include <vector>
#include <xalanc/Include/STLHelper.hpp>
! #include <xalanc/Include/XalanAutoPtr.hpp>
--- 20,29 ----
#include <algorithm>
+ #include <xalanc/Include/XalanVector.hpp>
#include <xalanc/Include/STLHelper.hpp>
!
***************
*** 79,90 ****
public:
! ObjectType*
! operator()() const
! {
! return new ObjectType;
! }
};
template<class ObjectType>
--- 38,81 ----
public:
! ObjectType*
! operator()(MemoryManagerType& theManager) const
! {
! typedef ObjectType ThisType;
!
! XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
!
! ThisType* theResult = theGuard.get();
!
! new (theResult) ThisType();
!
! theGuard.release();
!
! return theResult;
! }
};
+ template<class ObjectType>
+ class DefaultCacheCreateFunctorMemMgr
+ {
+ public:
+
+ ObjectType*
+ operator()(MemoryManagerType& theManager) const
+ {
+ typedef ObjectType ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+
+ new (theResult) ThisType(theManager);
+
+ theGuard.release();
+
+ return theResult;
+ }
+ };
+
template<class ObjectType>
***************
*** 93,100 ****
public:
! void
! operator()(ObjectType*) const
! {
! }
};
--- 84,91 ----
public:
! void
! operator()(ObjectType*) const
! {
! }
};
***************
*** 106,114 ****
public:
! void
! operator()(ObjectType* theInstance) const
! {
! theInstance->clear();
! }
};
--- 97,105 ----
public:
! void
! operator()(ObjectType* theInstance) const
! {
! theInstance->clear();
! }
};
***************
*** 132,258 ****
public:
! #if defined(XALAN_NO_STD_NAMESPACE)
! typedef vector<ObjectType*> VectorType;
! #else
! typedef std::vector<ObjectType*> VectorType;
! #endif
! typedef ObjectType CacheObjectType;
! explicit
! XalanObjectCache(unsigned int initialListSize = 0) :
! m_availableList(),
! m_busyList()
! {
! m_availableList.reserve(initialListSize);
! m_busyList.reserve(initialListSize);
! }
! ~XalanObjectCache()
! {
! reset();
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::for_each;
#endif
! for_each(
! m_availableList.begin(),
! m_availableList.end(),
! m_deleteFunctor);
! }
! ObjectType*
! get()
! {
! // We'll always return the back of the free list, since
! // that's the cheapest thing.
! if (m_availableList.empty() == true)
! {
! ObjectType* const theNewObject = m_createFunctor();
! m_busyList.push_back(theNewObject);
! return theNewObject;
! }
! else
! {
! ObjectType* const theObject = m_availableList.back();
! m_busyList.push_back(theObject);
! m_availableList.pop_back();
! return theObject;
! }
! }
! bool
! release(ObjectType* theInstance)
! {
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::find;
#endif
! typedef typename VectorType::iterator IteratorType;
! const IteratorType i =
! find(
! m_busyList.begin(),
! m_busyList.end(),
! theInstance);
! if (i == m_busyList.end())
! {
! return false;
! }
! else
! {
! m_resetFunctor(theInstance);
! m_availableList.push_back(theInstance);
! m_busyList.erase(i);
! return true;
! }
! }
! void
! reset()
! {
! while (m_busyList.empty() == false)
! {
! ObjectType* const theInstance = m_busyList.back();
! m_resetFunctor(theInstance);
! m_availableList.push_back(theInstance);
! m_busyList.pop_back();
! }
! }
! // Functors for various operations...
! CreateFunctorType m_createFunctor;
! DeleteFunctorType m_deleteFunctor;
! ResetFunctorType m_resetFunctor;
private:
! // There are not defined...
! XalanObjectCache(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
! XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>&
! operator=(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
! // Data members...
! VectorType m_availableList;
! VectorType m_busyList;
};
--- 123,247 ----
public:
! typedef XalanVector<ObjectType*> VectorType;
! typedef ObjectType CacheObjectType;
! explicit
! XalanObjectCache(
! MemoryManagerType& theManager,
! unsigned int initialListSize = 0) :
! m_availableList(theManager),
! m_busyList(theManager)
! {
! m_availableList.reserve(initialListSize);
! m_busyList.reserve(initialListSize);
! }
! ~XalanObjectCache()
! {
! reset();
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::for_each;
#endif
! for_each(
! m_availableList.begin(),
! m_availableList.end(),
! m_deleteFunctor(theManager));
! }
! ObjectType*
! get()
! {
! // We'll always return the back of the free list, since
! // that's the cheapest thing.
! if (m_availableList.empty() == true)
! {
! ObjectType* const theNewObject = m_createFunctor(m_availableList.getMemoryManager());
! m_busyList.push_back(theNewObject);
! return theNewObject;
! }
! else
! {
! ObjectType* const theObject = m_availableList.back();
! m_busyList.push_back(theObject);
! m_availableList.pop_back();
! return theObject;
! }
! }
! bool
! release(ObjectType* theInstance)
! {
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::find;
#endif
! typedef typename VectorType::iterator IteratorType;
! const IteratorType i =
! find(
! m_busyList.begin(),
! m_busyList.end(),
! theInstance);
! if (i == m_busyList.end())
! {
! return false;
! }
! else
! {
! m_resetFunctor(theInstance);
! m_availableList.push_back(theInstance);
! m_busyList.erase(i);
! return true;
! }
! }
! void
! reset()
! {
! while (m_busyList.empty() == false)
! {
! ObjectType* const theInstance = m_busyList.back();
! m_resetFunctor(theInstance);
! m_availableList.push_back(theInstance);
! m_busyList.pop_back();
! }
! }
! // Functors for various operations...
! CreateFunctorType m_createFunctor;
! DeleteFunctorType m_deleteFunctor;
! ResetFunctorType m_resetFunctor;
private:
! // There are not defined...
! XalanObjectCache(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
! XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>&
! operator=(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
! // Data members...
! VectorType m_availableList;
! VectorType m_busyList;
};
***************
*** 278,362 ****
public:
! #if defined(XALAN_NO_STD_NAMESPACE)
! typedef vector<ObjectType*> VectorType;
! #else
! typedef std::vector<ObjectType*> VectorType;
! #endif
! typedef ObjectType CacheObjectType;
! explicit
! XalanObjectCache(unsigned int initialListSize = 0) :
! m_availableList()
! {
! m_availableList.reserve(initialListSize);
! }
! ~XalanObjectCache()
! {
! reset();
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::for_each;
#endif
! for_each(
! m_availableList.begin(),
! m_availableList.end(),
! m_deleteFunctor);
! }
! ObjectType*
! get()
! {
! // We'll always return the back of the free list, since
! // that's the cheapest thing.
! if (m_availableList.empty() == true)
! {
! return m_createFunctor();
! }
! else
! {
! ObjectType* const theObject = m_availableList.back();
! m_availableList.pop_back();
! return theObject;
! }
! }
! bool
! release(ObjectType* theInstance)
! {
! m_resetFunctor(theInstance);
! m_availableList.push_back(theInstance);
! return true;
! }
! void
! reset()
! {
! }
! // Functors for various operations...
! CreateFunctorType m_createFunctor;
! DeleteFunctorType m_deleteFunctor;
! ResetFunctorType m_resetFunctor;
private:
! // These are not defined...
! XalanObjectCache(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
! XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>&
! operator=(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
! // Data members...
! VectorType m_availableList;
};
--- 267,349 ----
public:
! typedef XalanVector<ObjectType*> VectorType;
! typedef ObjectType CacheObjectType;
! explicit
! XalanObjectCache(MemoryManagerType& theManager,
! unsigned int initialListSize = 0) :
! m_deleteFunctor(theManager),
! m_availableList(theManager)
! {
! m_availableList.reserve(initialListSize);
! }
! ~XalanObjectCache()
! {
! reset();
#if !defined(XALAN_NO_STD_NAMESPACE)
! using std::for_each;
#endif
! for_each(
! m_availableList.begin(),
! m_availableList.end(),
! m_deleteFunctor);
! }
! ObjectType*
! get()
! {
! // We'll always return the back of the free list, since
! // that's the cheapest thing.
! if (m_availableList.empty() == true)
! {
! return m_createFunctor(m_availableList.getMemoryManager());
! }
! else
! {
! ObjectType* const theObject = m_availableList.back();
! m_availableList.pop_back();
! return theObject;
! }
! }
! bool
! release(ObjectType* theInstance)
! {
! m_resetFunctor(theInstance);
! m_availableList.push_back(theInstance);
! return true;
! }
! void
! reset()
! {
! }
! // Functors for various operations...
! CreateFunctorType m_createFunctor;
! DeleteFunctorType m_deleteFunctor;
! ResetFunctorType m_resetFunctor;
private:
! // These are not defined...
! XalanObjectCache(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
! XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>&
! operator=(const XalanObjectCache<ObjectType, CreateFunctorType, DeleteFunctorType, ResetFunctorType>& theRHS);
! // Data members...
! VectorType m_availableList;
};
***************
*** 372,417 ****
public:
! typedef typename XalanObjectCacheType::CacheObjectType CacheObjectType;
! GuardCachedObject(XalanObjectCacheType& theCache) :
! m_cache(theCache),
! m_cachedObject(theCache.get())
! {
! }
! ~GuardCachedObject()
! {
! if (m_cachedObject != 0)
! {
! m_cache.release(m_cachedObject);
! }
! }
! CacheObjectType*
! get() const
! {
! return m_cachedObject;
! }
! CacheObjectType*
! release()
! {
! CacheObjectType* const temp = m_cachedObject;
! m_cachedObject = 0;
! return temp;
! }
private:
! // Not implemented...
! GuardCachedObject(const GuardCachedObject<XalanObjectCacheType>&);
! // Data members...
! XalanObjectCacheType& m_cache;
! CacheObjectType* m_cachedObject;
};
--- 359,404 ----
public:
! typedef typename XalanObjectCacheType::CacheObjectType CacheObjectType;
! GuardCachedObject(XalanObjectCacheType& theCache) :
! m_cache(theCache),
! m_cachedObject(theCache.get())
! {
! }
! ~GuardCachedObject()
! {
! if (m_cachedObject != 0)
! {
! m_cache.release(m_cachedObject);
! }
! }
! CacheObjectType*
! get() const
! {
! return m_cachedObject;
! }
! CacheObjectType*
! release()
! {
! CacheObjectType* const temp = m_cachedObject;
! m_cachedObject = 0;
! return temp;
! }
private:
! // Not implemented...
! GuardCachedObject(const GuardCachedObject<XalanObjectCacheType>&);
! // Data members...
! XalanObjectCacheType& m_cache;
! CacheObjectType* m_cachedObject;
};
***************
*** 419,433 ****
template<class ObjectType>
! class XalanObjectCacheDefault : public XalanObjectCache<ObjectType, DefaultCacheCreateFunctor<ObjectType>, DeleteFunctor<ObjectType>, DefaultCacheResetFunctor<ObjectType> >
{
public:
! typedef XalanObjectCache<ObjectType, DefaultCacheCreateFunctor<ObjectType>, DeleteFunctor<ObjectType>, DefaultCacheResetFunctor<ObjectType> > BaseClassType;
! explicit
! XalanObjectCacheDefault(unsigned int initialListSize = 0) :
! BaseClassType(initialListSize)
! {
! }
};
--- 406,458 ----
template<class ObjectType>
! class XalanObjectCacheDefault :
! public XalanObjectCache<
! ObjectType,
! DefaultCacheCreateFunctor<ObjectType>,
! DeleteFunctor<ObjectType>,
! DefaultCacheResetFunctor<ObjectType> >
{
public:
! typedef XalanObjectCache<
! ObjectType,
! DefaultCacheCreateFunctor<ObjectType>,
! DeleteFunctor<ObjectType>,
! DefaultCacheResetFunctor<ObjectType> > BaseClassType;
! explicit
! XalanObjectCacheDefault(
! MemoryManagerType& theManager,
! unsigned int initialListSize = 0) :
! BaseClassType(theManager, initialListSize)
! {
! }
! };
!
!
!
! template<class ObjectType>
! class XalanMemoryManagerObjectCacheDefault :
! public XalanObjectCache<
! ObjectType,
! DefaultCacheCreateFunctorMemMgr<ObjectType>,
! DeleteFunctor<ObjectType>,
! DefaultCacheResetFunctor<ObjectType> >
! {
! public:
!
! typedef XalanObjectCache<
! ObjectType,
! DefaultCacheCreateFunctorMemMgr<ObjectType>,
! DeleteFunctor<ObjectType>,
! DefaultCacheResetFunctor<ObjectType> > BaseClassType;
!
! explicit
! XalanMemoryManagerObjectCacheDefault(
! MemoryManagerType& theManager,
! unsigned int initialListSize = 0) :
! BaseClassType(theManager, initialListSize)
! {
! }
};
- Previous message: [GME-commit] GMESRC/GME/Include/xalanc/ICUBridge ICUFormatNumberFunctor.hpp, NONE, 1.1 ICUBridge.hpp, 1.1.1.1, 1.2 ICUBridgeCleanup.hpp, 1.1.1.1, 1.2 ICUBridgeCollationCompareFunctor.hpp, 1.1.1.1, 1.2 ICUBridgeCollationCompareFunctorImpl.hpp, 1.1.1.1, 1.2 ICUBridgeDefinitions.hpp, 1.1.1.1, 1.2 ICUXalanNumberFormatFactory.hpp, 1.1.1.1, 1.2 ICUXalanNumberFormatProxy.hpp, 1.1.1.1, 1.2
- Next message: [GME-commit] GMESRC/GME/Include/xalanc/TestXPath NodeNameTreeWalker.hpp, 1.1.1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the GME-commit
mailing list