00001 #ifndef Impala_Core_Table_KeywordListDiff_h
00002 #define Impala_Core_Table_KeywordListDiff_h
00003
00004 #include "Core/Table/KeywordList.h"
00005
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Table
00011 {
00012
00013
00014 inline int
00015 KeywordListDiff(KeywordList& l1, KeywordList& l2)
00016 {
00017 ILOG_VAR(Impala.Core.Table.KeywordListDiff);
00018
00019 if (l1.size() != l2.size())
00020 {
00021 ILOG_ERROR("sizes differs: " << l1.size() << " vs " << l2.size());
00022 return 1;
00023 }
00024 int nDiff = 0;
00025 for (int i=0 ; i<l1.size() ; i++)
00026 {
00027 if (l1[i] != l2[i])
00028 {
00029 ILOG_DEBUG("nr " << i << " differs " << l1[i] << " vs " << l2[i]);
00030 nDiff++;
00031 }
00032 }
00033 if (nDiff > 0)
00034 ILOG_ERROR("Found " << nDiff << " differences");
00035 return nDiff;
00036 }
00037
00038 }
00039 }
00040 }
00041
00042 #endif