Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.2 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright(C) 2000 Microsoft Corporation all rights reserved.
  4. //
  5. // Module: GlobalTransaction.h
  6. //
  7. // Project: Windows 2000 IAS
  8. //
  9. // Description: CGlobalTransaction
  10. //
  11. // Author: tperraut
  12. //
  13. // Revision 02/24/2000 created
  14. //
  15. /////////////////////////////////////////////////////////////////////////////
  16. #ifndef _GLOBALTRANSACTION_H_3F0038C3_D139_4C04_BAF9_86F1E14A256C
  17. #define _GLOBALTRANSACTION_H_3F0038C3_D139_4C04_BAF9_86F1E14A256C
  18. #if _MSC_VER > 1000
  19. #pragma once
  20. #endif // _MSC_VER > 1000
  21. #include "nocopy.h"
  22. class CGlobalTransaction : private NonCopyable
  23. {
  24. protected:
  25. CGlobalTransaction()
  26. :m_StdInitialized(FALSE),
  27. m_RefInitialized(FALSE),
  28. m_DnaryInitialized(FALSE),
  29. m_NT4Initialized(FALSE)
  30. {
  31. };
  32. ~CGlobalTransaction();
  33. public:
  34. static CGlobalTransaction& Instance();
  35. void OpenStdDataSource(LPCWSTR DataSourceName);
  36. void OpenRefDataSource(LPCWSTR DataSourceName);
  37. void OpenDnaryDataSource(LPCWSTR DataSourceName);
  38. void OpenNT4DataSource(LPCWSTR DataSourceName);
  39. void Commit();
  40. void Abort() throw();
  41. void MyCloseDataSources();
  42. CSession& GetStdSession() throw()
  43. {
  44. return m_StdSession; // private member returned
  45. }
  46. CSession& GetRefSession() throw()
  47. {
  48. return m_RefSession; // private member returned
  49. }
  50. CSession& GetNT4Session() throw()
  51. {
  52. return m_NT4Session; // private member returned
  53. }
  54. CSession& GetDnarySession() throw()
  55. {
  56. return m_DnarySession; // private member returned
  57. }
  58. private:
  59. BOOL m_StdInitialized;
  60. BOOL m_RefInitialized;
  61. BOOL m_DnaryInitialized;
  62. BOOL m_NT4Initialized;
  63. CSession m_StdSession;
  64. CSession m_RefSession;
  65. CSession m_DnarySession;
  66. CSession m_NT4Session;
  67. CDataSource m_StdDataSource;
  68. CDataSource m_RefDataSource;
  69. CDataSource m_DnaryDataSource;
  70. CDataSource m_NT4DataSource;
  71. static CGlobalTransaction _instance;
  72. };
  73. #endif // _GLOBALTRANSACTION_H_3F0038C3_D139_4C04_BAF9_86F1E14A256C