client_session.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 "common/common_types.h"
  7. #include "core/hle/kernel/kernel.h"
  8. namespace Kernel {
  9. class ClientPort;
  10. class ServerSession;
  11. class ClientSession final : public Object {
  12. public:
  13. /**
  14. * Creates a client session.
  15. * @param server_session The server session associated with this client session
  16. * @param client_port The client port which this session is connected to
  17. * @param name Optional name of client session
  18. * @return The created client session
  19. */
  20. static ResultVal<SharedPtr<ClientSession>> Create(SharedPtr<ServerSession> server_session, SharedPtr<ClientPort> client_port, std::string name = "Unknown");
  21. std::string GetTypeName() const override { return "ClientSession"; }
  22. std::string GetName() const override { return name; }
  23. static const HandleType HANDLE_TYPE = HandleType::ClientSession;
  24. HandleType GetHandleType() const override { return HANDLE_TYPE; }
  25. /**
  26. * Handle a SyncRequest from the emulated application.
  27. * @return ResultCode of the operation.
  28. */
  29. ResultCode HandleSyncRequest();
  30. std::string name; ///< Name of client port (optional)
  31. SharedPtr<ServerSession> server_session; ///< The server session associated with this client session.
  32. SharedPtr<ClientPort> client_port; ///< The client port which this session is connected to.
  33. private:
  34. ClientSession();
  35. ~ClientSession() override;
  36. };
  37. } // namespace