|
| 1 | +// |
| 2 | +// OGTrace.h |
| 3 | +// OpenGraphCxx |
| 4 | + |
| 5 | +#ifndef OGTrace_h |
| 6 | +#define OGTrace_h |
| 7 | + |
| 8 | +#include <OpenGraph/OGBase.h> |
| 9 | +#include <OpenGraph/OGGraph.h> |
| 10 | + |
| 11 | +OG_ASSUME_NONNULL_BEGIN |
| 12 | + |
| 13 | +typedef OG_ENUM(uint64_t, OGTraceEvents) { |
| 14 | + OGTraceEventsCustom = 1, |
| 15 | + OGTraceEventsNamed = 2, |
| 16 | + OGTraceEventsDeadline = 3, |
| 17 | + OGTraceEventsCompareFailed = 4, |
| 18 | +}; |
| 19 | + |
| 20 | +typedef struct OGTrace { |
| 21 | + OGTraceEvents events; |
| 22 | + |
| 23 | + void (*_Nullable begin_trace)(void *_Nullable context, OGGraphRef graph); |
| 24 | + void (*_Nullable end_trace)(void *_Nullable context, OGGraphRef graph); |
| 25 | + |
| 26 | + void (*_Nullable begin_update_subgraph)(void *_Nullable context, OGSubgraphRef subgraph, uint32_t options); |
| 27 | + void (*_Nullable end_update_subgraph)(void *_Nullable context, OGSubgraphRef subgraph); |
| 28 | + void (*_Nullable begin_update_stack)(void *_Nullable context, OGAttribute attribute); |
| 29 | + void (*_Nullable end_update_stack)(void *_Nullable context, bool changed); |
| 30 | + void (*_Nullable begin_update_attribute)(void *_Nullable context, OGAttribute attribute); |
| 31 | + void (*_Nullable end_update_attribute)(void *_Nullable context, OGAttribute attribute, bool changed); |
| 32 | + void (*_Nullable begin_update_graph)(void *_Nullable context, OGGraphRef graph); |
| 33 | + void (*_Nullable end_update_graph)(void *_Nullable context, OGGraphRef graph); |
| 34 | + |
| 35 | + void (*_Nullable begin_invalidation)(void *_Nullable context, OGGraphRef graph, OGAttribute attribute); |
| 36 | + void (*_Nullable end_invalidation)(void *_Nullable context, OGGraphRef graph, OGAttribute attribute); |
| 37 | + |
| 38 | + void (*_Nullable begin_modify)(void *_Nullable context, OGAttribute attribute); |
| 39 | + void (*_Nullable end_modify)(void *_Nullable context, OGAttribute attribute); |
| 40 | + |
| 41 | + void (*_Nullable begin_event)(void *_Nullable context, OGAttribute attribute, const char *event_name); |
| 42 | + void (*_Nullable end_event)(void *_Nullable context, OGAttribute attribute, const char *event_name); |
| 43 | + |
| 44 | + void (*_Nullable created_graph)(void *_Nullable context, OGGraphRef graph); |
| 45 | + void (*_Nullable destroy_graph)(void *_Nullable context, OGGraphRef graph); |
| 46 | + void (*_Nullable needs_update)(void *_Nullable context, OGGraphRef graph); |
| 47 | + |
| 48 | + void (*_Nullable created_subgraph)(void *_Nullable context, OGSubgraphRef subgraph); |
| 49 | + void (*_Nullable invalidate_subgraph)(void *_Nullable context, OGSubgraphRef subgraph); |
| 50 | + void (*_Nullable add_child_subgraph)(void *_Nullable context, OGSubgraphRef subgraph, OGSubgraphRef child); |
| 51 | + void (*_Nullable remove_child_subgraph)(void *_Nullable context, OGSubgraphRef subgraph, OGSubgraphRef child); |
| 52 | + |
| 53 | + void (*_Nullable added_attribute)(void *_Nullable context, OGAttribute attribute); |
| 54 | + void (*_Nullable add_edge)(void *_Nullable context, OGAttribute attribute, OGAttribute input, unsigned int flags); |
| 55 | + void (*_Nullable remove_edge)(void *_Nullable context, OGAttribute attribute, size_t index); |
| 56 | + void (*_Nullable set_edge_pending)(void *_Nullable context, OGAttribute attribute, OGAttribute input, bool pending); |
| 57 | + |
| 58 | + void (*_Nullable set_dirty)(void *_Nullable context, OGAttribute attribute, bool dirty); |
| 59 | + void (*_Nullable set_pending)(void *_Nullable context, OGAttribute attribute, bool pending); |
| 60 | + void (*_Nullable set_value)(void *_Nullable context, OGAttribute attribute); |
| 61 | + void (*_Nullable mark_value)(void *_Nullable context, OGAttribute attribute); |
| 62 | + |
| 63 | + void (*_Nullable added_indirect_attribute)(void *_Nullable context, OGAttribute attribute); |
| 64 | + void (*_Nullable set_source)(void *_Nullable context, OGAttribute attribute, OGAttribute source); |
| 65 | + void (*_Nullable set_dependency)(void *_Nullable context, OGAttribute attribute, OGAttribute dependency); |
| 66 | + |
| 67 | + void (*_Nullable mark_profile)(void *_Nullable context, const char *event_name); |
| 68 | + |
| 69 | + void (*_Nullable custom_event)(void *_Nullable context, OGGraphRef graph, const char *event_name, const void *value, |
| 70 | + OGTypeID type); |
| 71 | + void (*_Nullable named_event)(void *_Nullable context, OGGraphRef graph, uint32_t eventID, uint32_t eventArgCount, |
| 72 | + const void *eventArgs, CFDataRef data, uint32_t arg6); |
| 73 | + bool (*_Nullable named_event_enabled)(void *_Nullable context); |
| 74 | + |
| 75 | + void (*_Nullable set_deadline)(void *_Nullable context); |
| 76 | + void (*_Nullable passed_deadline)(void *_Nullable context); |
| 77 | + |
| 78 | + void (*_Nullable compare_failed)(void *_Nullable context, OGAttribute attribute, OGComparisonState comparisonState); |
| 79 | +} OGTrace; |
| 80 | + |
| 81 | +OG_ASSUME_NONNULL_END |
| 82 | + |
| 83 | +#endif /* OGTrace_h */ |
0 commit comments