-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComparator.H
33 lines (29 loc) · 889 Bytes
/
Comparator.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/***********************************************************************
Comparator.H
BOOM : Bioinformatics Object Oriented Modules
Copyright (C)2012 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
***********************************************************************/
#ifndef INCL_BOOM_Comparator_H
#define INCL_BOOM_Comparator_H
using namespace std;
namespace BOOM {
template <class T>
class Comparator
{
public:
virtual bool equal(T &a,T &b)=0;
virtual bool greater(T &a,T &b)=0;
virtual bool less(T &a,T &b)=0;
};
template <class T>
class DirectComparator : public BOOM::Comparator<T>
{
public:
virtual bool equal(T &a,T &b) {return a==b;}
virtual bool greater(T &a,T &b) {return a>b;}
virtual bool less(T &a,T &b) {return a<b;}
};
}
#endif