void InitializeNewContext(AmtEncodingInstruction inst, uint currentIndex) { mCurrentContext = new AmtEncoderContext { Category = inst.Category, First = currentIndex, Last = currentIndex, }; mContexts.Add(mCurrentContext); }
public void Chunk(List <AmtEncodingInstruction> instructions) { var contexts = new List <AmtEncoderContext>(); AmtEncoderContext currentContext = null; var count = (uint)instructions.Count; for (uint i = 0; i < count; ++i) { var inst = instructions[(int)i]; if (currentContext == null) { currentContext = new AmtEncoderContext { Category = inst.Category, First = i, Last = i, }; contexts.Add(currentContext); } else { if (currentContext.Category == inst.Category) { currentContext.Last = i; } else { currentContext = new AmtEncoderContext { Category = inst.Category, First = i, Last = i, }; contexts.Add(currentContext); } } } }
public void Clear() { mContexts.Clear(); mInstructions.Clear(); mCurrentContext = null; }
public AmtIncrementalChunkifier() { mContexts = new List <AmtEncoderContext>(); mInstructions = new List <AmtRecordInstruction>(); mCurrentContext = null; }