Capturing events between event triggers

Capturing events between event triggers

I need a way to generate frames using only events between 2 consecutive event triggers. For example, consider the diagram below, where dashes represent CD events, and pipes represent trigger events. I need to be able to ignore events labeled "x" and use only the "a" events to create frame a and only "b" events to generate frame b. I can't find any examples of this in the documentation. One idea I had was to use the "get_ext_events()" method, split the events vector based on the timestamps, and make multiple calls to "process_events," one for each sub-vector. I am not convinced this is the best way, so I am checking here first.

Data Stream
-----|------|-----|-----
xxxxaaaaabbbbxxxx
    As a Prophesee customer, join the community conversation. 
    Request your free access today.