SerializableObject.cpp 665 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #include <Jolt.h>
  4. #include <ObjectStream/SerializableObject.h>
  5. namespace JPH {
  6. JPH_IMPLEMENT_SERIALIZABLE_ABSTRACT(SerializableObject)
  7. {
  8. }
  9. void OSVisitCompounds(const void *inObject, const RTTI *inRTTI, const CompoundVisitor &inVisitor)
  10. {
  11. JPH_ASSERT(inObject != nullptr);
  12. // Visit attributes
  13. for (int i = 0; i < inRTTI->GetAttributeCount(); ++i)
  14. {
  15. const SerializableAttribute *attr = DynamicCast<SerializableAttribute>(inRTTI->GetAttribute(i));
  16. if (attr != nullptr)
  17. attr->VisitCompounds(inObject, inVisitor);
  18. }
  19. // Call visitor
  20. inVisitor(inObject, inRTTI);
  21. }
  22. } // JPH