ECDatabaseFactory.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #ifndef ECDATABASEFACTORY_H
  18. #define ECDATABASEFACTORY_H
  19. #include <kopano/zcdefs.h>
  20. #include "ECDatabase.h"
  21. #include <kopano/ECConfig.h>
  22. #include <kopano/ECLogger.h>
  23. namespace KC {
  24. // The ECDatabaseFactory creates database objects connected to the server database. Which
  25. // database is returned is chosen by the database_engine configuration setting.
  26. class _kc_export ECDatabaseFactory _kc_final {
  27. public:
  28. ECDatabaseFactory(ECConfig *lpConfig);
  29. ECRESULT CreateDatabaseObject(ECDatabase **lppDatabase, std::string &ConnectError);
  30. ECRESULT CreateDatabase();
  31. ECRESULT UpdateDatabase(bool bForceUpdate, std::string &strError);
  32. private:
  33. _kc_hidden ECRESULT GetDatabaseFactory(ECDatabase **);
  34. ECConfig* m_lpConfig;
  35. };
  36. ECRESULT GetThreadLocalDatabase(ECDatabaseFactory *lpFactory, ECDatabase **lppDatabase);
  37. } /* namespace */
  38. #endif // ECDATABASEFACTORY_H