测试枚举器中是否还含有元素。
图2中的代码表示枚举器。
用给定枚举器指定的序列替换受控序列。
Replaces the controlled sequence with the sequence that is designated by the given enumerator.
返回一个循环访问字符串的文本元素的枚举器。
Returns an enumerator that iterates through the text elements of a string.
通过枚举器检索的每个值都应与结果集的一行对应。
Each value retrieved via the enumerator should correspond with one row of the resultset.
它使用新生成的关键字来创建比早期版本的框架更方便的枚举器。
It USES the new yield keyword to create the enumerator much more easily than previous versions of the framework.
这个枚举器将使用比较器作为排序算法,从记录存储创建一个记录结果集。
The enumerator will create a result set of records from the record store, using the comparator as the sorting algorithm.
提供枚举器以按级别(如计算机策略和用户策略)访问安全策略层次结构。
Provides an enumerator to access the security policy hierarchy by levels, such as computer policy and user policy.
如果枚举器对象中至少还有一个元素可提供时,返回枚举器的下一个元素。
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
此决策实际取决于优化枚举器之前如何使用函数以及应如何对函数进行大量测试。
This decision really depends on how the function is used and should be heavily tested prior to optimizing the enumerator.
只返回一个特定即插即用枚举设备,使用枚举器参数提供的GUID或枚举符号名。
To return devices only for a specific PnP enumerator, use the enumerator parameter to supply the GUID or symbolic name of the enumerator.
使用比较器进行排序是使用枚举器时的一种选择,另外一种选择是使用过滤器进行搜索。
Sorting with a comparator is one option when working with an enumerator, searching with a filter is the other.
序列(Sequence)表达式引起了枚举器的‘let’和‘use’的销毁过程过早地发生;
Sequence expressions involving 'let' and 'use' dispose of enumerator too eagerly
如果将这三者——枚举器、比较器和过滤器——结合在一起,您将可以查找特定的记录,并按顺序返回结果。
If you combine all three — the enumerator, comparator, and filter — you can search for specific records and return them in sorted order.
在代码中加入一个记录枚举器的一个最大好处在于枚举器中包含搜索记录存储以及以排序的顺序提取记录的选项。
One of the primary benefits of incorporating a record enumerator into your code is that it includes options for searching the record store, and for retrieving records in sorted order.
枚举器将以记录比较器确定的顺序迭代所有记录(或者如果提供了一个可选的记录过滤器,那么只是一个子集)。
The enumerator will iterate over all of the records (or only a subset, if an optional record filter has been supplied) in an order determined by a record comparator.
完成比较器的编写之后,我们来创建一个枚举器,其中引用了comparatorinteger类的一个实例。
With the comparator code written, we next create an enumerator, referencing an instance of the ComparatorInteger class.
尽管这种技术已经足以满足我们的需求,在这一节,我们还是会扩展自己的代码,加入一个记录枚举器看看会有什么结果。
Although this technique has been sufficient to our needs so far, we'll see in this section what happens when we extend our code to include a record enumerator.
这个字符串被保存在私有变量中,这样当枚举器调用matches()方法创建结果集的时候就可以访问这个字符串。
The string is saved in a private variable so we have access to the string when the enumerator calls the matches() method to create the result set.
与RecordComparator类似,RecordFilter也是通过在枚举器代码中增加一个方法matches实现的。
Like the RecordComparator, the RecordFilter is implemented by the addition of a single method, matches , to the enumerator code.
只返回一个特定的设备,设置DIFCF _DEVICEINTERFACE标志和使用枚举器参数来提供设备实例ID的设备。
To return only a specific device, set the DIFCF_DEVICEINTERFACE flag and use the Enumerator parameter to supply the device instance ID of the device.
如果既没有指定过滤器又没有指定比较器,枚举将以未定义的顺序遍历记录存储中的所有记录。
If neither the filter nor the comparator are specified, the enumeration will traverse all records in the record store in an undefined order.
在这里,布局枚举持有文件片段的服务器、每个服务器上文件片段的大小,以及每个片段的NFS文件句柄。
Here, the layout enumerates the servers that hold the pieces of the file, the size of the stripe on each server, and the NFS file handle of each segment.
用解析器验证枚举列表。
在这一点上,您可以要求枚举设备,显示此PD P - 15的各种仿真的设备(浮动点处理器、纸带读取器、纸带打孔,等等)。
At this point, you can request that the devices be enumerated, which shows the various devices simulated for this PDP-15 (floating-point processor, paper tape reader, paper tape punch, and so on).
便携设备:允许应用程序枚举诸如音乐播放器、数码相机等连接设备上的内容。
Portable devices: Allow applications to enumerate content on connected devices like music players, digital cameras etc.
用解析器对基本枚举列表进行验证。
Validation of the base enumeration list is done by the parser.
缺点:解析器不验证枚举值。
Disadvantage: Enumerated values are not validated by the parser.
例如,如果语句以一个与“enum”(声明一个枚举)相应的标记作为开始,CDT解析器会试图将该语句同enum语句的抽象模型匹配起来。
For example, if a statement starts with a token corresponding to "enum" (declaring an enumeration), the CDT parser will try to match the statement to its abstract model of an enum statement.
另一个token字段t . k ind被赋值为一个枚举(enum),表明这个特殊的记号是一个整数,而不是解析器所知的另一种类型的记号。
The other token field, t.kind, is assigned an enum indicating that this particular token is an integer and not another kind of token that's known to the parser.
应用推荐