client_session.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2016 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <string>
  6. #include <memory>
  7. #include "common/common_types.h"
  8. #include "core/hle/kernel/kernel.h"
  9. namespace Service {
  10. class Interface;
  11. }
  12. namespace Kernel {
  13. class ClientPort;
  14. class ServerSession;
  15. class ClientSession final : public Object {
  16. public:
  17. /**
  18. * Creates a client session.
  19. * @param server_session The server session associated with this client session
  20. * @param name Optional name of client session
  21. * @return The created client session
  22. */
  23. static ResultVal<SharedPtr<ClientSession>> Create(SharedPtr<ServerSession> server_session, std::string name = "Unknown");
  24. std::string GetTypeName() const override { return "ClientSession"; }
  25. std::string GetName() const override { return name; }
  26. static const HandleType HANDLE_TYPE = HandleType::ClientSession;
  27. HandleType GetHandleType() const override { return HANDLE_TYPE; }
  28. /**
  29. * Handle a SyncRequest from the emulated application.
  30. * @return ResultCode of the operation.
  31. */
  32. ResultCode HandleSyncRequest();
  33. std::string name; ///< Name of client port (optional)
  34. SharedPtr<ServerSession> server_session; ///< The server session associated with this client session.
  35. private:
  36. ClientSession();
  37. ~ClientSession() override;
  38. };
  39. } // namespace