// Copyright (c) 2010 Martin Knafve / hMailServer.com. // http://www.hmailserver.com #pragma once #include "InboxIDCache.h" namespace HM { class Domain; class Account; class Alias; class DistributionList; class CacheConfiguration; class CacheContainer : public Singleton { public: CacheContainer(void); ~CacheContainer(void); std::shared_ptr GetAccount(const String &sName); std::shared_ptr GetAccount(__int64 iID); size_t GetAccountCacheSize(); void SetAccountCacheMaxSize(size_t max_size); size_t GetAccountCacheMaxSize(); std::shared_ptr GetDomain(const String &sName); std::shared_ptr GetDomain(__int64 iID); void RemoveDomain(std::shared_ptr domain); size_t GetDomainCacheSize(); void SetDomainCacheMaxSize(size_t max_size); size_t GetDomainCacheMaxSize(); std::shared_ptr GetAlias(const String &sName); std::shared_ptr GetAlias(__int64 iID); size_t GetAliasCacheSize(); void SetAliasCacheMaxSize(size_t max_size); size_t GetAliasCacheMaxSize(); std::shared_ptr GetDistributionList(const String &sName); std::shared_ptr GetDistributionList(__int64 iID); size_t GetDistributionListCacheSize(); void SetDistributionListCacheMaxSize(size_t max_size); size_t GetDistributionListCacheMaxSize(); void OnPropertyChanged(std::shared_ptr pProperty); InboxIDCache &GetInboxIDCache(); void Clear(); private: InboxIDCache inbox_idcache_; }; }