- extracted srv: calls from service.cpp and put in its own module

- added function tables for service calls
- lots of refactoring
This commit is contained in:
bunnei
2014-04-15 22:40:19 -04:00
parent cb504e236b
commit 7ec5950bc4
6 changed files with 113 additions and 106 deletions

View File

@ -37,14 +37,6 @@ public:
return (NativeUID)m_uid;
}
/**
* Gets the string name used by CTROS for a service
* @return String name of service
*/
virtual std::string GetName() const {
return "[UNKNOWN SERVICE NAME]";
}
/**
* Gets the string name used by CTROS for a service
* @return Port name of service
@ -59,8 +51,19 @@ public:
*/
virtual Syscall::Result Sync() = 0;
protected:
/**
* Registers the functions in the service
*/
void Register(const HLE::FunctionDef* functions, int len) {
for (int i = 0; i < len; i++) {
m_functions[functions[i].id] = functions[i];
}
}
private:
u32 m_uid;
std::map<u32, HLE::FunctionDef> m_functions;
};
/// Simple class to manage accessing services from ports and UID handles