rxclass.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. #pragma once
  13. #include "acbasedefs.h"
  14. #include "rxobject.h"
  15. #include "AdAChar.h"
  16. #pragma pack (push, 8)
  17. class AcRxMemberCollection;
  18. class AcRxAttributeCollection;
  19. class AcRxSet;
  20. class AcRxImpClass;
  21. class AcRxMemberCollectionBuilder;
  22. typedef void (*AcRxMemberCollectionConstructorPtr)(AcRxMemberCollectionBuilder&, void*);
  23. class AcRxClass: public AcRxObject
  24. {
  25. public:
  26. ACRX_DECLARE_MEMBERS_EXPIMP(AcRxClass, ACBASE_PORT);
  27. ACBASE_PORT AcRxObject* addX(AcRxClass*, AcRxObject*);
  28. // Deprecated: The getX() method will be removed in a future
  29. // release. Please use queryX() instead.
  30. ACBASE_PORT AcRxObject* getX(const AcRxClass*);
  31. ACBASE_PORT AcRxObject* delX(AcRxClass*);
  32. ACBASE_PORT AcRxObject* queryX(const AcRxClass*);
  33. ACBASE_PORT AcRxObject* create();
  34. ACBASE_PORT const ACHAR* appName() const;
  35. ACBASE_PORT const ACHAR* dxfName() const;
  36. ACBASE_PORT const ACHAR* name() const;
  37. ACBASE_PORT void getClassVersion(int& dwgVer,
  38. int& maintVer) const;
  39. ACBASE_PORT int proxyFlags() const;
  40. ACBASE_PORT bool isDerivedFrom(const AcRxClass*) const;
  41. ACBASE_PORT AcRxClass* myParent() const;
  42. ACBASE_PORT AcRx::Ordering comparedTo(const AcRxObject*) const;
  43. ACBASE_PORT AppNameChangeFuncPtr appNameCallbackPtr() const;
  44. ACBASE_PORT const AcRxSet* descendants() const;
  45. ACBASE_PORT AcRxMemberCollection* members() const;
  46. ACBASE_PORT const AcRxAttributeCollection& attributes() const;
  47. ACBASE_PORT AcRxAttributeCollection& attributes();
  48. protected:
  49. AcRxClass(const ACHAR* name, const ACHAR* parent, AcRxMemberCollectionConstructorPtr memberConstruct, void* userData = NULL);
  50. virtual ~AcRxClass();
  51. private:
  52. AcRxClass();
  53. friend class AcRxImpClass;
  54. AcRxImpClass* m_pImp;
  55. };
  56. ACBASE_PORT AcRxClass* newAcRxClass(
  57. const ACHAR* className,
  58. const ACHAR* parentClassName,
  59. int proxyFlags = 0,
  60. AcRxObject* (*pseudoConstructor)() = NULL,
  61. const ACHAR* dxfName = NULL,
  62. const ACHAR* appName = NULL);
  63. ACBASE_PORT AcRxClass* newAcRxClass(
  64. const ACHAR* className,
  65. const ACHAR* parentClassName,
  66. int dwgVer,
  67. int maintVer,
  68. int proxyFlags = 0,
  69. AcRxObject* (*pseudoConstructor)() = NULL,
  70. const ACHAR* dxfName = NULL,
  71. const ACHAR* appName = NULL,
  72. AppNameChangeFuncPtr func = NULL);
  73. ACBASE_PORT AcRxClass* newAcRxClass(
  74. const ACHAR* className,
  75. const ACHAR* parentClassName,
  76. int dwgVer,
  77. int maintVer,
  78. int proxyFlags ,
  79. AcRxObject* (*pseudoConstructor)() ,
  80. const ACHAR* dxfName ,
  81. const ACHAR* appName ,
  82. AppNameChangeFuncPtr func,
  83. AcRxMemberCollectionConstructorPtr makeMembers,
  84. void* userData = NULL);
  85. ACBASE_PORT void acrxBuildClassHierarchy();
  86. // Destruction: DELETE AcDbObject-derived CLASSES DURING APPLICATION UNLOAD ONLY !!!
  87. ACBASE_PORT void deleteAcRxClass(AcRxClass* pClassObj);
  88. ACBASE_PORT void acrxInitTypeSystem();
  89. ACBASE_PORT void acrxTerminateTypeSystem();
  90. inline bool AcRxObject::isKindOf(const AcRxClass* pOtherClass) const
  91. {
  92. const AcRxClass * pMyClass = this->isA();
  93. return pMyClass == NULL ? false : pMyClass->isDerivedFrom(pOtherClass);
  94. }
  95. #pragma pack (pop)