dbidapps.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. //
  12. // DESCRIPTION:
  13. //
  14. // This file contains the inlined versions of the comparsion operators
  15. // for the AcDbObjectId class, that are for use by adjacent applications.
  16. // These operators call out to explicit functions, to allow behavioral
  17. // modification of these operators between c4 and c5. Presumably, the
  18. // AutoCAD/adjacent app division of these operators will be collapsed back
  19. // into dbid.h at a future date.
  20. //
  21. // See dbid.cc for the body of the function calls.
  22. // See dbid.h for further description of the AcDbObjectId types.
  23. #ifndef _AD_DBID_APPS_H
  24. #define _AD_DBID_APPS_H 1
  25. #include "adesk.h"
  26. #include "dbid.h"
  27. #include "dbid_ops.h"
  28. #pragma pack (push, 8)
  29. //////////////////// AcDbObjectId inlines ////////////////////
  30. // LHS AcDbObjectId -- RHS AcDbObjectId
  31. inline bool
  32. AcDbObjectId::operator < (const AcDbObjectId& id) const
  33. { return c5ObjIdIsLessThan(*this, id); }
  34. inline bool
  35. AcDbObjectId::operator > (const AcDbObjectId& id) const
  36. { return c5ObjIdIsGreaterThan(*this, id); }
  37. inline bool
  38. AcDbObjectId::operator <= (const AcDbObjectId& id) const
  39. { return c5ObjIdLessThanOrEqual(*this, id); }
  40. inline bool
  41. AcDbObjectId::operator >= (const AcDbObjectId& id) const
  42. { return c5ObjIdGreaterThanOrEqual(*this, id); }
  43. inline bool
  44. AcDbObjectId::operator == (const AcDbObjectId& id) const
  45. { return c5ObjIdIsEqualTo(*this, id); }
  46. inline bool
  47. AcDbObjectId::operator != (const AcDbObjectId& id) const
  48. { return !c5ObjIdIsEqualTo(*this, id); }
  49. // LHS AcDbObjectId -- RHS AcDbStub*
  50. inline bool
  51. AcDbObjectId::operator < (const AcDbStub* pStub) const
  52. { return c5ObjIdIsLessThan(*this, pStub); }
  53. inline bool
  54. AcDbObjectId::operator > (const AcDbStub* pStub) const
  55. { return c5ObjIdIsGreaterThan(*this, pStub); }
  56. inline bool
  57. AcDbObjectId::operator <= (const AcDbStub* pStub) const
  58. { return c5ObjIdLessThanOrEqual(*this, pStub); }
  59. inline bool
  60. AcDbObjectId::operator >= (const AcDbStub* pStub) const
  61. { return c5ObjIdGreaterThanOrEqual(*this, pStub); }
  62. inline bool
  63. AcDbObjectId::operator == (const AcDbStub* pStub) const
  64. { return c5ObjIdIsEqualTo(*this, pStub); }
  65. inline bool
  66. AcDbObjectId::operator != (const AcDbStub* pStub) const
  67. { return !c5ObjIdIsEqualTo(*this, pStub); }
  68. //////////////////// AcDbR13ObjectId inlines ////////////////////
  69. // The behavior of AcDbObjectId's in 3rd party applications with
  70. // respect to the boolean operators defined by this class has
  71. // changed from R13. If applications need to return to the old-style
  72. // behavior for some reason (they shouldn't, but you never know ...)
  73. // they can cast objectIds to this class.
  74. class AcDbR13ObjectId : public AcDbObjectId
  75. {
  76. public:
  77. bool operator < (const AcDbR13ObjectId& id) const;
  78. bool operator > (const AcDbR13ObjectId& id) const;
  79. bool operator <= (const AcDbR13ObjectId& id) const;
  80. bool operator >= (const AcDbR13ObjectId& id) const;
  81. bool operator == (const AcDbR13ObjectId& id) const;
  82. bool operator != (const AcDbR13ObjectId& id) const;
  83. bool operator < (const AcDbStub* pStub) const;
  84. bool operator > (const AcDbStub* pStub) const;
  85. bool operator <= (const AcDbStub* pStub) const;
  86. bool operator >= (const AcDbStub* pStub) const;
  87. bool operator == (const AcDbStub* pStub) const;
  88. bool operator != (const AcDbStub* pStub) const;
  89. };
  90. // LHS AcDbObjectId -- RHS AcDbObjectId
  91. inline bool
  92. AcDbR13ObjectId::operator < (const AcDbR13ObjectId& id) const
  93. { return c4ObjIdIsLessThan(reinterpret_cast<Adesk::ULongPtr>(mId),
  94. reinterpret_cast<Adesk::ULongPtr>(id.mId));
  95. }
  96. inline bool
  97. AcDbR13ObjectId::operator > (const AcDbR13ObjectId& id) const
  98. { return c4ObjIdIsGreaterThan(reinterpret_cast<Adesk::ULongPtr>(mId),
  99. reinterpret_cast<Adesk::ULongPtr>(id.mId));
  100. }
  101. inline bool
  102. AcDbR13ObjectId::operator <= (const AcDbR13ObjectId& id) const
  103. { return c4ObjIdLessThanOrEqual(reinterpret_cast<Adesk::ULongPtr>(mId),
  104. reinterpret_cast<Adesk::ULongPtr>(id.mId));
  105. }
  106. inline bool
  107. AcDbR13ObjectId::operator >= (const AcDbR13ObjectId& id) const
  108. { return c4ObjIdGreaterThanOrEqual(reinterpret_cast<Adesk::ULongPtr>(mId),
  109. reinterpret_cast<Adesk::ULongPtr>(id.mId));
  110. }
  111. inline bool
  112. AcDbR13ObjectId::operator == (const AcDbR13ObjectId& id) const
  113. { return c4ObjIdIsEqualTo(reinterpret_cast<Adesk::ULongPtr>(mId),
  114. reinterpret_cast<Adesk::ULongPtr>(id.mId));
  115. }
  116. inline bool
  117. AcDbR13ObjectId::operator != (const AcDbR13ObjectId& id) const
  118. { return c4ObjIdNotEqualTo(reinterpret_cast<Adesk::ULongPtr>(mId),
  119. reinterpret_cast<Adesk::ULongPtr>(id.mId));
  120. }
  121. // LHS AcDbObjectId -- RHS AcDbStub*
  122. inline bool
  123. AcDbR13ObjectId::operator < (const AcDbStub* pStub) const
  124. { return c4ObjIdIsLessThan(reinterpret_cast<Adesk::ULongPtr>(mId),
  125. reinterpret_cast<Adesk::ULongPtr>(pStub)); }
  126. inline bool
  127. AcDbR13ObjectId::operator > (const AcDbStub* pStub) const
  128. { return c4ObjIdIsGreaterThan(reinterpret_cast<Adesk::ULongPtr>(mId),
  129. reinterpret_cast<Adesk::ULongPtr>(pStub)); }
  130. inline bool
  131. AcDbR13ObjectId::operator <= (const AcDbStub* pStub) const
  132. { return c4ObjIdLessThanOrEqual(reinterpret_cast<Adesk::ULongPtr>(mId),
  133. reinterpret_cast<Adesk::ULongPtr>(pStub)); }
  134. inline bool
  135. AcDbR13ObjectId::operator >= (const AcDbStub* pStub) const
  136. { return c4ObjIdGreaterThanOrEqual(reinterpret_cast<Adesk::ULongPtr>(mId),
  137. reinterpret_cast<Adesk::ULongPtr>(pStub)); }
  138. inline bool
  139. AcDbR13ObjectId::operator == (const AcDbStub* pStub) const
  140. { return c4ObjIdIsEqualTo(reinterpret_cast<Adesk::ULongPtr>(mId),
  141. reinterpret_cast<Adesk::ULongPtr>(pStub)); }
  142. inline bool
  143. AcDbR13ObjectId::operator != (const AcDbStub* pStub) const
  144. { return c4ObjIdNotEqualTo(reinterpret_cast<Adesk::ULongPtr>(mId),
  145. reinterpret_cast<Adesk::ULongPtr>(pStub)); }
  146. #pragma pack (pop)
  147. #endif // _AD_DBID_APPS_H