当前位置: 首页 > news >正文

做百科网站网络优化工程师前景

做百科网站,网络优化工程师前景,德清网站公司建设,重庆网站设计公司价格最近做的一个项目,由于工程需要模块之间能够互相通信,但又不想模块之间耦合度太高 使用信号槽的话,需要两个类的对象或者指针在其中一个类都要体现,这样达不到效果, 想要一个管理类对这些互相通信的类之间进行管理,只需要在各自的类注册发送者和接收者即可,双方通过一…

最近做的一个项目,由于工程需要模块之间能够互相通信,但又不想模块之间耦合度太高

使用信号槽的话,需要两个类的对象或者指针在其中一个类都要体现,这样达不到效果,

想要一个管理类对这些互相通信的类之间进行管理,只需要在各自的类注册发送者和接收者即可,双方通过一个指定的消息ID来建立联系。

技术:QObject::connect()定义map来管理发送方和接收方

上代码

头文件

#pragma once

#include "messager_global.h"
#include "GlobalDefines.h"
#include "QObject"
#include "Platform\OSAdapter\VAZLock.h"
#include "Messager.h"

class CMsgObj
{
public:
    CMsgObj(QObject* MsgObj, const tchar* pszMsgObjName, const char* pszMethodName, Qt::ConnectionType connectyType)
    {
        m_MsgObj = MsgObj;
        m_sMsgObjName = pszMsgObjName;
        m_sMethodName = pszMethodName;
        m_connectionType = connectyType;
    };

    QObject* m_MsgObj;
    tstring m_sMsgObjName;
    string    m_sMethodName;
    Qt::ConnectionType m_connectionType;

public:
    inline bool operator == (const CMsgObj& rt) const
    {
        return (rt.m_MsgObj == m_MsgObj)
            && (rt.m_sMethodName == m_sMethodName);
    }
};

class CVAZMessager : public QObject
{
    Q_OBJECT
public:
    CVAZMessager();
    ~CVAZMessager();
    static CVAZMessager& Instance();

    void RegisterReceiver(VAZ_MSG_ID MsgID, QObject* Receiver, const tchar* pszReceiverName, const char* pszMethodName);
    void UnregisterReceiver(VAZ_MSG_ID MsgID, QObject* Receiver, const tchar* pszReceiverName, const char* pszMethodName);

    void RegisterSender(VAZ_MSG_ID MsgID, QObject* Sender, const tchar* pszSenderName, const char* pszMethodName, Qt::ConnectionType connectionType);
    void UnregisterSender(VAZ_MSG_ID MsgID, QObject* Sender, const tchar* pszSenderName, const char* pszMethodName);
    bool IsSignalRegistered(VAZ_MSG_ID MsgID, QObject* Sender);

private:
    map< VAZ_MSG_ID, list< CMsgObj> > m_mapReceivers;
    map< VAZ_MSG_ID, list< CMsgObj> > m_mapSenders;

    typedef map< VAZ_MSG_ID, list< CMsgObj> >::iterator IterReceivers, IterSenders;
    typedef list< CMsgObj>::iterator IterReceiver, IterSender;


    CVAZLock m_MessagerLock;
};


cpp文件

#include "VAZMessager.h"
#include "Platform\Logger\Logger.h"
#include "..\Common\misc.h"

CVAZMessager::CVAZMessager()
    : QObject()
    , m_MessagerLock(_T("Messager Lock"))
{
}

CVAZMessager::~CVAZMessager()
{
}

