You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2003/06/20 20:37:39 UTC
cvs commit: xml-xerces/c/src/xercesc/framework XMLDTDDescription.hpp XMLGrammarDescription.hpp XMLGrammarPool.hpp XMLSchemaDescription.hpp
peiyongz 2003/06/20 11:37:39
Added: c/src/xercesc/framework XMLDTDDescription.hpp
XMLGrammarDescription.hpp XMLGrammarPool.hpp
XMLSchemaDescription.hpp
Log:
Stateless Grammar Pool :: Part I
Revision Changes Path
1.1 xml-xerces/c/src/xercesc/framework/XMLDTDDescription.hpp
Index: XMLDTDDescription.hpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 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 "Xerces" 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/>.
*/
/*
* $Log: XMLDTDDescription.hpp,v $
* Revision 1.1 2003/06/20 18:37:39 peiyongz
* Stateless Grammar Pool :: Part I
*
* $Id: XMLDTDDescription.hpp,v 1.1 2003/06/20 18:37:39 peiyongz Exp $
*
*/
#if !defined(XMLDTDDESCRIPTION_HPP)
#define XMLDTDDESCRIPTION_HPP
#include <xercesc/framework/XMLGrammarDescription.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class XMLPARSER_EXPORT XMLDTDDescription : public XMLGrammarDescription
{
public :
// -----------------------------------------------------------------------
/** @name Virtual destructor for derived classes */
// -----------------------------------------------------------------------
//@{
/**
* virtual destructor
*
*/
virtual ~XMLDTDDescription(){};
//@}
// -----------------------------------------------------------------------
/** @name Implementation of Grammar Description Interface */
// -----------------------------------------------------------------------
//@{
/**
* getGrammarType
*
*/
virtual Grammar::GrammarType getGrammarType() const
{
return Grammar::DTDGrammarType;
}
//@}
// -----------------------------------------------------------------------
/** @name The DTDDescription Interface */
// -----------------------------------------------------------------------
//@{
/**
* getRootName
*
*/
virtual const XMLCh* getRootName() const = 0;
/**
* setRootName
*
*/
virtual void setRootName(const XMLCh* const) = 0;
//@}
protected :
// -----------------------------------------------------------------------
/** Hidden Constructors */
// -----------------------------------------------------------------------
//@{
XMLDTDDescription(MemoryManager* const memMgr)
:XMLGrammarDescription(memMgr)
{};
//@}
private :
// -----------------------------------------------------------------------
/** name Unimplemented copy constructor and operator= */
// -----------------------------------------------------------------------
//@{
XMLDTDDescription(const XMLDTDDescription& );
XMLDTDDescription& operator=(const XMLDTDDescription& );
//@}
};
XERCES_CPP_NAMESPACE_END
#endif
1.1 xml-xerces/c/src/xercesc/framework/XMLGrammarDescription.hpp
Index: XMLGrammarDescription.hpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 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 "Xerces" 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/>.
*/
/*
* $Log: XMLGrammarDescription.hpp,v $
* Revision 1.1 2003/06/20 18:37:39 peiyongz
* Stateless Grammar Pool :: Part I
*
* $Id: XMLGrammarDescription.hpp,v 1.1 2003/06/20 18:37:39 peiyongz Exp $
*
*/
#if !defined(XMLGRAMMARDESCRIPTION_HPP)
#define XMLGRAMMARDESCRIPTION_HPP
#include <xercesc/util/XMemory.hpp>
#include <xercesc/validators/common/Grammar.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class XMLPARSER_EXPORT XMLGrammarDescription : public XMemory
{
public :
// -----------------------------------------------------------------------
/** @name Virtual destructor for derived classes */
// -----------------------------------------------------------------------
//@{
/**
* virtual destructor
*
*/
virtual ~XMLGrammarDescription(){};
//@}
// -----------------------------------------------------------------------
/** @name The Grammar Description Interface */
// -----------------------------------------------------------------------
//@{
/**
* getGrammarType
*
*/
virtual Grammar::GrammarType getGrammarType() const = 0;
/**
* getGrammarKey
*
*/
virtual const XMLCh* getGrammarKey() const = 0;
//@}
inline MemoryManager* getMemoryManager() const;
protected :
// -----------------------------------------------------------------------
/** Hidden Constructors */
// -----------------------------------------------------------------------
//@{
XMLGrammarDescription(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager)
:fMemMgr(memMgr)
{
};
//@}
private :
// -----------------------------------------------------------------------
/** name Unimplemented copy constructor and operator= */
// -----------------------------------------------------------------------
//@{
XMLGrammarDescription(const XMLGrammarDescription& );
XMLGrammarDescription& operator=(const XMLGrammarDescription& );
//@}
// -----------------------------------------------------------------------
//
// fMemMgr: plugged-in (or defaulted-in) memory manager,
// not owned
// no reset after initialization
// allow derivatives to access directly
//
// -----------------------------------------------------------------------
MemoryManager* const fMemMgr;
};
inline MemoryManager* XMLGrammarDescription::getMemoryManager() const
{
return fMemMgr;
}
XERCES_CPP_NAMESPACE_END
#endif
1.1 xml-xerces/c/src/xercesc/framework/XMLGrammarPool.hpp
Index: XMLGrammarPool.hpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 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 "Xerces" 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/>.
*/
/*
* $Log: XMLGrammarPool.hpp,v $
* Revision 1.1 2003/06/20 18:37:39 peiyongz
* Stateless Grammar Pool :: Part I
*
* $Id: XMLGrammarPool.hpp,v 1.1 2003/06/20 18:37:39 peiyongz Exp $
*
*/
#if !defined(XMLGRAMMARPOOL_HPP)
#define XMLGRAMMARPOOL_HPP
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMemory.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class XMLGrammarDescription;
class Grammar;
class DTDGrammar;
class SchemaGrammar;
class XMLDTDDescription;
class XMLSchemaDescription;
class XMLPARSER_EXPORT XMLGrammarPool : public XMemory
{
public :
// -----------------------------------------------------------------------
/** @name Virtual destructor for derived classes */
// -----------------------------------------------------------------------
//@{
/**
* virtual destructor
*
*/
virtual ~XMLGrammarPool(){};
//@}
// -----------------------------------------------------------------------
/** @name The Grammar Pool Interface */
// -----------------------------------------------------------------------
//@{
/**
* cacheGrammar
*
* @param gramDesc: the grammar description
* @param gramToCache: the Grammar to be cached in the grammar pool
*
*/
virtual void cacheGrammar(XMLGrammarDescription* const gramDesc
, Grammar* const gramToCache) = 0;
/**
* retrieveGrammar
*
* @param gramDesc: the Grammar Description used to search for grammar
* cached in the grammar pool
*
*/
virtual Grammar* retrieveGrammar(XMLGrammarDescription* const gramDesc) = 0;
/**
* orphanGrammar
*
* grammar removed from the grammar pool and owned by the caller
*
* @param gramDesc: the Grammar Description used to search for grammar
* cached in the grammar pool
*
*/
virtual Grammar* orphanGrammar(XMLGrammarDescription* const gramDesc) = 0;
/**
* clear
*
* all grammars are removed from the grammar pool and deleted.
*
*/
virtual void clear() = 0;
/**
* lookPool
*
* The grammar pool is looked and accessed exclusively by the looking thread
*
*/
virtual void lockPool() = 0;
/**
* lookPool
*
* The grammar pool is accessible by multi threads
*
*/
virtual void unlockPool() = 0;
//@}
// -----------------------------------------------------------------------
/** @name Factory interface */
// -----------------------------------------------------------------------
//@{
/**
* createDTDGrammar
*
*/
virtual DTDGrammar* createDTDGrammar() = 0;
/**
* createSchemaGrammar
*
*/
virtual SchemaGrammar* createSchemaGrammar() = 0;
/**
* createDTDDescription
*
*/
virtual XMLDTDDescription* createDTDDescription(const XMLCh* const rootName) = 0;
/**
* createSchemaDescription
*
*/
virtual XMLSchemaDescription* createSchemaDescription(const XMLCh* const targetNamespace) = 0;
//@}
// -----------------------------------------------------------------------
/** @name Getter */
// -----------------------------------------------------------------------
//@{
/**
* getMemoryManager
*
*/
inline MemoryManager* const getMemoryManager()
{
return fMemMgr;
}
//@}
protected :
// -----------------------------------------------------------------------
/** Hidden Constructors */
// -----------------------------------------------------------------------
//@{
XMLGrammarPool(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager)
:fMemMgr(memMgr)
{
};
//@}
private :
// -----------------------------------------------------------------------
/** name Unimplemented copy constructor and operator= */
// -----------------------------------------------------------------------
//@{
XMLGrammarPool(const XMLGrammarPool& );
XMLGrammarPool& operator=(const XMLGrammarPool& );
//@}
// -----------------------------------------------------------------------
//
// fMemMgr: plugged-in (or defaulted-in) memory manager
// not owned
// no reset after initialization
//
// -----------------------------------------------------------------------
MemoryManager* const fMemMgr;
};
XERCES_CPP_NAMESPACE_END
#endif
1.1 xml-xerces/c/src/xercesc/framework/XMLSchemaDescription.hpp
Index: XMLSchemaDescription.hpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2003 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 "Xerces" 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/>.
*/
/*
* $Log: XMLSchemaDescription.hpp,v $
* Revision 1.1 2003/06/20 18:37:39 peiyongz
* Stateless Grammar Pool :: Part I
*
* $Id: XMLSchemaDescription.hpp,v 1.1 2003/06/20 18:37:39 peiyongz Exp $
*
*/
#if !defined(XMLSCHEMADESCRIPTION_HPP)
#define XMLSCHEMADESCRIPTION_HPP
#include <xercesc/framework/XMLGrammarDescription.hpp>
#include <xercesc/util/RefArrayVectorOf.hpp>
XERCES_CPP_NAMESPACE_BEGIN
typedef const XMLCh* const LocationHint;
class XMLPARSER_EXPORT XMLSchemaDescription : public XMLGrammarDescription
{
public :
// -----------------------------------------------------------------------
/** @name Virtual destructor for derived classes */
// -----------------------------------------------------------------------
//@{
/**
* virtual destructor
*
*/
virtual ~XMLSchemaDescription(){};
//@}
// -----------------------------------------------------------------------
/** @name Implementation of Grammar Description Interface */
// -----------------------------------------------------------------------
//@{
/**
* getGrammarType
*
*/
virtual Grammar::GrammarType getGrammarType() const
{
return Grammar::SchemaGrammarType;
}
//@}
// -----------------------------------------------------------------------
/** @name The SchemaDescription Interface */
// -----------------------------------------------------------------------
//@{
enum ContextType
{
CONTEXT_INCLUDE,
CONTEXT_REDEFINE,
CONTEXT_IMPORT,
CONTEXT_PREPARSE,
CONTEXT_INSTANCE,
CONTEXT_ELEMENT,
CONTEXT_ATTRIBUTE,
CONTEXT_XSITYPE,
CONTEXT_UNKNOWN
};
/**
* getContextType
*
*/
virtual ContextType getContextType() const = 0;
/**
* getTargetNamespace
*
*/
virtual const XMLCh* getTargetNamespace() const = 0;
/**
* getLocationHints
*
*/
virtual RefArrayVectorOf<XMLCh>* getLocationHints() const = 0;
/**
* getTriggeringComponent
*
*/
virtual const QName* getTriggeringComponent() const = 0;
/**
* getenclosingElementName
*
*/
virtual const QName* getEnclosingElementName() const = 0;
/**
* getAttributes
*
*/
virtual const XMLAttDef* getAttributes() const = 0;
/**
* setContextType
*
*/
virtual void setContextType(ContextType) = 0;
/**
* setTargetNamespace
*
*/
virtual void setTargetNamespace(const XMLCh* const) = 0;
/**
* setLocationHints
*
*/
virtual void setLocationHints(RefArrayVectorOf<XMLCh>* const) = 0;
/**
* setTriggeringComponent
*
*/
virtual void setTriggeringComponent(QName* const) = 0;
/**
* getenclosingElementName
*
*/
virtual void setEnclosingElementName(QName* const) = 0;
/**
* setAttributes
*
*/
virtual void setAttributes(XMLAttDef* const) = 0;
//@}
protected :
// -----------------------------------------------------------------------
/** Hidden Constructors */
// -----------------------------------------------------------------------
//@{
XMLSchemaDescription(MemoryManager* const memMgr)
:XMLGrammarDescription(memMgr)
{};
//@}
private :
// -----------------------------------------------------------------------
/** name Unimplemented copy constructor and operator= */
// -----------------------------------------------------------------------
//@{
XMLSchemaDescription(const XMLSchemaDescription& );
XMLSchemaDescription& operator=(const XMLSchemaDescription& );
//@}
};
XERCES_CPP_NAMESPACE_END
#endif
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org