#nullable disable
using System;
using System.Collections;
using System.Collections.Generic;
namespace BCG
{
///
/// This class is used to effect a mapping between values in a join column and entries in three different tables:
/// the left and right tables of a join, as well as the output table (the join table).
///
class ParallelJoinTestTablePointer
{
int myLeftTableId = -1;
public int LeftTableId
{
get { return myLeftTableId; }
set { myLeftTableId = value; }
}
int myRightTableId = -1;
public int RightTableId
{
get { return myRightTableId; }
set { myRightTableId = value; }
}
int myJoinTableId = -1;
public int JoinTableId
{
get { return myJoinTableId; }
set { myJoinTableId = value; }
}
public ParallelJoinTestTablePointer(int leftId, int rightId, int joinId)
{
myLeftTableId = leftId;
myRightTableId = rightId;
myJoinTableId = joinId;
}
public ParallelJoinTestTablePointer() : this(-1,-1,-1)
{
}
}
#region IBlueRow implementation for join and leftJoin
public class ParallelJoinTestRow : IBlueRow
{
private JoinProjectHelper myHelper;
private IBlueRow myLeftRow, myRightRow;
int myID;
public ParallelJoinTestRow(int id, IBlueRow leftRow, IBlueRow rightRow, JoinProjectHelper joinProjectHelper)
{
myID = id;
myLeftRow = leftRow;
myRightRow = rightRow;
myHelper = joinProjectHelper;
}
public int leftID { get { return (int)myLeftRow["id"]; } }
public int rightID { get { return (int)myRightRow["id"]; } }
public IBlueRow leftRow { get { return myLeftRow; } }
public IBlueRow rightRow { get { return myRightRow; } }
#region IBlueRow Members
public IBlueTableSchema schema { get { return myHelper.schema; } }
public object this[int index] { get { return this[schema[index].colName]; } }
public object this[string colName]
{
get
{
if (colName == "id")
return myID;
else
{
bool isLeft;
string col = myHelper.getOriginalCol(colName, out isLeft);
return isLeft ? myLeftRow[col] : (myRightRow == null ? (object)DBNull.Value : myRightRow[col]);
}
}
}
#endregion
#region IDictionary Members
public void Add(object key, object value) { { throw new NotSupportedException("IBlueRow is readonly"); } }
public void Clear() { throw new NotSupportedException("IBlueRow is readonly"); }
public bool Contains(object key) { throw new Exception("The method or operation is not implemented."); }
public System.Collections.IDictionaryEnumerator GetEnumerator() { return new BlueRowDictionaryEnumerator(this); }
public bool IsFixedSize { get { return true; } }
public bool IsReadOnly {get { return true; }}
public System.Collections.ICollection Keys { get { return schema.columnNames; } }
public void Remove(object key) { throw new NotSupportedException("IBlueRow is readonly"); }
public System.Collections.ICollection Values
{
get
{
List