コード例 #1
0
        private static BufferWriter GetWriter(MetadataIdentity source, IRelationHeader header)
        {
            RelationCacheKey key = new RelationCacheKey(source, header);

            return(cache.GetOrAdd(key, _ =>
            {
                BufferParser parser = new BufferParser();
                BufferTree tree = parser.Parse(source, header);
                RelationCompiler compiler = new RelationCompiler();

                return compiler.Compile(tree);
            }));
        }
コード例 #2
0
        public BufferWriter Compile(BufferTree tree)
        {
            DotNotation notation = tree.Notation;

            Delegate[]          binders  = this.GetBindersArgument(tree);
            IRelationMetadata[] metadata = this.GetMetadataArgument(tree);

            BufferInternalWriter        initializer = this.Compile(tree.Source, tree.Queues, tree.Header.Degree);
            List <BufferInternalWriter> writers     = tree.Queues.Select(this.Compile).ToList();

            return(new BufferWriter()
            {
                Initializer = this.Recompile(initializer, notation, binders, metadata),
                Queues = writers.Select(w => this.Recompile(w, notation, binders, metadata)).ToArray(),
            });
        }