## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.7

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

# MutableNodeRefList.hpp

Go to the documentation of this file.

    00001 /*
    00002  * The Apache Software License, Version 1.1
    00003  *
    00004  *
    00005  * Copyright (c) 1999-2004 The Apache Software Foundation.  All rights
    00006  * reserved.
    00007  *
    00008  * Redistribution and use in source and binary forms, with or without
    00009  * modification, are permitted provided that the following conditions
    00010  * are met:
    00011  *
    00012  * 1. Redistributions of source code must retain the above copyright
    00013  *    notice, this list of conditions and the following disclaimer.
    00014  *
    00015  * 2. Redistributions in binary form must reproduce the above copyright
    00016  *    notice, this list of conditions and the following disclaimer in
    00017  *    the documentation and/or other materials provided with the
    00018  *    distribution.
    00019  *
    00020  * 3. The end-user documentation included with the redistribution,
    00021  *    if any, must include the following acknowledgment:
    00022  *       "This product includes software developed by the
    00023  *        Apache Software Foundation (http://www.apache.org/)."
    00024  *    Alternately, this acknowledgment may appear in the software itself,
    00025  *    if and wherever such third-party acknowledgments normally appear.
    00026  *
    00027  * 4. The names "Xalan" and "Apache Software Foundation" must
    00028  *    not be used to endorse or promote products derived from this
    00029  *    software without prior written permission. For written
    00030  *    permission, please contact apache@apache.org.
    00031  *
    00032  * 5. Products derived from this software may not be called "Apache",
    00033  *    nor may "Apache" appear in their name, without prior written
    00034  *    permission of the Apache Software Foundation.
    00035  *
    00036  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    00037  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    00038  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    00039  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    00040  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    00041  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    00042  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    00043  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00044  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    00045  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    00046  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    00047  * SUCH DAMAGE.
    00048  * ====================================================================
    00049  *
    00050  * This software consists of voluntary contributions made by many
    00051  * individuals on behalf of the Apache Software Foundation and was
    00052  * originally based on software copyright (c) 1999, International
    00053  * Business Machines, Inc., http://www.ibm.com.  For more
    00054  * information on the Apache Software Foundation, please see
    00055  * <http://www.apache.org/>.
    00056  */
    00057 #if !defined(MUTABLENODEREFLIST_HEADER_GUARD_1357924680)
    00058 #define MUTABLENODEREFLIST_HEADER_GUARD_1357924680
    00059
    00060
    00061
    00062 // Base include file.  Must be first.
    00063 #include <xalanc/XPath/XPathDefinitions.hpp>
    00064
    00065
    00066
    00067 #include <xalanc/XPath/NodeRefList.hpp>
    00068
    00069
    00070
    00071 XALAN_CPP_NAMESPACE_BEGIN
    00072
    00073
    00074
    00075 class XPathExecutionContext;
    00076 class XalanDocument;
    00077 class XalanNodeList;
    00078
    00079
    00080
    00085 class XALAN_XPATH_EXPORT MutableNodeRefList : public NodeRefList
    00086 {
    00087 public:
    00088
    00092     explicit
    00093     MutableNodeRefList();
    00094
    00100     MutableNodeRefList(const MutableNodeRefList&    theSource);
    00101
    00107     explicit
    00108     MutableNodeRefList(const NodeRefListBase&   theSource);
    00109
    00110     virtual
    00111     ~MutableNodeRefList();
    00112
    00113     MutableNodeRefList&
    00114 	operator=(const MutableNodeRefList&        theRHS);
    00115
    00116     MutableNodeRefList&
    00117 	operator=(const NodeRefList&       theRHS);
    00118
    00119     MutableNodeRefList&
    00120 	operator=(const NodeRefListBase&   theRHS);
    00121
    00122     MutableNodeRefList&
    00123 	operator=(const XalanNodeList* theRHS);
    00124
    00130     void
    00131     addNode(XalanNode*  n);
    00132
    00139     void
    00140     insertNode(
    00141             XalanNode*  n,
    00142             size_type   pos);
    00143
    00149     void
    00150     removeNode(const XalanNode*     n);
    00151
    00157     void
    00158     removeNode(size_type    pos);
    00159
    00163     void
    00164     clear();
    00165
    00172     void
    00173     setNode(
    00174             size_type   pos,
    00175             XalanNode*  n = 0);
    00176
    00183     void
    00184     addNodes(const XalanNodeList&   nodelist);
    00185
    00192     void
    00193     addNodes(const NodeRefListBase&     nodelist);
    00194
    00201     void
    00202     addNodesInDocOrder(
    00203             const XalanNodeList&    nodelist,
    00204             XPathExecutionContext&  executionContext);
    00205
    00212     void
    00213     addNodesInDocOrder(
    00214             const NodeRefListBase&  nodelist,
    00215             XPathExecutionContext&  executionContext);
    00216
    00223     void
    00224     addNodesInDocOrder(
    00225             const MutableNodeRefList&   nodelist,
    00226             XPathExecutionContext&      executionContext);
    00227
    00234     void
    00235     addNodeInDocOrder(
    00236             XalanNode*              node,
    00237             XPathExecutionContext&  executionContext);
    00238
    00242     void
    00243     clearNulls();
    00244
    00248     void
    00249     reverse();
    00250
    00256     void
    00257     reverseAssign(MutableNodeRefList&   nodelist) const;
    00258
    00273     void
    00274     reserve(size_type   theCount)
    00275     {
    00276         m_nodeList.reserve(theCount);
    00277     }
    00278
    00282     bool
    00283     getUnknownOrder() const
    00284     {
    00285         return m_order == eUnknownOrder ? true : false;
    00286     }
    00287
    00288     void
    00289     setUnknownOrder()
    00290     {
    00291         m_order = eUnknownOrder;
    00292     }
    00293
    00297     bool
    00298     getDocumentOrder() const
    00299     {
    00300         return m_order == eDocumentOrder ? true : false;
    00301     }
    00302
    00308     void
    00309     setDocumentOrder()
    00310     {
    00311         m_order = eDocumentOrder;
    00312     }
    00313
    00317     bool
    00318     getReverseDocumentOrder() const
    00319     {
    00320         return m_order == eReverseDocumentOrder ? true : false;
    00321     }
    00322
    00328     void
    00329     setReverseDocumentOrder()
    00330     {
    00331         m_order = eReverseDocumentOrder;
    00332     }
    00333
    00334     typedef NodeListVectorType::iterator    NodeListIteratorType;
    00335
    00336     class addNodeInDocOrderFunctor
    00337     {
    00338     public:
    00339
    00340         addNodeInDocOrderFunctor(
    00341                 MutableNodeRefList&     theList,
    00342                 XPathExecutionContext&  theExecutionContext) :
    00343             m_list(theList),
    00344             m_executionContext(theExecutionContext)
    00345         {
    00346         }
    00347
    00348         void
    00349         operator()(XalanNode*   theNode) const
    00350         {
    00351             m_list.addNodeInDocOrder(theNode, m_executionContext);
    00352         }
    00353
    00354     private:
    00355
    00356         MutableNodeRefList&     m_list;
    00357
    00358         XPathExecutionContext&  m_executionContext;
    00359     };
    00360
    00361     void
    00362     swap(MutableNodeRefList&    theOther)
    00363     {
    00364         NodeRefList::swap(theOther);
    00365
    00366         const eOrder    temp = m_order;
    00367
    00368         m_order = theOther.m_order;
    00369
    00370         theOther.m_order = temp;
    00371     }
    00372
    00373 private:
    00374
    00375     // An enum to determine what the order of the nodes is...
    00376     enum eOrder { eUnknownOrder, eDocumentOrder, eReverseDocumentOrder };
    00377
    00378     eOrder  m_order;
    00379 };
    00380
    00381
    00382
    00383 XALAN_CPP_NAMESPACE_END
    00384
    00385
    00386
    00387 #endif  // MUTABLENODEREFLIST_HEADER_GUARD_1357924680

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.7 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.