// This is for page. public ReadSpec(ReadCounter counter, RCSymbol left, int skipFirst, int totalLimit, bool showDeleted) { // For paging. _counter = counter; _forward = totalLimit >= 0; _ignoreDispatchedRows = false; _start = 0; // each symbol is unlimited individually. But the total is going to be limited by // stopAfter. _unlimited = true; _symbolLimit = int.MaxValue; _skipFirst = Math.Abs(skipFirst); _totalLimit = Math.Abs(totalLimit); ShowDeleted = showDeleted; left = _counter.ConcreteSymbols(left, showDeleted); for (int i = 0; i < left.Count; ++i) { Add(left[i], 0, _symbolLimit); } }
public Reader(RCCube source, ReadSpec spec, ReadCounter counter, bool forceGCol, int end) { if (source == null) { throw new ArgumentNullException("source"); } if (spec == null) { throw new ArgumentNullException("spec"); } if (counter == null) { throw new ArgumentNullException("counter"); } _source = source; _spec = spec; _counter = counter; _end = end; RCArray <string> axisCols = new RCArray <string> (source.Axis.Colset); if (forceGCol) { axisCols.Write("G"); } if (_source.Axis.Global != null && _source.Axis.Count > 0) { _initg = _source.Axis.Global[0]; } _target = new RCCube(axisCols); }
// This is for read and its ilk // In this case symbols are added by the client public ReadSpec(ReadCounter counter, int defaultLimit, bool force, bool fill) { _counter = counter; _forward = defaultLimit >= 0; _unlimited = defaultLimit == 0; _symbolLimit = Math.Abs(_unlimited ? int.MaxValue : defaultLimit); _force = force; }
public Writer(RCCube target, ReadCounter counter, bool keepIncrs, bool force, long initg) { // counter may be null; // If the counter is null then Timeline won't increment the counter on Writes. // Cube created using merge don't have counters, maybe this should change. _initg = initg; _target = target; _counter = counter; _keepIncrs = keepIncrs; _force = force; }
public ReadSpec(ReadCounter counter, RCSymbol left, RCLong right, int defaultLimit, bool ignoreDispatchedRows, bool force, bool fill, bool showDeleted) { _counter = counter; ShowDeleted = showDeleted; _ignoreDispatchedRows = ignoreDispatchedRows; _force = force; _fill = fill; if (right.Count == 1) { // It's the start point. _forward = defaultLimit >= 0; _unlimited = defaultLimit == 0; _symbolLimit = Math.Abs(_unlimited ? int.MaxValue : defaultLimit); left = _counter.ConcreteSymbols(left, showDeleted); for (int i = 0; i < left.Count; ++i) { Add(left[i], (int)right[0], _symbolLimit); } } else if (right.Count == 2) { // It's the start point and the limit. _forward = right[1] >= 0; _unlimited = right[1] == 0; _symbolLimit = Math.Abs(_unlimited ? int.MaxValue : (int)right[1]); left = _counter.ConcreteSymbols(left, showDeleted); for (int i = 0; i < left.Count; ++i) { Add(left[i], (int)right[0], _symbolLimit); } } else { // Who knows what this should do. // Maybe let you give different counts for each symbol. throw new ArgumentException("Read takes a maximum of two right arguments."); } }