diff --git a/src/xercesc/util/Makefile.in b/src/xercesc/util/Makefile.in index 1eb485127d0cdd4ced56c382f250bc3e7480577e..2b903a8742d5dee594dbde25927861f7889d8d10 100644 --- a/src/xercesc/util/Makefile.in +++ b/src/xercesc/util/Makefile.in @@ -541,7 +541,7 @@ UTIL_CPP_PUBHEADERS = \ XMLInitializer.hpp \ XMLInteger.hpp \ XMLMsgLoader.hpp \ - XMLMutexHolder.hpp \ + XMLHolder.hpp \ XMLNetAccessor.hpp \ XMLNumber.hpp \ XMLRegisterCleanup.hpp \ @@ -582,7 +582,7 @@ C_FILES = \ ValueStackOf.c \ ValueVectorOf.c \ XMLDeleterFor.c \ - XMLMutexHolder.c \ + XMLHolder.c \ LogicalPath.c UTIL_CPP_OBJECTS = \ diff --git a/src/xercesc/util/XMLHolder.c b/src/xercesc/util/XMLHolder.c new file mode 100644 index 0000000000000000000000000000000000000000..24e169c0ef174eb9e0470ba0008c87215ed2004e --- /dev/null +++ b/src/xercesc/util/XMLHolder.c @@ -0,0 +1,52 @@ +/* + * Copyright 1999-2005 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. + */ + +// --------------------------------------------------------------------------- +// Include +// --------------------------------------------------------------------------- +#if defined(XERCES_TMPLSINC) +#include <xercesc/util/XMLHolder.hpp> +#endif + +XERCES_CPP_NAMESPACE_BEGIN + + +// ----------------------------------------------------------------------- +// XMLHolder: Constructors and Destructor +// ----------------------------------------------------------------------- + +template<class Type> +XMLHolder<Type>::XMLHolder() : + XMemory(), + fInstance() +{ +} + +template<class Type> +XMLHolder<Type>::~XMLHolder() +{ +} + + +template<class Type> +XMLHolder<Type>* +XMLHolder<Type>::castTo(void* handle) +{ + return (XMLHolder<Type>*)handle; +} + + +XERCES_CPP_NAMESPACE_END diff --git a/src/xercesc/util/XMLHolder.hpp b/src/xercesc/util/XMLHolder.hpp new file mode 100644 index 0000000000000000000000000000000000000000..97475a8de8afac4cb272c780d74d669ff1f9a3db --- /dev/null +++ b/src/xercesc/util/XMLHolder.hpp @@ -0,0 +1,56 @@ +/* + * Copyright 1999-2005 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(XMLHOLDER_HPP) +#define XMLHOLDER_HPP + +#include <xercesc/util/XMemory.hpp> + +XERCES_CPP_NAMESPACE_BEGIN + +template<class Type> +class XMLUTIL_EXPORT XMLHolder : public XMemory +{ +public : + // ----------------------------------------------------------------------- + // Constructors and Destructor + // ----------------------------------------------------------------------- + XMLHolder(); + + ~XMLHolder(); + + Type fInstance; + + static XMLHolder<Type>* + castTo(void* handle); + +private : + // ----------------------------------------------------------------------- + // Unimplemented constructors and operators + // ----------------------------------------------------------------------- + XMLHolder(const XMLHolder<Type>&); + XMLHolder<Type>& operator=(const XMLHolder<Type>&); + +}; + +XERCES_CPP_NAMESPACE_END + +#if !defined(XERCES_TMPLSINC) +#include <xercesc/util/XMLHolder.c> +#endif + + +#endif