00001 /** 00002 * @file symbol_functors.h 00003 * Functors for symbol/sample comparison 00004 * 00005 * @remark Copyright 2002, 2003 OProfile authors 00006 * @remark Read the file COPYING 00007 * 00008 * @author Philippe Elie 00009 * @author John Levon 00010 */ 00011 00012 #ifndef SYMBOL_FUNCTORS_H 00013 #define SYMBOL_FUNCTORS_H 00014 00015 #include "symbol.h" 00016 00017 /// compare based on file location 00018 struct less_by_file_loc { 00019 bool operator()(sample_entry const * lhs, 00020 sample_entry const * rhs) const { 00021 return lhs->file_loc < rhs->file_loc; 00022 } 00023 00024 bool operator()(symbol_entry const * lhs, 00025 symbol_entry const * rhs) const { 00026 return lhs->sample.file_loc < rhs->sample.file_loc; 00027 } 00028 }; 00029 00030 00031 /// compare based on symbol contents 00032 struct less_symbol { 00033 // implementation compare by id rather than by string 00034 bool operator()(symbol_entry const & lhs, 00035 symbol_entry const & rhs) const; 00036 }; 00037 00038 #endif /* SYMBOL_FUNCTORS_H */
1.6.1