QServiceFilter Class ReferenceThe QServiceFilter class defines criteria for defining a sub-set of all available services. More... #include <QServiceFilter> Public Types
Public Functions
Related Non-Members
Detailed DescriptionThe QServiceFilter class defines criteria for defining a sub-set of all available services. A QServiceFilter can be used to constrain the number of services when searching for services. Only those services that match all filter criteria are returned by QServiceManager::findInterfaces(). See also QServiceInterfaceDescriptor and QServiceManager. Member Type Documentation
|
Service | Required capabilities |
---|---|
S1 | {} |
S2 | {A} |
S3 | {A,B} |
S4 | {A,B,C,D} |
S5 | {A,D} |
S6 | {F} |
The matching rules would apply as follows:
Matching rule | Filter's capabilities | Matching services |
---|---|---|
MatchLoadable | {} | S1 |
MatchLoadable | {A} | S1, S2 |
MatchLoadable | {A,B,C} | S1, S2, S3 |
MatchMinimum | {} | S1, S2, S3, S4, S5, S6 |
MatchMinimum | {A} | S2, S3, S4, S5 |
MatchMinimum | {A,B,C} | S4 |
Constant | Value | Description |
---|---|---|
QServiceFilter::MatchMinimum | 0 | The filter matches any service that requires at least the given filter capabilities. This may mean that the returned services may require more capabilities than the specified ones. Such a search is equivalent to a wildcard match if the passed filter's capability list is empty. In mathematical set notation this rule is equivalent to Cap(Filter) \ Cap(Service) = {}. This is the default matching rule. |
QServiceFilter::MatchLoadable | 1 | The filter matches any service that could be loaded by the client. Using this matching rule guarantees that the returned services do not require more capabilites than specified by this rule. It includes services with no capability requirements. If this rule is provided alongside an empty capability search list the returned services do not require any capabilities and thus can be accessed by any client. The equivalent set notation is Cap(Service) \ Cap(Filter) = {}. |
This enum describes how interface version matching is performed.
Constant | Value | Description |
---|---|---|
QServiceFilter::ExactVersionMatch | 0 | The filter matches any interface implementation that implements the exact version provided. |
QServiceFilter::MinimumVersionMatch | 1 | The filter matches any interface implementation that implements either the given major/minor version or any subsequent version. |
Creates a new filter object that matches all service implementations.
Creates a copy of QServiceFilter object contained in other.
Creates a new filter object that matches all service implementations implementing interfaceName that match the specified version using the given rule.
Destroys this instance of QServiceFilter.
Returns the list of capabilities which are used to limit services searches.
The filter matches any services that requires the given or less capabilities and thus enabling clients to query for services for which they have the required capabilties.
See also setCapabilities(), capabilityMatchRule(), and QAbstractSecuritySession.
Returns the capability matching rule for this filter.
See also setCapabilities() and capabilities().
Clears the custom attribute key from the filter's set of constraints. If key is empty all custom attributes are cleared.
See also setCustomAttribute().
Returns the value for the custom attribute key; otherwise returns a null string.
See also setCustomAttribute() and clearCustomAttribute().
Returns the list of custom keys which have been added to the filter.
Returns the interface name for this filter.
See also setInterface().
Returns the major interface version for this filter.
See also setInterface().
Returns the minor interface version for this filter.
See also setInterface().
Returns the service name for this filter.
See also setServiceName().
Sets the list of capabilities which are used to constrain searches for services. The capabilities are matched according to the given rule.
See also capabilities() and QAbstractSecuritySession.
The filter only matches implementations which have the custom attribute key with the given value. Such constraints are specified via the <customproperty> tag within the service xml.
See also customAttribute() and clearCustomAttribute().
Sets the filter to match any interface implementation that implements interfaceName with version version. The version is matched according to the given rule. If version is not set, the filter matches any version of the interface implementation.
This method does nothing if version is not a valid version string or if interfaceName is empty.
A valid version string has the format x.y whereby x and y are positive integer numbers.
The filter only matches implementations which are provided by the service specified by serviceName.
If the serviceName is empty the filter matches any service.
See also serviceName().
Returns the version match rule for this filter.
See also setInterface().
Copies the content of the QServiceFilter object contained in other into this one.
Writes service filter sf to the stream out and returns a reference to the stream.
Reads a service filter into sf from the stream in and returns a reference to the stream.