Xmipp  v3.23.11-Nereus
Public Member Functions | List of all members
MDValueRange Class Reference

#include <metadata_query.h>

Inheritance diagram for MDValueRange:
Inheritance graph
[legend]
Collaboration diagram for MDValueRange:
Collaboration graph
[legend]

Public Member Functions

 MDValueRange ()
 
template<class T >
 MDValueRange (MDLabel label, const T &valueMin, const T &valueMax, int limit=-1, int offset=0, MDLabel orderLabel=MDL_OBJID)
 
 MDValueRange (const MDObject &o1, const MDObject &o2, int limit=-1, int offset=0, MDLabel orderLabel=MDL_OBJID)
 
virtual String queryStringFunc () const
 
 ~MDValueRange ()
 
- Public Member Functions inherited from MDQuery
 MDQuery (int limit=-1, int offset=0, MDLabel orderLabel=MDL_OBJID, bool asc=true)
 
virtual ~MDQuery ()
 
String orderByString () const
 
String limitString () const
 
String whereString () const
 

Additional Inherited Members

- Public Attributes inherited from MDQuery
int limit
 If distint of -1 the results will be limited to this value. More...
 
int offset
 If distint of 0, offset elements will be discarded. More...
 
MDLabel orderLabel
 Label to which apply sort of the results. More...
 
bool asc
 

Detailed Description

This subclass of Query will test if a label have a value within a minimum and maximum.

//Remove all images with rotational angle between 100 and 200

Definition at line 252 of file metadata_query.h.

Constructor & Destructor Documentation

◆ MDValueRange() [1/3]

MDValueRange::MDValueRange ( )
inline

Definition at line 256 of file metadata_query.h.

257  {
258  query1=query2=NULL;
259  }

◆ MDValueRange() [2/3]

template<class T >
MDValueRange::MDValueRange ( MDLabel  label,
const T &  valueMin,
const T &  valueMax,
int  limit = -1,
int  offset = 0,
MDLabel  orderLabel = MDL_OBJID 
)
inline

Definition at line 261 of file metadata_query.h.

263  {
264  query1 = new MDValueRelational(label, valueMin, GE);
265  query2 = new MDValueRelational(label, valueMax, LE);
266  }
int limit
If distint of -1 the results will be limited to this value.
MDLabel orderLabel
Label to which apply sort of the results.
int offset
If distint of 0, offset elements will be discarded.
Greater equal.
MDQuery(int limit=-1, int offset=0, MDLabel orderLabel=MDL_OBJID, bool asc=true)
Less equal.

◆ MDValueRange() [3/3]

MDValueRange::MDValueRange ( const MDObject o1,
const MDObject o2,
int  limit = -1,
int  offset = 0,
MDLabel  orderLabel = MDL_OBJID 
)
inline

Definition at line 268 of file metadata_query.h.

270  {
271  if (o1.label != o2.label)
272  REPORT_ERROR(ERR_VALUE_INCORRECT, "Labels should be the same");
273  query1 = new MDValueRelational(o1, GE);
274  query2 = new MDValueRelational(o2, LE);
275 
276  }
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
int limit
If distint of -1 the results will be limited to this value.
MDLabel orderLabel
Label to which apply sort of the results.
int offset
If distint of 0, offset elements will be discarded.
MDLabel label
Greater equal.
MDQuery(int limit=-1, int offset=0, MDLabel orderLabel=MDL_OBJID, bool asc=true)
Less equal.
Incorrect value received.
Definition: xmipp_error.h:195

◆ ~MDValueRange()

MDValueRange::~MDValueRange ( )
inline

Definition at line 279 of file metadata_query.h.

280  {
281  delete query1;
282  delete query2;
283  }

Member Function Documentation

◆ queryStringFunc()

String MDValueRange::queryStringFunc ( ) const
virtual

Return the query string, should be overrided in subclasses

Reimplemented from MDQuery.

Definition at line 15 of file metadata_query.cpp.

16 {
17  std::stringstream ss;
18  ss << "(" << query1->queryStringFunc() << " AND " << query2->queryStringFunc() << ")";
19  return ss.str();
20 }
virtual String queryStringFunc() const

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