patterns.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #define EXPORT(x) x {}
  2. namespace NSA
  3. {
  4. class ClassA
  5. {
  6. private:
  7. class Private
  8. {
  9. public:
  10. Private();
  11. virtual ~Private();
  12. void privmethod1(int);
  13. void privmethod2(int);
  14. };
  15. Private *p;
  16. class Internal
  17. {
  18. public:
  19. Internal();
  20. virtual ~Internal();
  21. void internal_method1(char);
  22. void internal_method2(char);
  23. };
  24. Internal *i;
  25. public:
  26. ClassA();
  27. virtual ~ClassA();
  28. virtual void generate_vt(const char *) const;
  29. };
  30. EXPORT(ClassA::Private::Private());
  31. EXPORT(ClassA::Private::~Private());
  32. EXPORT(void ClassA::Private::privmethod1(int));
  33. EXPORT(void ClassA::Private::privmethod2(int));
  34. EXPORT(ClassA::Internal::Internal());
  35. EXPORT(ClassA::Internal::~Internal());
  36. EXPORT(void ClassA::Internal::internal_method1(char));
  37. EXPORT(void ClassA::Internal::internal_method2(char));
  38. EXPORT(ClassA::ClassA());
  39. EXPORT(ClassA::~ClassA());
  40. EXPORT(void ClassA::generate_vt(const char *) const);
  41. };
  42. class ClassB
  43. {
  44. public:
  45. ClassB();
  46. virtual ~ClassB();
  47. virtual void generate_vt(const char *) const;
  48. };
  49. EXPORT(ClassB::ClassB());
  50. EXPORT(ClassB::~ClassB());
  51. EXPORT(void ClassB::generate_vt(const char *) const);
  52. class ClassC
  53. {
  54. public:
  55. ClassC();
  56. virtual ~ClassC();
  57. virtual void generate_vt(const char *) const;
  58. };
  59. EXPORT(ClassC::ClassC());
  60. EXPORT(ClassC::~ClassC());
  61. EXPORT(void ClassC::generate_vt(const char *) const);
  62. namespace NSB
  63. {
  64. class ClassD : public NSA::ClassA, public ClassB, public ClassC
  65. {
  66. public:
  67. ClassD();
  68. virtual ~ClassD();
  69. virtual void generate_vt(const char *) const;
  70. };
  71. EXPORT(ClassD::ClassD());
  72. EXPORT(ClassD::~ClassD());
  73. EXPORT(void ClassD::generate_vt(const char *) const);
  74. class Symver {
  75. public:
  76. Symver();
  77. ~Symver();
  78. void symver_method1();
  79. void symver_method2();
  80. };
  81. EXPORT(Symver::Symver());
  82. EXPORT(Symver::~Symver());
  83. EXPORT(void Symver::symver_method1());
  84. EXPORT(void Symver::symver_method2());
  85. class SymverOptional {
  86. public:
  87. SymverOptional();
  88. ~SymverOptional();
  89. };
  90. EXPORT(SymverOptional::SymverOptional());
  91. EXPORT(SymverOptional::~SymverOptional());
  92. };