18 using System.Collections.Generic;
24 namespace Deveel.Data.Protocol {
47 using (var rowEnum = result.GetEnumerator()) {
48 if (rowEnum.MoveNext()) {
49 int rowIndex = rowEnum.Current.RowId.RowNumber;
50 for (
int c = 0; c < columnCount; ++c) {
60 if (!resultIsSimpleEnum) {
61 rowIndexMap =
new List<int>(result.
RowCount);
63 var en = result.GetEnumerator();
64 while (en.MoveNext()) {
65 rowIndexMap.Add(en.Current.RowId.RowNumber);
75 for (
int i = 0; i < colCount; ++i) {
76 var v = result.GetResolvedColumnName(i);
78 if (v.ParentName == null) {
80 fieldName = String.Format(
"@a{0}", v.Name);
83 fieldName = String.Format(
"@f{0}", v);
92 public ITable Result {
get;
private set; }
98 public int ColumnCount {
99 get {
return Result.TableInfo.ColumnCount; }
103 if (columnOffset < 0 || columnOffset >= ColumnCount)
104 throw new ArgumentOutOfRangeException(
"columnOffset");
106 return columns[columnOffset];
132 throw new Exception(
"Table roots not locked!");
134 int realRow = resultIsSimpleEnum ? rowIndex : rowIndexMap[rowIndex];
135 var obj = Result.GetValue(realRow, columnIndex);
Defines the contract to access the data contained into a table of a database.
DataObject GetValue(int rowIndex, int columnIndex)
QueryResultColumn GetColumn(int columnOffset)
DataObject GetValue(long rowNumber, int columnOffset)
Gets a single cell within the table that is located at the given column offset and row...
int locked
Incremented when we Lock roots.
QueryResultColumn[] columns
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
TableInfo TableInfo
Gets the metadata information of the table, used to resolve the column sources.
int RowCount
Gets the total number of rows in the table.
QueryResult(SqlQuery query, ITable result)
IList< int > rowIndexMap
The IList that contains the row index into the table for each row of the result.
int ColumnCount
Gets a count of the columns defined by this object.
void FormColumns(ITable result)