12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef ECSESSIONGROUPDATA_H
- #define ECSESSIONGROUPDATA_H
- #include <kopano/zcdefs.h>
- #include <mutex>
- #include <mapispi.h>
- #include <kopano/kcodes.h>
- #include "ClientUtil.h"
- class ECNotifyMaster;
- class WSTransport;
- class ECSessionGroupInfo _kc_final {
- public:
- std::string strServer;
- std::string strProfile;
- ECSessionGroupInfo()
- : strServer(), strProfile()
- {
- }
- ECSessionGroupInfo(const std::string &strServer, const std::string &strProfile)
- : strServer(strServer), strProfile(strProfile)
- {
- }
- };
- static inline bool operator==(const ECSessionGroupInfo &a, const ECSessionGroupInfo &b)
- {
- return (a.strServer.compare(b.strServer) == 0) &&
- (a.strProfile.compare(b.strProfile) == 0);
- }
- static inline bool operator<(const ECSessionGroupInfo &a, const ECSessionGroupInfo &b)
- {
- return (a.strServer.compare(b.strServer) < 0) ||
- ((a.strServer.compare(b.strServer) == 0) && (a.strProfile.compare(b.strProfile) < 0));
- }
- class SessionGroupData _kc_final {
- private:
-
- ECSESSIONGROUPID m_ecSessionGroupId;
- ECSessionGroupInfo m_ecSessionGroupInfo;
-
- ECNotifyMaster *m_lpNotifyMaster = nullptr;
-
- std::recursive_mutex m_hMutex;
- sGlobalProfileProps m_sProfileProps;
-
- std::recursive_mutex m_hRefMutex;
- ULONG m_cRef = 0;
- public:
- SessionGroupData(ECSESSIONGROUPID ecSessionGroupId, ECSessionGroupInfo *lpInfo, const sGlobalProfileProps &sProfileProps);
- ~SessionGroupData(void);
- static HRESULT Create(ECSESSIONGROUPID ecSessionGroupId, ECSessionGroupInfo *lpInfo, const sGlobalProfileProps &sProfileProps, SessionGroupData **lppData);
- HRESULT GetOrCreateNotifyMaster(ECNotifyMaster **lppMaster);
- HRESULT GetTransport(WSTransport **lppTransport);
-
- ULONG AddRef();
- ULONG Release();
-
- BOOL IsOrphan();
- ECSESSIONGROUPID GetSessionGroupId();
- };
- #endif
|