metaproxy  1.21.0
Public Member Functions | Private Attributes | List of all members
metaproxy_1::filter::Sort::RecordList Class Reference
Inheritance diagram for metaproxy_1::filter::Sort::RecordList:
Inheritance graph
Collaboration diagram for metaproxy_1::filter::Sort::RecordList:
Collaboration graph

Public Member Functions

bool cmp (Odr_oid *syntax)
 
void add (Z_NamePlusRecord *s)
 
int size ()
 
Z_NamePlusRecord * get (int i, bool ascending)
 
void sort ()
 
 RecordList (Odr_oid *, std::string namespaces, std::string xpath_expr, bool debug)
 
 ~RecordList ()
 

Private Attributes

Odr_oid * syntax
 
std::list< Recordnpr_list
 
mp::odr m_odr
 
std::string namespaces
 
std::string xpath_expr
 
bool debug
 

Detailed Description

Definition at line 75 of file filter_sort.cpp.

Constructor & Destructor Documentation

◆ RecordList()

mp::filter::Sort::RecordList::RecordList ( Odr_oid *  syntax,
std::string  namespaces,
std::string  xpath_expr,
bool  debug 
)

Definition at line 296 of file filter_sort.cpp.

300  : namespaces(a_namespaces), xpath_expr(a_xpath_expr), debug(a_debug)
301 
302 {
303  if (syntax)
304  this->syntax = odr_oiddup(m_odr, syntax);
305  else
306  this->syntax = 0;
307 }

References m_odr, and syntax.

◆ ~RecordList()

mp::filter::Sort::RecordList::~RecordList ( )

Definition at line 309 of file filter_sort.cpp.

310 {
311 
312 }

Member Function Documentation

◆ add()

void mp::filter::Sort::RecordList::add ( Z_NamePlusRecord *  s)

Definition at line 328 of file filter_sort.cpp.

329 {
330  ODR oi = m_odr;
331  Z_NamePlusRecord *npr = yaz_clone_z_NamePlusRecord(s, oi->mem);
332  Record record(npr, namespaces.c_str(), xpath_expr.c_str(), debug);
333  npr_list.push_back(record);
334 }

◆ cmp()

bool mp::filter::Sort::RecordList::cmp ( Odr_oid *  syntax)

Definition at line 314 of file filter_sort.cpp.

315 {
316  if ((!this->syntax && !syntax)
317  ||
318  (this->syntax && syntax && !oid_oidcmp(this->syntax, syntax)))
319  return true;
320  return false;
321 }

◆ get()

Z_NamePlusRecord * mp::filter::Sort::RecordList::get ( int  i,
bool  ascending 
)

Definition at line 336 of file filter_sort.cpp.

337 {
338  std::list<Record>::const_iterator it = npr_list.begin();
339  int i = pos;
340  if (!ascending)
341  i = npr_list.size() - pos - 1;
342  for (; it != npr_list.end(); it++, --i)
343  if (i <= 0)
344  {
345  return it->npr;
346  }
347  return 0;
348 }

◆ size()

int mp::filter::Sort::RecordList::size ( )

Definition at line 323 of file filter_sort.cpp.

324 {
325  return npr_list.size();
326 }

◆ sort()

void mp::filter::Sort::RecordList::sort ( )

Definition at line 350 of file filter_sort.cpp.

351 {
352  npr_list.sort();
353 }

Member Data Documentation

◆ debug

bool metaproxy_1::filter::Sort::RecordList::debug
private

Definition at line 81 of file filter_sort.cpp.

◆ m_odr

mp::odr metaproxy_1::filter::Sort::RecordList::m_odr
private

Definition at line 78 of file filter_sort.cpp.

Referenced by RecordList().

◆ namespaces

std::string metaproxy_1::filter::Sort::RecordList::namespaces
private

Definition at line 79 of file filter_sort.cpp.

◆ npr_list

std::list<Record> metaproxy_1::filter::Sort::RecordList::npr_list
private

Definition at line 77 of file filter_sort.cpp.

◆ syntax

Odr_oid* metaproxy_1::filter::Sort::RecordList::syntax
private

Definition at line 76 of file filter_sort.cpp.

Referenced by RecordList().

◆ xpath_expr

std::string metaproxy_1::filter::Sort::RecordList::xpath_expr
private

Definition at line 80 of file filter_sort.cpp.


The documentation for this class was generated from the following file: