00001 /* 00002 * Copyright (C) 2005 M.J. Zaki <zaki@cs.rpi.edu> Rensselaer Polytechnic Institute 00003 * Written by parimi@cs.rpi.edu 00004 * Updated by chaojv@cs.rpi.edu, alhasan@cs.rpi.edu, salems@cs.rpi.edu 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 00019 */ 00020 #ifndef _HELPER_FUNS_H_ 00021 #define _HELPER_FUNS_H_ 00022 00023 #define HASHNS __gnu_cxx 00024 00025 //#include "pattern.h" 00026 00031 struct eqstr 00032 { 00037 bool operator()(const char* s1, const char* s2) const { 00038 return strcmp(s1, s2) == 0; 00039 } 00040 }; //end struct eqstr 00041 00046 struct eqint 00047 { 00052 bool operator()(int i1, int i2) const { 00053 return i1 == i2; 00054 } 00055 }; //end struct eqint 00056 00061 template<class PAT> 00062 struct less_than 00063 { 00064 bool operator() (const PAT* p1, const PAT* p2) const { 00065 return (*p1 < *p2); 00066 } 00067 }; 00068 00069 #endif