omni::log::ILogChannelFilterList_abi

Defined in omni/log/ILogChannelFilter.h

Inheritance Relationships

Base Type

  • public omni::core::Inherits< ILogChannelUpdateConsumer, OMNI_TYPE_ID("omni.log.ILogChannelFilterList")> (omni::core::Inherits)

Derived Type

class omni::log::ILogChannelFilterList_abi : public omni::core::Inherits<ILogChannelUpdateConsumer, OMNI_TYPE_ID("omni.log.ILogChannelFilterList")>

A list of channel filters that will be applied as channels are added to the log.

This object is a list of ILogChannelFilter objects. Filters can be added, removed, and replaced.

This object can be attached to one or more ILog objects. As channels are added to the ILog, this object will apply its filters, thereby setting the new channel’s state.

If multiple filters match a channel, only the first filter’s settings will be applied.

This API is thread safe.

Subclassed by omni::core::Generated< omni::log::ILogChannelFilterList_abi >

Protected Functions

virtual void insert_abi(uint32_t index, ILogChannelFilter *filter) noexcept = 0

Inserts the given filter at the given index.

Existing filters at and after the given index are moved to the next slot in the list.

If index is equal to or greater than the number of existing filters, the given filter is added to the end of the filter list.

The given filter must not be nullptr.

This method is thread safe.

virtual omni::core::Result replace_abi(uint32_t index, ILogChannelFilter *oldFilter, ILogChannelFilter *newFilter) noexcept = 0

Replace the filter at the given index with a new filter.

oldFilter is the current filter at index while newFilter is the filter to replace the old filter.

If oldFilter is not currently at index, it is assumed another thread has modified the list. In this case, this function does nothing and returns kResultInvalidState.

oldFilter and newFilter must not be nullptr.

Returns kResultSuccess if the filter was successfully replaced.

This method is thread safe.

virtual omni::core::Result remove_abi(uint32_t index, ILogChannelFilter *filter) noexcept = 0

Removes the filter at the given index.

If filter is not currently at index, it is assumed another thread has modified the list. In this case, this function does nothing and returns kResultInvalidState.

filter must not be nullptr.

Returns kResultSuccess if the filter was successfully replaced.

This method is thread safe.

virtual omni::core::Result getFilters_abi(ILogChannelFilter **out, uint32_t *outCount) noexcept = 0

Returns the list of filters.

This method operates in two modes: query mode or get mode.

outCount must not be nullptr in both modes.

Query mode is enabled when out is nullptr. When in this mode, *outCount will be populated with the number of filters and kResultSuccess is returned.

Get mode is enabled when out is not nullptr. Upon entering the function, *outCount stores the number of entries in out. If *outCount is less than the number of filters, *outCount is updated with the number of filters and kResultInsufficientBuffer is returned. If *outCount is greater or equal to the number of filters, *outCount is updated with the number of filters, out array is populated, and kResultSuccess is returned.

If the out array is populated, each written entry in the array will have had acquire() called on it.

Upon entering the function, the pointers in the out array must be nullptr.

Return values are as above. Additional error codes may be returned (e.g. kResultInvalidArgument if outCount is nullptr).

This method is thread safe.

virtual void apply_abi(ILog *log, omni::str::IReadOnlyCString *const *channels, uint32_t channelsCount) noexcept = 0

Applies each filter to the given list of channels.

log must not be nullptr.

channels is an array of channel names in the given log. This object will apply all filters to each channel.

If the channels array is nullptr, this method will call ILog::getChannelNames() to get the list of channels.

This method is thread safe.

virtual void addUpdateConsumer_abi(ILogChannelFilterListUpdateConsumer *consumer) noexcept = 0

Adds an update consumer to this list.

This added consumer will be notified each time an filter is added, removed, or replaced in this list.

The given consumer may be notified in parallel.

Notifications may be consolidated (i.e. multiple items in the list were updated).

The given consumer may be notified spuriously.

consumer must not be nullptr.

This method is thread safe.

virtual void removeUpdateConsumer_abi(ILogChannelFilterListUpdateConsumer *consumer) noexcept = 0

Removes the given consumer from the internal consumer list.

This method silently accepts nullptr.

This method silently accepts consumers that have not been registered with this object.

Calling ILog::removeOnMessageConsumer() from ILogOnMessageConsumer::onMessage_abi() will lead to undefined behavior.

This method is thread safe.

virtual omni::core::Result getUpdateConsumers_abi(ILogChannelFilterListUpdateConsumer **out, uint32_t *outCount) noexcept = 0

Returns the list of update consumers.

This method operates in two modes: query mode or get mode.

outCount must not be nullptr in both modes.

Query mode is enabled when out is nullptr. When in this mode, *outCount will be populated with the number of consumers and kResultSuccess is returned.

Get mode is enabled when out is not nullptr. Upon entering the function, *outCount stores the number of entries in out. If *outCount is less than the number of consumers, *outCount is updated with the number of consumers and kResultInsufficientBuffer is returned. If *outCount is greater or equal to the number of consumers, *outCount is updated with the number of consumers, out array is populated, and kResultSuccess is returned.

If the out array is populated, each written entry in the array will have had acquire() called on it.

Upon entering the function, the pointers in the out array must be nullptr.

Return values are as above. Additional error codes may be returned (e.g. kResultInvalidArgument if outCount is nullptr).

This method is thread safe.

virtual void clear_abi() noexcept = 0

Removes all filters from this list.

This method is thread safe.