Creating Collectors

When you create your own operator classes by deriving from APT_Operator, you can directly control how an operator performs collection.

You can use a supplied collection method as part of your derived operator, or define your own collection method by deriving from the base class APT_Collector. Once you have derived a new APT_Collector class, you include the derived collector within an operator.

You can build a library of collector classes to use when appropriate. A library lets you mix and match operators and collectors when different forms of an operator differ only by how the operator performs collection.

When you derive a sequential operator, you can choose the collection method used by it. The keyless collection methods any, round robin, and ordered are directly supported. The default collection method is any. With the any method, an operator reads records on a first-come first-served basis. To use one of these methods, you include a call to APT_Operator::setCollectionMethod() within the APT_Operator::describeOperator() function of your derived operator.

There is also the sorted merge collection method, which is a keyed collector. To use the sorted merge collection method, use the class APT_SortedMergeCollector.

To derive a new collection method, or a variation on one of the methods described above, you can derive a collection class from APT_Collector.