Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QServiceFilter Class Reference

The QServiceFilter class defines criteria for defining a sub-set of all available services. More...

 #include <QServiceFilter>

Public Types

enum CapabilityMatchRule { MatchMinimum, MatchLoadable }
enum VersionMatchRule { ExactVersionMatch, MinimumVersionMatch }

Public Functions

QServiceFilter ()
QServiceFilter ( const QServiceFilter & other )
QServiceFilter ( const QString & interfaceName, const QString & version = QString(), QServiceFilter::VersionMatchRule rule = QServiceFilter::MinimumVersionMatch )
~QServiceFilter ()
QStringList capabilities () const
CapabilityMatchRule capabilityMatchRule () const
void clearCustomAttribute ( const QString & key = QString() )
QString customAttribute ( const QString & key ) const
QStringList customAttributes () const
QString interfaceName () const
int majorVersion () const
int minorVersion () const
QString serviceName () const
void setCapabilities ( QServiceFilter::CapabilityMatchRule rule, const QStringList & capabilities = QStringList() )
void setCustomAttribute ( const QString & key, const QString & value )
void setInterface ( const QString & interfaceName, const QString & version = QString(), QServiceFilter::VersionMatchRule rule = QServiceFilter::MinimumVersionMatch )
void setServiceName ( const QString & serviceName )
VersionMatchRule versionMatchRule () const
QServiceFilter & operator= ( const QServiceFilter & other )

Related Non-Members

QDataStream & operator<< ( QDataStream & out, const QServiceFilter & sf )
QDataStream & operator>> ( QDataStream & in, QServiceFilter & sf )

Detailed Description

The 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

enum QServiceFilter::CapabilityMatchRule

This enum describes the capability/permission matching rules. Some platforms restrict what services clients can access using "capabilities" or permissions. Services with more capabilities require more privileged clients. Platforms without capabilities may ignore this type of matching rule as the default behavior is to ignore any capability restrictions.

This is a brief example. Assuming that the system knows the services S1 - S6 which require capabilities as stated below:

ServiceRequired 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 ruleFilter's capabilitiesMatching 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

ConstantValueDescription
QServiceFilter::MatchMinimum0The 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::MatchLoadable1The 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) = {}.

enum QServiceFilter::VersionMatchRule

This enum describes how interface version matching is performed.

ConstantValueDescription
QServiceFilter::ExactVersionMatch0The filter matches any interface implementation that implements the exact version provided.
QServiceFilter::MinimumVersionMatch1The filter matches any interface implementation that implements either the given major/minor version or any subsequent version.

Member Function Documentation

QServiceFilter::QServiceFilter ()

Creates a new filter object that matches all service implementations.

QServiceFilter::QServiceFilter ( const QServiceFilter & other )

Creates a copy of QServiceFilter object contained in other.

QServiceFilter::QServiceFilter ( const QString & interfaceName, const QString & version = QString(), QServiceFilter::VersionMatchRule rule = QServiceFilter::MinimumVersionMatch )

Creates a new filter object that matches all service implementations implementing interfaceName that match the specified version using the given rule.

QServiceFilter::~QServiceFilter ()

Destroys this instance of QServiceFilter.

QStringList QServiceFilter::capabilities () const

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.

CapabilityMatchRule QServiceFilter::capabilityMatchRule () const

Returns the capability matching rule for this filter.

See also setCapabilities() and capabilities().

void QServiceFilter::clearCustomAttribute ( const QString & key = QString() )

Clears the custom attribute key from the filter's set of constraints. If key is empty all custom attributes are cleared.

See also setCustomAttribute().

QString QServiceFilter::customAttribute ( const QString & key ) const

Returns the value for the custom attribute key; otherwise returns a null string.

See also setCustomAttribute() and clearCustomAttribute().

QStringList QServiceFilter::customAttributes () const

Returns the list of custom keys which have been added to the filter.

QString QServiceFilter::interfaceName () const

Returns the interface name for this filter.

See also setInterface().

int QServiceFilter::majorVersion () const

Returns the major interface version for this filter.

See also setInterface().

int QServiceFilter::minorVersion () const

Returns the minor interface version for this filter.

See also setInterface().

QString QServiceFilter::serviceName () const

Returns the service name for this filter.

See also setServiceName().

void QServiceFilter::setCapabilities ( QServiceFilter::CapabilityMatchRule rule, const QStringList & capabilities = QStringList() )

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.

void QServiceFilter::setCustomAttribute ( const QString & key, const QString & value )

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().

void QServiceFilter::setInterface ( const QString & interfaceName, const QString & version = QString(), QServiceFilter::VersionMatchRule rule = QServiceFilter::MinimumVersionMatch )

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.

void QServiceFilter::setServiceName ( const QString & serviceName )

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().

VersionMatchRule QServiceFilter::versionMatchRule () const

Returns the version match rule for this filter.

See also setInterface().

QServiceFilter & QServiceFilter::operator= ( const QServiceFilter & other )

Copies the content of the QServiceFilter object contained in other into this one.

Related Non-Members

QDataStream & operator<< ( QDataStream & out, const QServiceFilter & sf )

Writes service filter sf to the stream out and returns a reference to the stream.

QDataStream & operator>> ( QDataStream & in, QServiceFilter & sf )

Reads a service filter into sf from the stream in and returns a reference to the stream.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 42
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 9
  7. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
Page suivante

Le Qt Developer Network au hasard

Logo

Une application d'ingénierie

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.1
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web