#include <casa/Exceptions.h>
#include <tables/TaQL/TableParse.h>
#include <tables/TaQL/TableGram.h>
#include <tables/Tables/TableDesc.h>
#include <tables/Tables/TableLock.h>
#include <tables/Tables/TableIter.h>
#include <casa/Arrays/ArrayMath.h>
#include <casa/Arrays/MatrixMath.h>
#include <casa/Arrays/ArrayError.h>
#include <casa/Arrays/Matrix.h>
#include <tables/TaQL/ExprMathNode.h>
#include <tables/TaQL/ExprMathNodeArray.h>
#include <tables/TaQL/ExprDerNode.h>
#include <tables/TaQL/ExprDerNodeArray.h>
#include <tables/TaQL/ExprFuncNode.h>
#include <tables/TaQL/ExprFuncNodeArray.h>
#include <tables/TaQL/ExprLogicNode.h>
#include <tables/TaQL/ExprLogicNodeArray.h>
#include <tables/TaQL/ExprNodeArray.h>
#include <tables/TaQL/ExprNodeSet.h>
#include <tables/TaQL/ExprNodeRep.h>
#include <tables/TaQL/ExprNodeRecord.h>
#include <tables/TaQL/ExprRange.h>
#include <tables/TaQL/RecordGram.h>
#include <casa/Utilities/DataType.h>
#include <casa/Utilities/Sort.h>
#include <casa/Quanta/MVTime.h>
#include <casa/System/ProgressMeter.h>
#include <flagging/Flagging/ExtendFlagger.h>
#include <casa/iomanip.h>
using namespace casacore;
int FlagID::compare (const void* val1, const void* val2) {
const FlagID& t1 = *(FlagID*)val1;
const FlagID& t2 = *(FlagID*)val2;
if (t1.time < t2.time) return -1;
if (t1.time > t2.time) return 1;
if (t1.ant1 < t2.ant1) return -1;
if (t1.ant1 > t2.ant1) return 1;
if (t1.ant2 < t2.ant2) return -1;
if (t1.ant2 > t2.ant2) return 1;
if (t1.spw < t2.spw) return -1;
if (t1.spw > t2.spw) return 1;
if (t1.corr < t2.corr) return -1;
if (t1.corr > t2.corr) return 1;
if (t1.chan < t2.chan) return -1;
if (t1.chan > t2.chan) return 1;
if (t1.polid < t2.polid) return -1;
if (t1.polid > t2.polid) return 1;