dbertoni    2002/08/04 21:55:50

  Modified:    c/src/XalanExtensions FunctionNodeSet.cpp
  Log:
  Use new proxy class.
  
  Revision  Changes    Path
  1.9       +72 -1     xml-xalan/c/src/XalanExtensions/FunctionNodeSet.cpp
  
  Index: FunctionNodeSet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanExtensions/FunctionNodeSet.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FunctionNodeSet.cpp       26 Apr 2002 06:25:23 -0000      1.8
  +++ FunctionNodeSet.cpp       5 Aug 2002 04:55:50 -0000       1.9
  @@ -62,6 +62,9 @@
   #include <XPath/XObjectFactory.hpp>
   
   
  +#include <XSLT/ResultTreeFragBaseNodeRefListBaseProxy.hpp>
  +
  +
   
   class XResultTreeFragNodeSetProxy : public XNodeSetBase
   {
  @@ -139,6 +142,74 @@
   
   
   
  +class ResultTreeFragBaseXNodeSetBaseProxy : public XNodeSetBase
  +{
  +public:
  +
  +     ResultTreeFragBaseXNodeSetBaseProxy(const XObjectPtr&   theXObject) :
  +             XNodeSetBase(),
  +             m_xobject(theXObject),
  +             m_proxy(theXObject->rtree())
  +     {
  +     }
  +
  +     ResultTreeFragBaseXNodeSetBaseProxy(const 
ResultTreeFragBaseXNodeSetBaseProxy&  theSource) :
  +             XNodeSetBase(theSource),
  +             m_xobject(theSource.m_xobject),
  +             m_proxy(theSource.m_proxy)
  +     {
  +     }
  +
  +     virtual
  +     ~ResultTreeFragBaseXNodeSetBaseProxy()
  +     {
  +     }
  +
  +     // These methods are inherited from XNodeSetBase...
  +#if defined(XALAN_NO_COVARIANT_RETURN_TYPE)
  +     virtual XObject*
  +#else
  +     virtual ResultTreeFragBaseXNodeSetBaseProxy*
  +#endif
  +     clone(void*             theAddress = 0) const
  +     {
  +             return theAddress == 0 ? new 
ResultTreeFragBaseXNodeSetBaseProxy(*this) :
  +                             new (theAddress) 
ResultTreeFragBaseXNodeSetBaseProxy(*this);
  +     }
  +
  +     virtual const NodeRefListBase&
  +     nodeset() const
  +     {
  +             return m_proxy;
  +     }
  +
  +     virtual void
  +     dereferenced()
  +     {
  +             delete this;
  +     }
  +
  +     virtual XalanNode*
  +     item(size_type  index) const
  +     {
  +             return m_proxy.item(index);
  +     }
  +
  +     virtual size_type
  +     getLength() const
  +     {
  +             return m_proxy.getLength();
  +     }
  +
  +private:
  +
  +     const XObjectPtr                                                        
        m_xobject;
  +
  +     const ResultTreeFragBaseNodeRefListBaseProxy    m_proxy;
  +};
  +
  +
  +
   FunctionNodeSet::FunctionNodeSet(bool        convertString) :
        m_convertString(convertString)
   {
  @@ -171,7 +242,7 @@
        if (theType == XObject::eTypeResultTreeFrag ||
                (theType == XObject::eTypeString && m_convertString == true))
        {
  -             return XObjectPtr(new XResultTreeFragNodeSetProxy(args[0]));
  +             return XObjectPtr(new 
ResultTreeFragBaseXNodeSetBaseProxy(args[0]));
        }
        else
        {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to