message_handler.h 970 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright 2004 The WebRTC Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef RTC_BASE_MESSAGE_HANDLER_H_
  11. #define RTC_BASE_MESSAGE_HANDLER_H_
  12. #include <utility>
  13. #include "api/function_view.h"
  14. #include "rtc_base/constructor_magic.h"
  15. #include "rtc_base/system/rtc_export.h"
  16. namespace rtc {
  17. struct Message;
  18. // Messages get dispatched to a MessageHandler
  19. class RTC_EXPORT MessageHandler {
  20. public:
  21. virtual ~MessageHandler();
  22. virtual void OnMessage(Message* msg) = 0;
  23. protected:
  24. MessageHandler() {}
  25. private:
  26. RTC_DISALLOW_COPY_AND_ASSIGN(MessageHandler);
  27. };
  28. } // namespace rtc
  29. #endif // RTC_BASE_MESSAGE_HANDLER_H_