Stub.h 588 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2022, the SerenityOS developers.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <AK/ByteString.h>
  9. #include <AK/OwnPtr.h>
  10. #include <LibIPC/Forward.h>
  11. namespace AK {
  12. class BufferStream;
  13. }
  14. namespace IPC {
  15. class Stub {
  16. public:
  17. virtual ~Stub() = default;
  18. virtual u32 magic() const = 0;
  19. virtual ByteString name() const = 0;
  20. virtual ErrorOr<OwnPtr<MessageBuffer>> handle(Message const&) = 0;
  21. protected:
  22. Stub() = default;
  23. private:
  24. ByteString m_name;
  25. };
  26. }