Leaked source code of windows server 2003
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.

108 lines
1.9 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: globalid.inl
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. inline
  11. CGlobalId::CGlobalId()
  12. {
  13. m_otObjType = otNone;
  14. DEBUGONLY(++m_UsageCounter);
  15. }
  16. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  17. //
  18. // ctor
  19. //
  20. //-----------------------------------------------------------------------------
  21. inline
  22. CGlobalId::CGlobalId(
  23. const DBID &dbid,
  24. ObjectType ot)
  25. {
  26. m_dbid = dbid;
  27. m_otObjType = ot;
  28. DEBUGONLY(++m_UsageCounter);
  29. }
  30. inline
  31. CGlobalId::CGlobalId(
  32. const CGlobalId &id)
  33. {
  34. m_dbid = id.m_dbid;
  35. m_otObjType = id.m_otObjType;
  36. DEBUGONLY(++m_UsageCounter);
  37. }
  38. inline
  39. CGlobalId::~CGlobalId()
  40. {
  41. DEBUGONLY(--m_UsageCounter);
  42. }
  43. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  44. //
  45. // == operator
  46. //
  47. //-----------------------------------------------------------------------------
  48. inline
  49. int
  50. CGlobalId::operator==(
  51. const CGlobalId& id)
  52. const
  53. {
  54. return (m_dbid == id.m_dbid && m_otObjType == id.m_otObjType);
  55. }
  56. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  57. //
  58. // != operator
  59. //
  60. //-----------------------------------------------------------------------------
  61. inline
  62. int
  63. CGlobalId::operator!=(
  64. const CGlobalId& id)
  65. const
  66. {
  67. return !(m_dbid == id.m_dbid && m_otObjType == id.m_otObjType);
  68. }
  69. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  70. //
  71. // Get the dbid
  72. //
  73. //-----------------------------------------------------------------------------
  74. inline
  75. const DBID &
  76. CGlobalId::GetDBID()
  77. const
  78. {
  79. return m_dbid;
  80. }
  81. inline
  82. ObjectType
  83. CGlobalId::GetObjType(void)
  84. const
  85. {
  86. return m_otObjType;
  87. }