This namepsace defines a library of selector classes. More...
Classes | |
struct | CallTransitionSelector |
This class selects the whole transition. More... | |
struct | InternalTransitionSelector |
This class selects the whole transition. More... | |
struct | ReturnTransitionSelector |
This class selects the whole transition. More... | |
struct | SourceSelector |
This class selects the source from transitions. More... | |
struct | SymbolSelector |
This class selects the symobl from transitions. More... | |
struct | TargetSelector |
This class selects the target from transitions. More... | |
struct | CallPredecessorSelector |
This class selects the call predecessor from return transitions. More... | |
struct | PairSelector |
This selects a pair of things. More... |
This namepsace defines a library of selector classes.
A selector class's purpose is to transform an NWA transition into whatever the user wants. For instance, if the user writes query().select_symbol(). ... then the 'selector' is what's responsible for pulling out the symbol field of each transition in order to fulfill that query.
A selector is a functor that is callable on one or more transition types -- calls, internals, and returns -- and returns pretty much anything you want. For most things, you'll want it to be callable on all three types, which means you'll have to overload operator(). (This is why most of these must be classes instead of using function pointers.) Note however that because C/C++ doesn't have strong typedefs, Call and Internal transitions are the same type! This means that you must do the same thing in both cases.
Right now there is also a 'type' field in each class that holds the type of whatever the user wants out, but really this should be reworked slightly to use traits. (That way the user can pass a function if they really want, with the caveat that you can't do the overload thing.)