dbcfilrs.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. //
  2. //
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Copyright 2015 Autodesk, Inc. All rights reserved.
  6. //
  7. // Use of this software is subject to the terms of the Autodesk license
  8. // agreement provided at the time of installation or download, or which
  9. // otherwise accompanies this software in either electronic or hard copy form.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. //
  13. //
  14. // DESCRIPTION:
  15. //
  16. // This file contains "filer" class definitions of AcDbDeepCloneFiler
  17. // and AcDbWblockCloneFiler. These filers maintain a queue of typed
  18. // object id's. All read/write requests are forwarded to a contained
  19. // "real" filer, except for object id's which are removed/added from/to
  20. // the queue. The classes provide protocol for writing either "owned"
  21. // or "hard" objects in the queue.
  22. #ifndef AD_DBCFILERS_H
  23. #define AD_DBCFILERS_H 1
  24. #include "dbfiler.h"
  25. #pragma pack (push, 8)
  26. class AcDbWblockCloneFiler;
  27. class AcDbImpDeepCloneFiler;
  28. class AcDbDeepCloneFiler: public AcDbDwgFiler
  29. {
  30. friend class AcDbSystemInternals;
  31. public:
  32. ACRX_DECLARE_MEMBERS(AcDbDeepCloneFiler);
  33. AcDbDeepCloneFiler();
  34. virtual ~AcDbDeepCloneFiler();
  35. // overridden from AcDbDwgFiler
  36. //
  37. virtual Acad::ErrorStatus filerStatus() const;
  38. virtual AcDb::FilerType filerType() const;
  39. virtual void setFilerStatus(Acad::ErrorStatus);
  40. virtual void resetFilerStatus();
  41. virtual Acad::ErrorStatus readHardOwnershipId(AcDbHardOwnershipId*);
  42. virtual Acad::ErrorStatus writeHardOwnershipId(const AcDbHardOwnershipId&);
  43. virtual Acad::ErrorStatus readSoftOwnershipId(AcDbSoftOwnershipId*);
  44. virtual Acad::ErrorStatus writeSoftOwnershipId(const AcDbSoftOwnershipId&);
  45. virtual Acad::ErrorStatus readHardPointerId(AcDbHardPointerId*);
  46. virtual Acad::ErrorStatus writeHardPointerId(const AcDbHardPointerId&);
  47. virtual Acad::ErrorStatus readSoftPointerId(AcDbSoftPointerId*);
  48. virtual Acad::ErrorStatus writeSoftPointerId(const AcDbSoftPointerId&);
  49. virtual Acad::ErrorStatus readInt8(Adesk::Int8 *);
  50. virtual Acad::ErrorStatus writeInt8(Adesk::Int8);
  51. // This flavor of readString may go away in a future release.
  52. virtual Acad::ErrorStatus readString(ACHAR **);
  53. virtual Acad::ErrorStatus writeString(const ACHAR *);
  54. virtual Acad::ErrorStatus readString(AcString &);
  55. virtual Acad::ErrorStatus writeString(const AcString &);
  56. virtual Acad::ErrorStatus readBChunk(ads_binary*);
  57. virtual Acad::ErrorStatus writeBChunk(const ads_binary&);
  58. virtual Acad::ErrorStatus readAcDbHandle(AcDbHandle*);
  59. virtual Acad::ErrorStatus writeAcDbHandle(const AcDbHandle&);
  60. virtual Acad::ErrorStatus readInt64(Adesk::Int64*);
  61. virtual Acad::ErrorStatus writeInt64(Adesk::Int64);
  62. virtual Acad::ErrorStatus readInt32(Adesk::Int32*);
  63. virtual Acad::ErrorStatus writeInt32(Adesk::Int32);
  64. virtual Acad::ErrorStatus readInt16(Adesk::Int16*);
  65. virtual Acad::ErrorStatus writeInt16(Adesk::Int16);
  66. virtual Acad::ErrorStatus readUInt64(Adesk::UInt64*);
  67. virtual Acad::ErrorStatus writeUInt64(Adesk::UInt64);
  68. virtual Acad::ErrorStatus readUInt32(Adesk::UInt32*);
  69. virtual Acad::ErrorStatus writeUInt32(Adesk::UInt32);
  70. virtual Acad::ErrorStatus readUInt16(Adesk::UInt16*);
  71. virtual Acad::ErrorStatus writeUInt16(Adesk::UInt16);
  72. virtual Acad::ErrorStatus readUInt8(Adesk::UInt8*);
  73. virtual Acad::ErrorStatus writeUInt8(Adesk::UInt8);
  74. virtual Acad::ErrorStatus readBoolean(Adesk::Boolean*);
  75. virtual Acad::ErrorStatus writeBoolean(Adesk::Boolean);
  76. virtual Acad::ErrorStatus readBool(bool*);
  77. virtual Acad::ErrorStatus writeBool(bool);
  78. virtual Acad::ErrorStatus readDouble(double*);
  79. virtual Acad::ErrorStatus writeDouble(double);
  80. virtual Acad::ErrorStatus readPoint2d(AcGePoint2d*);
  81. virtual Acad::ErrorStatus writePoint2d(const AcGePoint2d&);
  82. virtual Acad::ErrorStatus readPoint3d(AcGePoint3d*);
  83. virtual Acad::ErrorStatus writePoint3d(const AcGePoint3d&);
  84. virtual Acad::ErrorStatus readVector2d(AcGeVector2d*);
  85. virtual Acad::ErrorStatus writeVector2d(const AcGeVector2d&);
  86. virtual Acad::ErrorStatus readVector3d(AcGeVector3d*);
  87. virtual Acad::ErrorStatus writeVector3d(const AcGeVector3d&);
  88. virtual Acad::ErrorStatus readScale3d(AcGeScale3d*);
  89. virtual Acad::ErrorStatus writeScale3d(const AcGeScale3d&);
  90. virtual Acad::ErrorStatus readBytes(void*, Adesk::UIntPtr);
  91. virtual Acad::ErrorStatus writeBytes(const void*, Adesk::UIntPtr);
  92. virtual Acad::ErrorStatus readAddress(void **);
  93. virtual Acad::ErrorStatus writeAddress(const void *);
  94. virtual Acad::ErrorStatus seek(Adesk::Int64 nOffset, int nMethod);
  95. virtual Adesk::Int64 tell() const;
  96. virtual Acad::ErrorStatus addReferences(AcDbIdRefQueue&);
  97. virtual bool usesReferences() const;
  98. virtual AcDbFilerController& controller() const;
  99. // Protocol specific to AcDbDeepCloneFiler
  100. //
  101. virtual bool getNextOwnedObject(AcDbObjectId& id);
  102. virtual bool moreOwnedObjects() const;
  103. protected:
  104. AcDbDeepCloneFiler(AcDbSystemInternals*);
  105. private:
  106. AcDbImpDeepCloneFiler* mpImpFiler;
  107. };
  108. class AcDbWblockCloneFiler: public AcDbDeepCloneFiler
  109. {
  110. friend class AcDbSystemInternals;
  111. public:
  112. ACRX_DECLARE_MEMBERS(AcDbWblockCloneFiler);
  113. AcDbWblockCloneFiler();
  114. virtual Acad::ErrorStatus addReferences(AcDbIdRefQueue&);
  115. virtual bool usesReferences() const;
  116. virtual bool getNextHardObject(AcDbObjectId& id);
  117. virtual bool moreHardObjects() const;
  118. virtual AcDb::FilerType filerType() const;
  119. };
  120. #pragma pack (pop)
  121. #endif