• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# VarVec类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中VarVec的典型用法代码示例。如果您正苦于以下问题:C# VarVec类的具体用法?C# VarVec怎么用?C# VarVec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VarVec类属于命名空间,在下文中一共展示了VarVec类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Table

        internal Table(Command command, TableMD tableMetadata, int tableId)
        {
            m_tableMetadata = tableMetadata;
            m_columns = Command.CreateVarList();
            m_keys = command.CreateVarVec();
            m_nonnullableColumns = command.CreateVarVec();
            m_tableId = tableId;

            var columnVarMap = new Dictionary<string, ColumnVar>();
            foreach (var c in tableMetadata.Columns)
            {
                var v = command.CreateColumnVar(this, c);
                columnVarMap[c.Name] = v;
                if (!c.IsNullable)
                {
                    m_nonnullableColumns.Set(v);
                }
            }

            foreach (var c in tableMetadata.Keys)
            {
                var v = columnVarMap[c.Name];
                m_keys.Set(v);
            }

            m_referencedColumns = command.CreateVarVec(m_columns);
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:27,代码来源:Table.cs


示例2: HasKeyReferences

        /// <summary>
        ///     Determines whether any var from a given list of keys is referenced by any of defining node's right relatives,
        ///     with the exception of the relatives brunching at the given targetJoinNode.
        /// </summary>
        /// <param name="keys"> A list of vars to check for </param>
        /// <param name="definingNode"> The node considered to be the defining node </param>
        /// <param name="targetJoinNode"> The relatives branching at this node are skipped </param>
        /// <returns> False, only it can determine that not a single var from a given list of keys is referenced by any of defining node's right relatives, with the exception of the relatives brunching at the given targetJoinNode. </returns>
        internal bool HasKeyReferences(VarVec keys, Node definingNode, Node targetJoinNode)
        {
            var currentChild = definingNode;
            Node parent;
            var continueUp = true;

            while (continueUp & m_nodeToParentMap.TryGetValue(currentChild, out parent))
            {
                if (parent != targetJoinNode)
                {
                    // Check the parent
                    if (HasVarReferencesShallow(parent, keys, m_nodeToSiblingNumber[currentChild], out continueUp))
                    {
                        return true;
                    }

                    //Check all the siblings to the right
                    for (var i = m_nodeToSiblingNumber[currentChild] + 1; i < parent.Children.Count; i++)
                    {
                        if (parent.Children[i].GetNodeInfo(m_command).ExternalReferences.Overlaps(keys))
                        {
                            return true;
                        }
                    }
                }
                currentChild = parent;
            }
            return false;
        }
开发者ID:hallco978,项目名称:entityframework,代码行数:37,代码来源:VarRefManager.cs


示例3: SetOp

 internal SetOp(OpType opType, VarVec outputs, VarMap left, VarMap right)
     : this(opType)
 {
     m_varMap = new VarMap[2];
     m_varMap[0] = left;
     m_varMap[1] = right;
     m_outputVars = outputs;
 }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:8,代码来源:SetOp.cs


示例4: GetHashValue

 // <summary>
 // Compute the hash value for a Vec
 // </summary>
 internal static int GetHashValue(VarVec vec)
 {
     var hashValue = 0;
     foreach (var v in vec)
     {
         hashValue ^= v.GetHashCode();
     }
     return hashValue;
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:12,代码来源:NodeInfo.cs


示例5: NestBaseOp

 internal NestBaseOp(
     OpType opType, List<SortKey> prefixSortKeys,
     VarVec outputVars,
     List<CollectionInfo> collectionInfoList)
     : base(opType)
 {
     m_outputs = outputVars;
     m_collectionInfoList = collectionInfoList;
     m_prefixSortKeys = prefixSortKeys;
 }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:10,代码来源:NestBaseOp.cs


示例6: ExtendedNodeInfo

 internal ExtendedNodeInfo(Command cmd)
     : base(cmd)
 {
     m_localDefinitions = cmd.CreateVarVec();
     m_definitions = cmd.CreateVarVec();
     m_nonNullableDefinitions = cmd.CreateVarVec();
     m_nonNullableVisibleDefinitions = cmd.CreateVarVec();
     m_keys = new KeyVec(cmd);
     m_minRows = RowCount.Zero;
     m_maxRows = RowCount.Unbounded;
 }
开发者ID:hallco978,项目名称:entityframework,代码行数:11,代码来源:ExtendedNodeInfo.cs


示例7: CollectionInfo

 internal CollectionInfo(
     Var collectionVar, ColumnMap columnMap, VarList flattenedElementVars, VarVec keys, List<SortKey> sortKeys,
     object discriminatorValue)
 {
     m_collectionVar = collectionVar;
     m_columnMap = columnMap;
     m_flattenedElementVars = flattenedElementVars;
     m_keys = keys;
     m_sortKeys = sortKeys;
     m_discriminatorValue = discriminatorValue;
 }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:11,代码来源:CollectionInfo.cs


示例8: CreateVarVec

 private static VarVec CreateVarVec(params int[] bits)
 {
     var command = new Mock<Command>();
     var vec = new VarVec(command.Object);
     bits.Each(b =>
                   {
                       var v = CreateVar(b);
                       vec.Set(v);
                       command.Setup(m => m.GetVar(b)).Returns(v);
                   });
     return vec;
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:12,代码来源:VarVecTests.cs


示例9: GetPushdownPredicate

        /// <summary>
        ///     Split up a predicate into 2 parts - the pushdown and the non-pushdown predicate.
        ///     If the filter node has no external references *and* the "columns" parameter is null,
        ///     then the entire predicate can be pushed down
        ///     We then compute the set of valid column references - if the "columns" parameter
        ///     is non-null, this set is used. Otherwise, we get the definitions of the
        ///     input relop node of the filterOp, and use that.
        ///     We use this list of valid column references to identify which parts of the filter
        ///     predicate can be pushed down - only those parts of the predicate that do not
        ///     reference anything beyond these columns are considered for pushdown. The rest are
        ///     stuffed into the nonPushdownPredicate output parameter
        /// </summary>
        /// <param name="command"> Command object </param>
        /// <param name="filterNode"> the FilterOp subtree </param>
        /// <param name="columns"> (Optional) List of columns to consider for "pushdown" </param>
        /// <param name="nonPushdownPredicateNode"> (output) Part of the predicate that cannot be pushed down </param>
        /// <returns> part of the predicate that can be pushed down </returns>
        private static Node GetPushdownPredicate(Command command, Node filterNode, VarVec columns, out Node nonPushdownPredicateNode)
        {
            var pushdownPredicateNode = filterNode.Child1;
            nonPushdownPredicateNode = null;
            var filterNodeInfo = command.GetExtendedNodeInfo(filterNode);
            if (columns == null
                && filterNodeInfo.ExternalReferences.IsEmpty)
            {
                return pushdownPredicateNode;
            }

            if (columns == null)
            {
                var inputNodeInfo = command.GetExtendedNodeInfo(filterNode.Child0);
                columns = inputNodeInfo.Definitions;
            }

            var predicate = new Predicate(command, pushdownPredicateNode);
            Predicate nonPushdownPredicate;
            predicate = predicate.GetSingleTablePredicates(columns, out nonPushdownPredicate);
            pushdownPredicateNode = predicate.BuildAndTree();
            nonPushdownPredicateNode = nonPushdownPredicate.BuildAndTree();
            return pushdownPredicateNode;
        }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:41,代码来源:FilterOpRules.cs


示例10: HasVarReferences

 /// <summary>
 ///     Does the list of outputs of the given SetOp contain a var
 ///     from the given VarVec defined by the SetOp's child with the given index
 /// </summary>
 private static bool HasVarReferences(SetOp op, VarVec vars, int index)
 {
     foreach (var var in op.VarMap[index].Values)
     {
         if (vars.IsSet(var))
         {
             return true;
         }
     }
     return false;
 }
开发者ID:hallco978,项目名称:entityframework,代码行数:15,代码来源:VarRefManager.cs


示例11: CreateGroupByIntoOp

 /// <summary>
 /// Creates a new GroupByIntoOp
 /// </summary>
 /// <param name="gbyKeys">A VarSet that specifies the Key variables produced by the GroupByOp</param>
 /// <param name="outputs">A VarSet that specifies the vars from the input that represent the real grouping input</param>
 /// <param name="inputs">A VarSet that specifies all (Key and Aggregate) variables produced by the GroupByOp</param>
 /// <returns>A new GroupByOp with the specified key and output VarSets</returns>
 internal GroupByIntoOp CreateGroupByIntoOp(VarVec gbyKeys, VarVec inputs, VarVec outputs)
 {
     return new GroupByIntoOp(gbyKeys, inputs, outputs);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:Command.cs


示例12: CreateSingleStreamNestOp

 /// <summary>
 /// Create a singleStreamNestOp
 /// </summary>
 /// <param name="keys">keys for the nest operation</param>
 /// <param name="prefixSortKeys">list of prefix sort keys</param>
 /// <param name="postfixSortKeys">list of postfix sort keys</param>
 /// <param name="outputVars">List of outputVars</param>
 /// <param name="collectionInfoList">CollectionInfo for each collection </param>
 /// <param name="discriminatorVar">Var describing the discriminator</param>
 /// <returns></returns>
 internal SingleStreamNestOp CreateSingleStreamNestOp(VarVec keys,
     List<SortKey> prefixSortKeys, List<SortKey> postfixSortKeys,
     VarVec outputVars,
     List<CollectionInfo> collectionInfoList, Var discriminatorVar)
 {
     return new SingleStreamNestOp(keys, prefixSortKeys, postfixSortKeys, outputVars, collectionInfoList, discriminatorVar);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:17,代码来源:Command.cs


示例13: CreateDistinctOp

 /// <summary>
 /// Creates a new DistinctOp
 /// <param name="keyVars">list of key vars</param>
 /// </summary>
 /// <returns>A new DistinctOp</returns>
 internal DistinctOp CreateDistinctOp(VarVec keyVars)
 {
     return new DistinctOp(keyVars);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:9,代码来源:Command.cs


示例14: KeyVec

 internal KeyVec(Command itree)
 {
     m_keys = itree.CreateVarVec();
     m_noKeys = true;
 }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:5,代码来源:KeyVec.cs


示例15: FlattenVarSet

 /// <summary>
 ///     Probe the current VarSet for "structured" Vars - replace these with the
 ///     corresponding sets of flattened Vars
 /// </summary>
 /// <param name="varSet"> current set of vars </param>
 /// <returns> an "expanded" varset </returns>
 private VarVec FlattenVarSet(VarVec varSet)
 {
     var newVarSet = m_command.CreateVarVec(FlattenVars(varSet));
     return newVarSet;
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:11,代码来源:NominalTypeEliminator.cs


示例16: ConvertToNestOpInput

        // <summary>
        // Convert a CollectOp subtree (when used as the defining expression for a
        // VarDefOp) into a reasonable input to a NestOp.
        // </summary>
        // <remarks>
        // There are a couple of cases that we handle here:
        // (a) PhysicalProject(X) ==> X
        // (b) PhysicalProject(Sort(X)) ==> Sort(X)
        // </remarks>
        // <param name="physicalProjectNode"> the child of the CollectOp </param>
        // <param name="collectionVar"> the collectionVar being defined </param>
        // <param name="collectionInfoList"> where to append the new collectionInfo </param>
        // <param name="collectionNodes"> where to append the collectionNode </param>
        // <param name="externalReferences"> a bit vector of external references of the physicalProject </param>
        // <param name="collectionReferences"> a bit vector of collection vars </param>
        private void ConvertToNestOpInput(
            Node physicalProjectNode, Var collectionVar, List<CollectionInfo> collectionInfoList, List<Node> collectionNodes,
            VarVec externalReferences, VarVec collectionReferences)
        {
            // Keep track of any external references the physicalProjectOp has
            externalReferences.Or(Command.GetNodeInfo(physicalProjectNode).ExternalReferences);

            // Case: (a) PhysicalProject(X) ==> X
            var nestOpInput = physicalProjectNode.Child0;

            // Now build the collectionInfo for this input, including the flattened
            // list of vars, which is essentially the outputs from the physicalProject
            // with the sortKey vars that aren't already in the outputs we already 
            // have.
            var physicalProjectOp = (PhysicalProjectOp)physicalProjectNode.Op;
            var flattenedElementVarList = Command.CreateVarList(physicalProjectOp.Outputs);
            var flattenedElementVarVec = Command.CreateVarVec(flattenedElementVarList); // Use a VarVec to make the lookups faster
            List<SortKey> sortKeys = null;

            if (OpType.Sort
                == nestOpInput.Op.OpType)
            {
                // Case: (b) PhysicalProject(Sort(X)) ==> Sort(X)
                var sortOp = (SortOp)nestOpInput.Op;
                sortKeys = OpCopier.Copy(Command, sortOp.Keys);

                foreach (var sk in sortKeys)
                {
                    if (!flattenedElementVarVec.IsSet(sk.Var))
                    {
                        flattenedElementVarList.Add(sk.Var);
                        flattenedElementVarVec.Set(sk.Var);
                    }
                }
            }
            else
            {
                sortKeys = new List<SortKey>();
            }

            // Get the keys for the collection
            var keyVars = Command.GetExtendedNodeInfo(nestOpInput).Keys.KeyVars;

            //Check whether all key are projected
            var keyVarsClone = keyVars.Clone();
            keyVarsClone.Minus(flattenedElementVarVec);

            var keys = (keyVarsClone.IsEmpty) ? keyVars.Clone() : Command.CreateVarVec();

            // Create the collectionInfo
            var collectionInfo = Command.CreateCollectionInfo(
                collectionVar, physicalProjectOp.ColumnMap.Element, flattenedElementVarList, keys, sortKeys, null /*discriminatorValue*/);

            // Now update the collections we're tracking.
            collectionInfoList.Add(collectionInfo);
            collectionNodes.Add(nestOpInput);
            collectionReferences.Set(collectionVar);
        }
开发者ID:jesusico83,项目名称:Telerik,代码行数:73,代码来源:NestPullup.cs


示例17: CreateVarVec

 /// <summary>
 /// Create a new VarVec from the input VarVec
 /// </summary>
 /// <param name="v"></param>
 /// <returns></returns>
 internal VarVec CreateVarVec(VarVec v)
 {
     VarVec vec = CreateVarVec();
     vec.InitFrom(v);
     return vec;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:11,代码来源:Command.cs


示例18: CreateMultiStreamNestOp

 /// <summary>
 /// Create a MultiStreamNestOp
 /// </summary>
 /// <param name="prefixSortKeys">list of prefix sort keys</param>
 /// <param name="outputVars">List of outputVars</param>
 /// <param name="collectionInfoList">CollectionInfo for each collection element</param>
 /// <returns></returns>
 internal MultiStreamNestOp CreateMultiStreamNestOp(List<SortKey> prefixSortKeys, VarVec outputVars,
     List<CollectionInfo> collectionInfoList)
 {
     return new MultiStreamNestOp(prefixSortKeys, outputVars, collectionInfoList);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:12,代码来源:Command.cs


示例19: NodeInfo

        protected int m_hashValue; // hash value for the node

        #endregion

        #region constructors

        internal NodeInfo(Command cmd)
        {
            m_externalReferences = cmd.CreateVarVec();
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:10,代码来源:NodeInfo.cs


示例20: HasVarReferencesShallow

        /// <summary>
        ///     Checks whether the given node has references to any of the vars in the given VarVec.
        ///     It only checks the given node, not its children.
        /// </summary>
        /// <param name="node"> The node to check </param>
        /// <param name="vars"> The list of vars to check for </param>
        /// <param name="childIndex"> The index of the node's subree from which this var is coming. This is used for SetOp-s, to be able to locate the appropriate var map that will give the vars corresponding to the given once </param>
        /// <param name="continueUp"> If the OpType of the node's Op is such that it 'hides' the input, i.e. the decision of whether the given vars are referenced can be made on this level, it returns true, false otherwise </param>
        /// <returns> True if the given node has references to any of the vars in the given VarVec, false otherwise </returns>
        private static bool HasVarReferencesShallow(Node node, VarVec vars, int childIndex, out bool continueUp)
        {
            switch (node.Op.OpType)
            {
                case OpType.ConstrainedSort:
                case OpType.Sort:
                    continueUp = true;
                    return HasVarReferences(((SortBaseOp)node.Op).Keys, vars);

                case OpType.Distinct:
                    continueUp = false;
                    return HasVarReferences(((DistinctOp)node.Op).Keys, vars);

                case OpType.Except:
                case OpType.Intersect:
                case OpType.UnionAll:
                    continueUp = false;
                    return HasVarReferences((SetOp)node.Op, vars, childIndex);

                case OpType.GroupBy:
                    continueUp = false;
                    return HasVarReferences(((GroupByOp)node.Op).Keys, vars);

                case OpType.PhysicalProject:
                    continueUp = false;
                    return HasVarReferences(((PhysicalProjectOp)node.Op).Outputs, vars);

                case OpType.Project:
                    continueUp = false;
                    return HasVarReferences(((ProjectOp)node.Op).Outputs, vars);

                default:
                    continueUp = true;
                    return false;
            }
        }
开发者ID:hallco978,项目名称:entityframework,代码行数:45,代码来源:VarRefManager.cs



注:本文中的VarVec类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Variable类代码示例发布时间:2022-05-24
下一篇:
C# VarEnum类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap