Now filters can detect whether there is at least one subscriber downstream to consume a produced decoration. This is done by accepting the argument as a pointer, and performing a simple null check. An example filter is as follows:
The pointer will be specified as null if there are no filters downstream. The filter can choose to return early if the input argument is null, satisfy other output arguments, or to update local members as needed.
If a shared pointer or control over allocation is desired, the pointer-to-shared-pointer syntax may be used instead:
Now filters can detect whether there is at least one subscriber downstream to consume a produced decoration. This is done by accepting the argument as a pointer, and performing a simple null check. An example filter is as follows:
The pointer will be specified as null if there are no filters downstream. The filter can choose to return early if the input argument is null, satisfy other output arguments, or to update local members as needed.
If a shared pointer or control over allocation is desired, the pointer-to-shared-pointer syntax may be used instead: