summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/domain.h
blob: 74f7ad0dd4bf9f3344dd27ff82e548bbf70fd6c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2017 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <memory>
#include <string>
#include <vector>
#include "core/hle/kernel/sync_object.h"
#include "core/hle/result.h"

namespace Kernel {

class Session;
class SessionRequestHandler;

class Domain final : public SyncObject {
public:
    std::string GetTypeName() const override {
        return "Domain";
    }

    static const HandleType HANDLE_TYPE = HandleType::Domain;
    HandleType GetHandleType() const override {
        return HANDLE_TYPE;
    }

    static ResultVal<SharedPtr<Domain>> CreateFromSession(const Session& server);

    ResultCode SendSyncRequest(SharedPtr<Thread> thread) override;

    /// The name of this domain (optional)
    std::string name;

    std::vector<std::shared_ptr<SessionRequestHandler>> request_handlers;

private:
    Domain() = default;
    ~Domain() override = default;

    static ResultVal<SharedPtr<Domain>> Create(std::string name = "Unknown");
};

} // namespace Kernel