capture: add SpCaptureCursor and associated types

This API helps us simplify some of the tooling to iterate
through a capture. In particular, we might want to setup a
bunch of matches and then just iterate through the items.

This can also allow delaying the iteration until the future
which might be handy for visualizers which won't want to block
the main loop.

I'm not jazzed about the 64k buffer created for every cursor
due to the SpCaptureReader copy, but it's probably not a big
deal in practice until we start doing more exotic things.
This commit is contained in:
Christian Hergert
2016-09-25 00:25:08 -07:00
parent b8f465659b
commit c19d0635aa
8 changed files with 560 additions and 2 deletions

View File

@ -42,8 +42,10 @@ G_BEGIN_DECLS
#define SP_CAPTURE_COUNTER_INT64 0
#define SP_CAPTURE_COUNTER_DOUBLE 1
typedef struct _SpCaptureReader SpCaptureReader;
typedef struct _SpCaptureWriter SpCaptureWriter;
typedef struct _SpCaptureReader SpCaptureReader;
typedef struct _SpCaptureWriter SpCaptureWriter;
typedef struct _SpCaptureCursor SpCaptureCursor;
typedef struct _SpCaptureCondition SpCaptureCondition;
typedef guint64 SpCaptureAddress;