StupidBeauty
Read times:1333Posted at: - no title specified

Tufao1.2.1文档翻译:httpserverplugin.h文件参考,httpserverplugin.h File Reference

class  

Tufao::HttpServerPlugin

这个类,提供了一个工厂接口,用 来创建请求处理器,以及与其它插件的工厂进行通信。 详细说明……

命名空间

Tufao

Tufão 中所有的工具都位于这个命名空间中。

#define 

TUFAO_HTTPSERVERPLUGIN_IID    "Tufao::HttpServerPlugin/1.0"

这个定义,储存了 Tufao::HttpServerPlugin 这个接口的接口编号(IID)。 详细说明……

宏定义文档

#define TUFAO_HTTPSERVERPLUGIN_IID   "Tufao::HttpServerPlugin/1.0"

这个定义,储存了 Tufao::HttpServerPlugin 这个接口的接口编号。

当妳定义一个插件时,妳需要使用这个宏作为Q_PLUGIN_METADATA 宏的IID 参数, 以告知,这 个类正在实现 Tufao::HttpServerPlugin 接口。例如:

#ifndef PLUGIN_H

#define PLUGIN_H

#include <Tufao/HttpServerPlugin>

class Plugin: public QObject, Tufao::HttpServerPlugin

{

Q_OBJECT

Q_PLUGIN_METADATA(IID TUFAO_HTTPSERVERPLUGIN_IID )

Q_INTERFACES( Tufao::HttpServerPlugin )

public:

std::function<bool(Tufao::HttpServerRequest&, Tufao::HttpServerResponse&)>

createHandler(const QHash<QString, Tufao::HttpServerPlugin*> &dependencies,

const QVariant &customData = QVariant()) override;

};

#endif // PLUGIN_H

Your opinions

Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands