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.

110 lines
1.7 KiB

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