metaproxy  1.13.0
Classes | Namespaces | Functions | Variables
filter_sort.cpp File Reference
#include "config.hpp"
#include "filter_sort.hpp"
#include <metaproxy/package.hpp>
#include <metaproxy/util.hpp>
#include <yaz/diagbib1.h>
#include <yaz/copy_types.h>
#include <yaz/log.h>
#include <yaz/oid_std.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <yaz/zgdu.h>
Include dependency graph for filter_sort.cpp:

Go to the source code of this file.

Classes

class  metaproxy_1::filter::Sort::Impl
 
class  metaproxy_1::filter::Sort::Record
 
class  metaproxy_1::filter::Sort::RecordList
 
class  metaproxy_1::filter::Sort::ResultSet
 
class  metaproxy_1::filter::Sort::Frontend
 

Namespaces

 metaproxy_1
 
 metaproxy_1::filter
 

Functions

static void print_xpath_nodes (xmlNodeSetPtr nodes, FILE *output)
 
static mp::filter::Base * filter_creator ()
 

Variables

struct metaproxy_1_filter_struct metaproxy_1_filter_sort
 

Function Documentation

static mp::filter::Base* filter_creator ( )
static

Definition at line 747 of file filter_sort.cpp.

748 {
749  return new mp::filter::Sort;
750 }
static void print_xpath_nodes ( xmlNodeSetPtr  nodes,
FILE *  output 
)
static

Definition at line 123 of file filter_sort.cpp.

References metaproxy_1::filter::Sort::Impl::Frontend, metaproxy_1::filter::Sort::Impl::get_frontend(), metaproxy_1::filter::Sort::Impl::Impl(), metaproxy_1::filter::Sort::Impl::m_ascending, metaproxy_1::filter::Sort::Impl::m_clients, metaproxy_1::filter::Sort::Impl::m_cond_session_ready, metaproxy_1::filter::Sort::Impl::m_debug, metaproxy_1::filter::Sort::Impl::m_mutex, metaproxy_1::filter::Sort::Impl::m_namespaces, metaproxy_1::filter::Sort::m_p, metaproxy_1::filter::Sort::Impl::m_prefetch, metaproxy_1::filter::Sort::Impl::m_xpath_expr, and metaproxy_1::filter::Sort::Impl::release_frontend().

124 {
125  xmlNodePtr cur;
126  int size;
127  int i;
128 
129  assert(output);
130  size = nodes ? nodes->nodeNr : 0;
131 
132  fprintf(output, "Result (%d nodes):\n", size);
133  for (i = 0; i < size; ++i) {
134  assert(nodes->nodeTab[i]);
135 
136  if (nodes->nodeTab[i]->type == XML_NAMESPACE_DECL)
137  {
138  xmlNsPtr ns = (xmlNsPtr)nodes->nodeTab[i];
139  cur = (xmlNodePtr)ns->next;
140  if (cur->ns)
141  fprintf(output, "= namespace \"%s\"=\"%s\" for node %s:%s\n",
142  ns->prefix, ns->href, cur->ns->href, cur->name);
143  else
144  fprintf(output, "= namespace \"%s\"=\"%s\" for node %s\n",
145  ns->prefix, ns->href, cur->name);
146  }
147  else if (nodes->nodeTab[i]->type == XML_ELEMENT_NODE)
148  {
149  cur = nodes->nodeTab[i];
150  if (cur->ns)
151  fprintf(output, "= element node \"%s:%s\"\n",
152  cur->ns->href, cur->name);
153  else
154  fprintf(output, "= element node \"%s\"\n", cur->name);
155  }
156  else
157  {
158  cur = nodes->nodeTab[i];
159  fprintf(output, "= node \"%s\": type %d\n", cur->name, cur->type);
160  }
161  }
162 }

Here is the call graph for this function:

Variable Documentation

struct metaproxy_1_filter_struct metaproxy_1_filter_sort
Initial value:
= {
0,
"sort",
}
static mp::filter::Base * filter_creator()

Definition at line 753 of file filter_sort.cpp.

Referenced by metaproxy_1::FactoryStatic::FactoryStatic().