NCBI C++ ToolKit
node_set_impl.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /*
2  * Redistribution and use in source and binary forms, with or without
3  * modification, are permitted provided that the following conditions
4  * are met:
5  *
6  * 1. Redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer.
8  * 2. Redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in
10  * the documentation and/or other materials provided with the
11  * distribution.
12  * 3. Neither the name of the Author nor the names of its contributors
13  * may be used to endorse or promote products derived from this software
14  * without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
19  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
20  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  */
29 
30 /*
31  * $Id: node_set_impl.hpp 55934 2012-10-10 15:55:27Z satskyse $
32  */
33 
34 /** @file
35  * This file contains the definition of the xml::impl::nset_impl class.
36 **/
37 
38 
39 #ifndef _xmlwrapp_node_set_impl_hpp_
40 #define _xmlwrapp_node_set_impl_hpp_
41 
42 
43 // xmlwrapp includes
44 #include <misc/xmlwrapp/node.hpp>
45 
46 // libxml2
47 #include <libxml/xpath.h>
48 
49 namespace xml
50 {
51  namespace impl
52  {
53  // Private implementation of the node_set class.
54  // It holds the libxml2 pointer to the XPath query results and provides
55  // the reference counting
56  struct nset_impl
57  {
58  // XPath query results
59  xmlXPathObjectPtr results_;
60 
61  nset_impl(void* results);
62  void inc_ref();
63  void dec_ref();
64  node & get_reference(int index);
65  void set_ownership(bool owe);
66 
67  protected:
68  ~nset_impl();
69 
70  private:
71  size_t refcnt_; // reference counter
72  bool owe_;
73  };
74  }
75 
76 } // namespace xml
77 
78 #endif
79 
The xml::node class is used to hold information about one XML node.
Definition: node.hpp:106
This file contains the definition of the xml::node class.
XML library namespace.
Definition: attributes.hpp:57
xmlXPathObjectPtr results_
nset_impl(void *results)
Definition: node_set.cpp:59
node & get_reference(int index)
Definition: node_set.cpp:78
void set_ownership(bool owe)
Definition: node_set.cpp:87
Modified on Fri Jun 07 13:34:01 2024 by modify_doxy.py rev. 669887