[FileZilla Client 源码分析一]CContextManager与CState类
2014-04-16 17:49
393 查看
CContextManager
CContextManager类是一个全局单例,承载着管理CState作用,在CState变化时发出通知。
CState类是FileZilla引擎的创建和管理者,并作为消息的管理者,下面重点理解CState类的工作机制。
一、CFileZillaEngine引擎以及Command消息队列创建:
m_pEngine = new CFileZillaEngine();
m_pEngine->Init(m_pMainFrame, COptions::Get());
m_pCommandQueue = new CCommandQueue(m_pEngine, m_pMainFrame, this);
二、Connect
1. 判断m_pEngine 是否已经连接、是否处于忙碌状态以及CommandQueue是否非空
2. 发送connect命令:m_pCommandQueue->ProcessCommand(new CConnectCommand(server))
3. 发送list命令:m_pCommandQueue->ProcessCommand(new CListCommand(path, _T(""), LIST_FLAG_FALLBACK_CURRENT));
三、CContextManager、CState、CFileZillaEngine、CCommandQueue关系
CContextManager是一个全局单例,成员变量std::vector<CState*> m_contexts;记录不同的会话。
CState类,成员变量 CFileZillaEngine* m_pEngine; CCommandQueue* m_pCommandQueue; 是单个会话的管理类。
CCommandQueue类包含 CFileZillaEngine *m_pEngine;CState* m_pState;的引用,同时friend class CCommandQueue;是CState友元类。
CContextManager类是一个全局单例,承载着管理CState作用,在CState变化时发出通知。
CState类是FileZilla引擎的创建和管理者,并作为消息的管理者,下面重点理解CState类的工作机制。
一、CFileZillaEngine引擎以及Command消息队列创建:
m_pEngine = new CFileZillaEngine();
m_pEngine->Init(m_pMainFrame, COptions::Get());
m_pCommandQueue = new CCommandQueue(m_pEngine, m_pMainFrame, this);
二、Connect
1. 判断m_pEngine 是否已经连接、是否处于忙碌状态以及CommandQueue是否非空
2. 发送connect命令:m_pCommandQueue->ProcessCommand(new CConnectCommand(server))
3. 发送list命令:m_pCommandQueue->ProcessCommand(new CListCommand(path, _T(""), LIST_FLAG_FALLBACK_CURRENT));
三、CContextManager、CState、CFileZillaEngine、CCommandQueue关系
CContextManager是一个全局单例,成员变量std::vector<CState*> m_contexts;记录不同的会话。
CState类,成员变量 CFileZillaEngine* m_pEngine; CCommandQueue* m_pCommandQueue; 是单个会话的管理类。
CCommandQueue类包含 CFileZillaEngine *m_pEngine;CState* m_pState;的引用,同时friend class CCommandQueue;是CState友元类。
相关文章推荐
- httpclient源码分析之 PoolingHttpClientConnectionManager 获取连接
- [FileZilla Client 源码分析二]CCommandQueue类
- memcache-client-forjava 源码分析之MemcachedCacheManager
- HDFS dfsclient读文件过程 源码分析
- requirejs源码分析: requirejs 方法–2. context.require(deps, callback, errback);
- Hadoop源码分析笔记(十四):名字节点--远程接口ClientProtocol
- Hadoop源码分析- RPC client端篇
- Spring之WebContext不使用web.xml启动 初始化重要的类源码分析(Servlet3.0以上的)
- springMVC源码分析--容器初始化(一)ContextLoaderListener
- WSServletContextListener jax-ws 源码分析
- Android 6.0 之AlarmManagerService源码分析
- Docker源码分析(二):Docker Client创建与命令执行
- OpenStack HeatClient 源码分析
- Spring boot源码分析-AnnotationConfigApplicationContext非web环境下的启动容器(2)
- 简单分析 mContext.getPackageManager() 调用流程
- go HTTP Client大量长连接保持(自定义client设置及源码简单分析)
- python-novaclient源码分析-M版本
- DDPush开源推送框架源码分析之Client到DDPush(UDP模式)
- MyBatis-3.4.2-源码分析15:XML解析之buildStatementFromContext(context.evalNodes(‘select|insert|update|delete’
- Hadoop源码分析38 JobClient的线程协作