Profile 相关的类

2016-12-21  本文已影响0人  行知2016
加载Profile的流程

virtual class ProfileManager


ProfileManager* CreateManager();  //创建一个ProfileManagerImpl的实例
//创建、删除、切换 Profile
ProfilePtr CreateProfile(); 
viod DeleteProfile(ProfilePtr profile);   
ProfilePtr ChangeCurrentProfile(ProfilePtr profile);
ProfilePtr ChangeCurrentProfile(uint64_t vid);
//Profile 的存取方法
Profile* GetCurrentProfile();
GrandProfile*  GetGrandProfile(); //获取大账户的登录态
const ProfileList& GetAllProfiles();


</br>

class ProfileManagerImpl

ProfileManager的实现类,在哪些情况下会新增Profile?1. 首次登录 2. 加入了新的企业;


//ProfileManagerImpl 的创建,从本地数据库中加载或者创建大账户和小账户
ProfileManagerImpl();

//添加、删除、切换 Profile
void AddProfile(const ProfilePtr& profile);
void RemoveProfile(ProfilePtr& profile);
ProfilePtr ChangeCurrentProfile(ProfilePtr profile);
ProfilePtr ChangeCurrentProfile(uint64_t vid);
//Profile 的存取方法
Profile* GetCurrentProfile();
GrandProfile*  GetGrandProfile(); //获取大账户的登录态
const ProfileList& GetAllProfiles();

// 作为 GrandSession 的委托,在大账户登录完拉回来企业列表之后为每个企业创建一个 Profile
void OnGetCorpList(const std::vector<CRTX::CorpBriefInfo> &corp_vec);



</br>

virtual class Profile


继承关系

class Profile : public ObserverWrapper<ProfileObserver> 
// Profile 的状态变化可以通知到 ProfileObserver

账户信息


uint64_t                            vid();
const                               CRTX::UserInfo& UserInfo(); 
const                               LoginKeys& GetLoginKeys(); //登录态
ProfileSettings*                    GetSettings();  //个人设置信息
const allconfig:systemconfig&       GetSystemInfo(); //系统配置信息
const CRTX::CorpConfig&             GetCorpInfo(); //公司配置信息

账户状态

typedef num
{
   state_InValid,
   state_Login,
   state_Logout
} State;

账户加载与反加载

void    Load();
void    UnLoad();
bool    IsLoaded();


</br>

class ProfileData

包装Profile的数据


账户加载与反加载

virtual void OnVidChange(Profile* profile) = 0; // vid 发生切换时通知观察者


</br>

class ProfileImpl


上一篇 下一篇

猜你喜欢

热点阅读