OpenDOF Project
boolean DOFQueryBuilder_AddFilter ( DOFQueryBuilder  self,
uint32  objectIDCount,
const DOFObjectID  objectIDs[],
uint32  interfaceIDCount,
const DOFInterfaceID  interfaceIDs[] 
)

Add a filter into the query specification builder.

Both Object IDs and Interface IDs can be added as a group into the query. If Object IDs are specified, the match is restricted to only that list of Objects. If Interface IDs are specified, the match is restricted to Objects that provide ALL of the specified Interfaces (Objects that have only a subset, or none, of the specified Interfaces will not match). An empty list (either Objects or Interfaces) is like a wildcard, where everything matches. This gives four options:

  1. No Objects, No Interfaces: Match all available Objects and Interfaces. This is the simplest filter, but may cause a query operation to show many unwanted Objects and/or Interfaces.
  2. n Objects, No Interfaces: Match any of the specified Objects, no matter what Interfaces they provide. If the set of Objects that are desired are already known, this is a quick way to learn of the available Objects in the system.
  3. No Objects, m Interfaces: Match any Objects that have ALL of the specified Interfaces. This is an easy way to find particular types of Objects (ones that provide a known set of Interfaces), but whose Object IDs are not known.
  4. n Objects, m Interfaces: Match any of the specified Objects, but only if they have ALL of the specified Interfaces. This is the most restrictive filter.

To add disjoint sets of filters (for example, "All Objects that provide I1 and I2 AND all Objects that provide I3 and I4", these must be added to the query as two separate filters (using two calls to this function).

Note
If an Object matches the query, then ALL Interfaces for that Object are disclosed, even if they are not explicitly listed in the query. This can significantly increase the number of unwanted Interfaces that are disclosed. Consider using the DOFQueryBuilder_AddRestriction method to restrict the system to only notify of Interfaces that the application desires.
Parameters
selfThe QueryBuilder. If NULL, no action is taken.
objectIDCountNumber of Object IDs.
objectIDsList of Object IDs. This must not be NULL if objectIDCount > 0, and should not contain NULL or the broadcast or multicast IDs.
interfaceIDCountNumber of Interface IDs.
interfaceIDsList of Interface IDs. This must not be NULL if interfaceIDCount > 0, and should not contain NULL or the wildcard ID.
Return values
Non-Zero(TRUE) The filter was added.
Exceptions
Zero(FALSE) The filter could not be added.
core-c-dof-oal Version 8.0.1 Build 0
2018-01-22