CallProcessorBinder.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <AzCore/Serialization/SerializeContext.h>
  9. #include <SceneAPI/SceneCore/Events/CallProcessorBinder.h>
  10. namespace AZ
  11. {
  12. namespace SceneAPI
  13. {
  14. namespace Events
  15. {
  16. CallProcessorBinder::~CallProcessorBinder()
  17. {
  18. BusDisconnect();
  19. }
  20. ProcessingResult CallProcessorBinder::Process(ICallContext* context)
  21. {
  22. ProcessingResultCombiner result;
  23. for (auto& it : m_bindings)
  24. {
  25. result += it->Process(this, context);
  26. }
  27. return result.GetResult();
  28. }
  29. void CallProcessorBinder::ActivateBindings()
  30. {
  31. CallProcessorBus::Handler::BusConnect();
  32. }
  33. void CallProcessorBinder::DeactivateBindings()
  34. {
  35. CallProcessorBus::Handler::BusDisconnect();
  36. }
  37. void CallProcessorBinder::ClearBindings()
  38. {
  39. m_bindings.clear();
  40. }
  41. void CallProcessorBinder::Reflect(AZ::ReflectContext* context)
  42. {
  43. SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
  44. if (serializeContext)
  45. {
  46. serializeContext->Class<CallProcessorBinder>()->Version(1);
  47. }
  48. }
  49. } // namespace Events
  50. } // namespace SceneAPI
  51. } // namespace AZ