http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Release Info

Installation
Download
Build

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

CVS Repository
Mail Archive

API Docs for SAX and DOM
 

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XSNamedMap.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003,2004 The Apache Software Foundation.
00003  * 
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  * 
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /*
00018  * $Log: XSNamedMap.hpp,v $
00019  * Revision 1.4  2004/09/08 13:56:09  peiyongz
00020  * Apache License Version 2.0
00021  *
00022  * Revision 1.3  2004/01/29 11:46:30  cargilld
00023  * Code cleanup changes to get rid of various compiler diagnostic messages.
00024  *
00025  * Revision 1.2  2003/11/06 15:30:04  neilg
00026  * first part of PSVI/schema component model implementation, thanks to David Cargill.  This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
00027  *
00028  * Revision 1.1  2003/09/16 14:33:36  neilg
00029  * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
00030  *
00031  */
00032 
00033 
00034 #if !defined(XSNAMEDMAP_HPP)
00035 #define XSNAMEDMAP_HPP
00036 
00037 
00038 #include <xercesc/util/XMemory.hpp>
00039 #include <xercesc/util/RefHash2KeysTableOf.hpp>
00040 
00041 XERCES_CPP_NAMESPACE_BEGIN
00042 
00043 class XMLStringPool;
00044 
00045 /*
00046  * This template provides convenient mappings between name,namespace
00047  * pairs and individual components, as well as means to iterate through all the 
00048  * named components on some object.
00049  */
00050 
00051 template <class TVal> class XSNamedMap: public XMemory
00052 {
00053 public:
00054     // -----------------------------------------------------------------------
00055     //  Constructors and Destructor
00056     // -----------------------------------------------------------------------
00059 
00060     XSNamedMap(const unsigned int maxElems,
00061         const unsigned int modulus,
00062         XMLStringPool* uriStringPool,
00063         const bool adoptElems,
00064         MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00065     );
00067 
00070     ~XSNamedMap();
00071 
00073 
00074     // -----------------------------------------------------------------------
00075     //  XSNamedMap methods
00076     // -----------------------------------------------------------------------
00079 
00085     unsigned int getLength();
00086 
00096     TVal *item(unsigned int index);
00097 
00109     TVal *itemByName(const XMLCh *compNamespace, 
00110                               const XMLCh *localName);
00111 
00113 
00114     //----------------------------------
00118     void addElement(TVal* const toAdd, const XMLCh* key1, const XMLCh* key2);
00120     
00121 
00122 private :
00123     // -----------------------------------------------------------------------
00124     //  Unimplemented constructors and operators
00125     // -----------------------------------------------------------------------
00126     XSNamedMap(const XSNamedMap<TVal>&);
00127     XSNamedMap<TVal>& operator=(const XSNamedMap<TVal>&);
00128 
00129     // -----------------------------------------------------------------------
00130     //  Data members
00131     //
00132     // fMemoryManager
00133     //  manager used to allocate memory needed by this object
00134     MemoryManager *const        fMemoryManager;
00135     XMLStringPool*              fURIStringPool;
00136     RefVectorOf<TVal>*          fVector;
00137     RefHash2KeysTableOf<TVal>*  fHash;
00138 };
00139 
00140 
00141 
00142 XERCES_CPP_NAMESPACE_END
00143 
00144 #if !defined(XERCES_TMPLSINC)
00145 #include <xercesc/framework/psvi/XSNamedMap.c>
00146 #endif
00147 
00148 #endif


Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.