| API Docs for SAX and DOM |
| Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages # 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  * $Id: XSNamedMap.hpp 191054 2005-06-17 02:56:35Z jberry $
    00019  */
    00020
    00021
    00022 #if !defined(XSNAMEDMAP_HPP)
    00023 #define XSNAMEDMAP_HPP
    00024
    00025
    00026 #include <xercesc/util/XMemory.hpp>
    00027 #include <xercesc/util/RefHash2KeysTableOf.hpp>
    00028 #include <xercesc/util/RefVectorOf.hpp>
    00029
    00030 XERCES_CPP_NAMESPACE_BEGIN
    00031
    00032 class XMLStringPool;
    00033
    00034 /*
    00035  * This template provides convenient mappings between name,namespace
    00036  * pairs and individual components, as well as means to iterate through all the
    00037  * named components on some object.
    00038  */
    00039
    00040 template <class TVal> class XSNamedMap: public XMemory
    00041 {
    00042 public:
    00043     // -----------------------------------------------------------------------
    00044     //  Constructors and Destructor
    00045     // -----------------------------------------------------------------------
    00048
    00049     XSNamedMap(const unsigned int maxElems,
    00050         const unsigned int modulus,
    00051         XMLStringPool* uriStringPool,
    00052         const bool adoptElems,
    00053         MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    00054     );
    00056
    00059     ~XSNamedMap();
    00060
    00062
    00063     // -----------------------------------------------------------------------
    00064     //  XSNamedMap methods
    00065     // -----------------------------------------------------------------------
    00068
    00074     unsigned int getLength();
    00075
    00085     TVal *item(unsigned int index);
    00086
    00098     TVal *itemByName(const XMLCh *compNamespace,
    00099                               const XMLCh *localName);
    00100
    00102
    00103     //----------------------------------
    00107     void addElement(TVal* const toAdd, const XMLCh* key1, const XMLCh* key2);
    00109
    00110
    00111 private :
    00112     // -----------------------------------------------------------------------
    00113     //  Unimplemented constructors and operators
    00114     // -----------------------------------------------------------------------
    00115     XSNamedMap(const XSNamedMap<TVal>&);
    00116     XSNamedMap<TVal>& operator=(const XSNamedMap<TVal>&);
    00117
    00118     // -----------------------------------------------------------------------
    00119     //  Data members
    00120     //
    00121     // fMemoryManager
    00122     //  manager used to allocate memory needed by this object
    00123     MemoryManager *const        fMemoryManager;
    00124     XMLStringPool*              fURIStringPool;
    00125     RefVectorOf<TVal>*          fVector;
    00126     RefHash2KeysTableOf<TVal>*  fHash;
    00127 };
    00128
    00129
    00130
    00131 XERCES_CPP_NAMESPACE_END
    00132
    00133 #if !defined(XERCES_TMPLSINC)
    00134 #include <xercesc/framework/psvi/XSNamedMap.c>
    00135 #endif
    00136
    00137 #endif

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