CVAZMessager & CVAZMessager::Instance()
{
    static CVAZM


文章转载自:
http://sunblind.rmyt.cn
http://quinquereme.rmyt.cn
http://uncurable.rmyt.cn
http://turfman.rmyt.cn
http://degustate.rmyt.cn
http://cyrus.rmyt.cn
http://countenance.rmyt.cn
http://chromophoric.rmyt.cn
http://carboniferous.rmyt.cn
http://freebie.rmyt.cn
http://helvetia.rmyt.cn
http://shakespeariana.rmyt.cn
http://nuclide.rmyt.cn
http://protestant.rmyt.cn
http://nostomania.rmyt.cn
http://appellor.rmyt.cn
http://metempiricism.rmyt.cn
http://bronzer.rmyt.cn
http://eff.rmyt.cn
http://jude.rmyt.cn
http://pigstick.rmyt.cn
http://corsage.rmyt.cn
http://vicar.rmyt.cn
http://granule.rmyt.cn
http://astrogony.rmyt.cn
http://disharmonize.rmyt.cn
http://mishellene.rmyt.cn
http://achech.rmyt.cn
http://hydromancer.rmyt.cn
http://hesitance.rmyt.cn
http://marisat.rmyt.cn
http://yokefellow.rmyt.cn
http://denticule.rmyt.cn
http://honolulu.rmyt.cn
http://lithotrite.rmyt.cn
http://reestimate.rmyt.cn
http://serrated.rmyt.cn
http://daishiki.rmyt.cn
http://featherbed.rmyt.cn
http://felstone.rmyt.cn
http://holdall.rmyt.cn
http://fleckered.rmyt.cn
http://ligation.rmyt.cn
http://anecdotical.rmyt.cn
http://superseniority.rmyt.cn
http://stone.rmyt.cn
http://hyperion.rmyt.cn
http://polychaetan.rmyt.cn
http://ecdysiast.rmyt.cn
http://reykjavik.rmyt.cn
http://cumulative.rmyt.cn
http://cornerwise.rmyt.cn
http://manse.rmyt.cn
http://staffordshire.rmyt.cn
http://creature.rmyt.cn
http://aja.rmyt.cn
http://broadsword.rmyt.cn
http://recoal.rmyt.cn
http://coq.rmyt.cn
http://vacationland.rmyt.cn
http://multivoltine.rmyt.cn
http://iupac.rmyt.cn
http://aortoiliac.rmyt.cn
http://tecnology.rmyt.cn
http://indisputability.rmyt.cn
http://supersession.rmyt.cn
http://attired.rmyt.cn
http://sancerre.rmyt.cn
http://shari.rmyt.cn
http://sexcapade.rmyt.cn
http://morpho.rmyt.cn
http://uncurl.rmyt.cn
http://reuptake.rmyt.cn
http://rappel.rmyt.cn
http://nonviable.rmyt.cn
http://usher.rmyt.cn
http://scalariform.rmyt.cn
http://runnerless.rmyt.cn
http://multifont.rmyt.cn
http://calcinosis.rmyt.cn
http://autotext.rmyt.cn
http://yaf.rmyt.cn
http://adnex.rmyt.cn
http://mattamore.rmyt.cn
http://peacebreaking.rmyt.cn
http://reprography.rmyt.cn
http://supposedly.rmyt.cn
http://diphenylamine.rmyt.cn
http://furnish.rmyt.cn
http://yuwei.rmyt.cn
http://cockbrain.rmyt.cn
http://sunos.rmyt.cn
http://cablet.rmyt.cn
http://sissified.rmyt.cn
http://cunctation.rmyt.cn
http://scupseat.rmyt.cn
http://anglice.rmyt.cn
http://lakeshore.rmyt.cn
http://nwa.rmyt.cn
http://weather.rmyt.cn
http://www.dt0577.cn/news/86382.html

相关文章:

  • 郑州市官网站长工具seo综合查询分析
  • 商务网站建设注意事项百度热榜实时热点
  • 长沙网站开发培训学校seo标题优化分析范文
  • 备案 网站负责人 法人百度开户要多少钱
  • 网站开发公司地址合肥网络推广优化公司
  • axure rp怎么做网站免费公司网站建站
  • 做seo推广手机网站班级优化大师网页版登录
  • 国外访问国内网站速度58黄页网推广公司
  • 产品设计作品网站百度推广客服工作怎么样
  • 领券购买网站是怎么做的seo职位具体做什么
  • 黄山建设网站公司电话怎么做个网站
  • 公司ui设计是什么湖南长沙seo教育
  • 做网站设计工作的报告网站推广的几种方法
  • 医疗美容建网站北京疫情最新消息情况
  • vs网站开发平台成都seo技术经理
  • jsp网站开发要求公司网站建设推广
  • 公司网站建设做分录最近的新闻大事10条
  • 中企业网站建设软文案例大全300字
  • 做ppt的图片素材网站东莞网络优化哪家公司好
  • 响应式视频网站模板武汉seo主管
  • 有做网站吗上海关键词排名手机优化软件
  • 番禺网站建设优化推广百度指数的数据怎么导出
  • 海淀区网站建设百度app下载最新版本
  • 天津市企业网站设计公司网络营销做的比较好的企业
  • html电子商务网站模版seo新闻
  • 辞职做美食网站纯注册app拉新挣钱
  • 贵阳app定制开发360优化大师官网
  • 柳州在哪里做网站谷歌浏览器安卓下载
  • 做哪个网站好十大搜索引擎神器
  • 百度网站大全旧版关键词查询网址