summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/service.h
blob: f1509998230b7b07b7d500db9d11569b150dcc38 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.

#pragma once

#include <string>

#include "common/common_types.h"
#include "core/hle/syscall.h"

////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace Service

namespace Service {

typedef s32 NativeUID;

/// Interface to a CTROS service
class Interface {
public:

    virtual ~Interface() {
    }

    /**
     * Gets the UID for the serice
     * @return UID of service in native format
     */
    NativeUID GetUID() const {
        return (NativeUID)m_uid;
    }

    /**
     * Gets the string name used by CTROS for a service
     * @return String name of service
     */
    virtual std::string GetName() {
        return "[UNKNOWN SERVICE NAME]";
    }

    /**
     * Gets the string name used by CTROS for a service
     * @return Port name of service
     */
    virtual std::string GetPort() {
        return "[UNKNOWN SERVICE PORT]";
    }

    /**
     * Called when svcSendSyncRequest is called, loads command buffer and executes comand
     * @return Return result of svcSendSyncRequest passed back to user app
     */
    virtual Syscall::Result Sync() = 0;

private:
    u32 m_uid;
};

} // namespace