parts-test-main.cpp 720 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // { dg-do run }
  2. #include "parts-test-main.h"
  3. #include "parts-test-extra-parts-views.h"
  4. MainParts::MainParts () {}
  5. MainParts::~MainParts ()
  6. {
  7. for (int i = static_cast<int>(main_extra_parts_.size()) - 1; i >= 0; --i)
  8. delete main_extra_parts_[i];
  9. main_extra_parts_.clear();
  10. }
  11. void
  12. MainParts::AddParts (ExtraParts *parts)
  13. {
  14. main_extra_parts_.push_back (parts);
  15. }
  16. void
  17. MainParts::PreEarlyInitialization (void)
  18. {
  19. for (int i = 0; i < main_extra_parts_.size(); ++i)
  20. main_extra_parts_[i]->PreEarlyInitialization ();
  21. }
  22. int
  23. main (int argc, char **argv)
  24. {
  25. MainParts *main_parts = new MainParts ();
  26. main_parts->AddParts (new ExtraPartsViews ());
  27. main_parts->PreEarlyInitialization ();
  28. return 0;
  29. }