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.

85 lines
2.2 KiB

  1. // Marker.cpp: implementation of the CMarker class.
  2. //
  3. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  4. // 2000. This computer program includes Confidential, Proprietary
  5. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  6. // use, disclosure, and/or reproduction is prohibited unless authorized
  7. // in writing. All Rights Reserved.
  8. //////////////////////////////////////////////////////////////////////
  9. #include "iopExc.h"
  10. #include "Marker.h"
  11. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  12. namespace iop
  13. {
  14. // #if defined(WIN32_LEAN_AND_MEAN)
  15. // operator==(UUID const &lhs,
  16. // UUID const &rhs)
  17. // {
  18. // return (0 == memcmp(&lhs, &rhs, sizeof lhs));
  19. // }
  20. // bool
  21. // operator!=(UUID const &lhs,
  22. // UUID const &rhs)
  23. // {
  24. // return !(lhs == rhs);
  25. // }
  26. // #endif // defined(WIN32_LEAN_AND_MEAN)
  27. //////////////////////////////////////////////////////////////////////
  28. // Construction/Destruction
  29. //////////////////////////////////////////////////////////////////////
  30. CMarker::CMarker(MarkerType const &Type) : m_Type(Type), m_Counter(0)
  31. {
  32. // When m_Counter is zero, the m_GUID need not be defined.
  33. }
  34. CMarker::CMarker(CMarker const &Marker)
  35. {
  36. m_Type = Marker.m_Type;
  37. m_Counter = Marker.m_Counter;
  38. m_GUID = Marker.m_GUID;
  39. }
  40. CMarker::CMarker(MarkerType Type, UUID const &Guid, MarkerCounter const &Counter) :
  41. m_Type(Type), m_GUID(Guid), m_Counter(Counter)
  42. {
  43. }
  44. CMarker::~CMarker()
  45. {
  46. }
  47. CMarker& CMarker::operator=(const CMarker &rhs)
  48. {
  49. if(m_Type != rhs.m_Type) throw Exception(ccInvalidParameter);
  50. m_Counter = rhs.m_Counter;
  51. m_GUID = rhs.m_GUID;
  52. return *this;
  53. }
  54. bool IOPDLL_API __cdecl operator==(const CMarker &lhs, const CMarker &rhs)
  55. {
  56. if(lhs.m_Type != rhs.m_Type) return false;
  57. if(lhs.m_Counter != rhs.m_Counter) return false;
  58. if(lhs.m_Counter) return ((lhs.m_GUID==rhs.m_GUID) ? true : false);
  59. else return true; // Both counters are zero, ignore m_GUID
  60. }
  61. bool IOPDLL_API __cdecl operator!=(const CMarker &lhs, const CMarker &rhs)
  62. {
  63. return !(lhs==rhs);
  64. }
  65. } // namespace iop