00001 #ifndef Impala_Core_Table_RemoveRow_h
00002 #define Impala_Core_Table_RemoveRow_h
00003
00004 #include "Core/Column/RemoveRow.h"
00005
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Table
00011 {
00012
00013
00014 template <class T>
00015 inline void
00016 RemoveRow(T* table, int row)
00017 {
00018 if ((row < 0) || (row >= table->Size()))
00019 return;
00020 Column::RemoveRow(table->GetColumn1(), row, table->Size());
00021 Column::RemoveRow(table->GetColumn2(), row, table->Size());
00022 Column::RemoveRow(table->GetColumn3(), row, table->Size());
00023 Column::RemoveRow(table->GetColumn4(), row, table->Size());
00024 Column::RemoveRow(table->GetColumn5(), row, table->Size());
00025 Column::RemoveRow(table->GetColumn6(), row, table->Size());
00026 Column::RemoveRow(table->GetColumn7(), row, table->Size());
00027 Column::RemoveRow(table->GetColumn8(), row, table->Size());
00028 Column::RemoveRow(table->GetColumn9(), row, table->Size());
00029 table->SetSize(table->Size() - 1);
00030 }
00031
00032 template <class T>
00033 inline void
00034 RemoveRow(T* table, bool* filter)
00035 {
00036 if (!filter)
00037 return;
00038 Column::RemoveRow(table->GetColumn1(), filter, table->Size());
00039 Column::RemoveRow(table->GetColumn2(), filter, table->Size());
00040 Column::RemoveRow(table->GetColumn3(), filter, table->Size());
00041 Column::RemoveRow(table->GetColumn4(), filter, table->Size());
00042 Column::RemoveRow(table->GetColumn5(), filter, table->Size());
00043 Column::RemoveRow(table->GetColumn6(), filter, table->Size());
00044 Column::RemoveRow(table->GetColumn7(), filter, table->Size());
00045 Column::RemoveRow(table->GetColumn8(), filter, table->Size());
00046 Column::RemoveRow(table->GetColumn9(), filter, table->Size());
00047 int nSize = 0;
00048 for (int i=0 ; i<table->Size() ; i++)
00049 if (! filter[i])
00050 nSize++;
00051 table->SetSize(nSize);
00052 }
00053
00054 }
00055 }
00056 }
00057
00058 #endif