public QuantizeLifetimePipe(QuantizeLifetimeStreamable <TKey, TPayload> stream, IStreamObserver <TKey, TPayload> observer, long width, long skip, long offset)
            : base(stream, observer)
        {
            this.pool          = MemoryManager.GetMemoryPool <TKey, TPayload>(stream.Properties.IsColumnar);
            this.errorMessages = stream.ErrorMessages;
            this.pool.Get(out this.output);
            this.output.Allocate();

            this.width  = width;
            this.skip   = skip;
            this.offset = offset;
        }
        internal static Tuple <Type, string> Generate <TKey, TPayload>(QuantizeLifetimeStreamable <TKey, TPayload> stream)
        {
            Contract.Requires(stream != null);
            Contract.Ensures(Contract.Result <Tuple <Type, string> >() == null || typeof(UnaryPipe <TKey, TPayload, TPayload>).GetTypeInfo().IsAssignableFrom(Contract.Result <Tuple <Type, string> >().Item1));

#if CODEGEN_TIMING
            Stopwatch sw = new Stopwatch();
            sw.Start();
#endif
            var template = new QuantizeLifetimeTemplate(
                $"GeneratedQuantizeLifetime_{QuantizeLifetimeSequenceNumber++}",
                typeof(TKey), typeof(TPayload));

            return(template.Generate <TKey, TPayload>(typeof(IStreamable <,>)));
        }