summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/acc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* hle/service: Default constructors and destructors in the cpp file where applicableLioncash2018-09-1110-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a destructor isn't defaulted into a cpp file, it can cause the use of forward declarations to seemingly fail to compile for non-obvious reasons. It also allows inlining of the construction/destruction logic all over the place where a constructor or destructor is invoked, which can lead to code bloat. This isn't so much a worry here, given the services won't be created and destroyed frequently. The cause of the above mentioned non-obvious errors can be demonstrated as follows: ------- Demonstrative example, if you know how the described error happens, skip forwards ------- Assume we have the following in the header, which we'll call "thing.h": \#include <memory> // Forward declaration. For example purposes, assume the definition // of Object is in some header named "object.h" class Object; class Thing { public: // assume no constructors or destructors are specified here, // or the constructors/destructors are defined as: // // Thing() = default; // ~Thing() = default; // // ... Some interface member functions would be defined here private: std::shared_ptr<Object> obj; }; If this header is included in a cpp file, (which we'll call "main.cpp"), this will result in a compilation error, because even though no destructor is specified, the destructor will still need to be generated by the compiler because std::shared_ptr's destructor is *not* trivial (in other words, it does something other than nothing), as std::shared_ptr's destructor needs to do two things: 1. Decrement the shared reference count of the object being pointed to, and if the reference count decrements to zero, 2. Free the Object instance's memory (aka deallocate the memory it's pointing to). And so the compiler generates the code for the destructor doing this inside main.cpp. Now, keep in mind, the Object forward declaration is not a complete type. All it does is tell the compiler "a type named Object exists" and allows us to use the name in certain situations to avoid a header dependency. So the compiler needs to generate destruction code for Object, but the compiler doesn't know *how* to destruct it. A forward declaration doesn't tell the compiler anything about Object's constructor or destructor. So, the compiler will issue an error in this case because it's undefined behavior to try and deallocate (or construct) an incomplete type and std::shared_ptr and std::unique_ptr make sure this isn't the case internally. Now, if we had defaulted the destructor in "thing.cpp", where we also include "object.h", this would never be an issue, as the destructor would only have its code generated in one place, and it would be in a place where the full class definition of Object would be visible to the compiler. ---------------------- End example ---------------------------- Given these service classes are more than certainly going to change in the future, this defaults the constructors and destructors into the relevant cpp files to make the construction and destruction of all of the services consistent and unlikely to run into cases where forward declarations are indirectly causing compilation errors. It also has the plus of avoiding the need to rebuild several services if destruction logic changes, since it would only be necessary to recompile the single cpp file.
* acc: Replace profile_manager include with a forward declarationLioncash2018-08-212-2/+6
| | | | This is only used in a shared_ptr, so we can forward declare it.
* acc: Simplify WriteBuffer call within LoadImage()Lioncash2018-08-211-3/+3
| | | | | | We have an overload of WriteBuffer that accepts containers that satisfy the ContiguousContainer concept, which std::array does, so we only need to pass in the array itself.
* acc: Correct IProfile's constructor initializer list orderLioncash2018-08-211-1/+1
| | | | Arranges them in the order the members would be initialized
* acc: Remove unused DEFAULT_USER_IDLioncash2018-08-211-3/+0
| | | | This is no longer used, so it can be removed.
* profile_manager: Use INVALID_UUID in the initializer of last_opened_userLioncash2018-08-211-1/+1
| | | | Makes it a little bit more self-documenting.
* profile_manager: Remove unnecessary memcpy in GetProfileBaseAndData()Lioncash2018-08-211-1/+1
| | | | | Given the source and destination types are the same std::array type, we can simply use regular assignment to perform the same behavior.
* profile_manager: Use type aliases for username data, profile data, and user arraysLioncash2018-08-212-19/+22
| | | | | Avoids the need to repeatedly specify the whole array type in multiple places.
* profile_manager: Take ProfileInfo by const reference where applicableLioncash2018-08-212-8/+8
| | | | | | ProfileInfo is quite a large struct in terms of data, and we don't need to perform a copy in these instances, so we can just pass constant references instead.
* profile_manager: Make array parameter to CreateNewUser a const referenceLioncash2018-08-212-2/+2
| | | | | This doesn't modify the passed in array, so this can be a const reference.
* profile_manager: Remove unnecessary staticLioncash2018-08-211-1/+1
| | | | This can just be constexpr like the others
* profile_manager: Simplify UUID's two param constructor, operator==, and operator boolLioncash2018-08-211-6/+4
| | | | | | We can use the constructor initializer list and just compare the contained u128's together instead of comparing each element individually. Ditto for comparing against an invalid UUID.
* profile_manager: Move UUID generation function to the cpp fileLioncash2018-08-212-10/+12
| | | | | This avoids needing to dump the contents of <random> into other files that include the profile manager header.
* profile_manager: Remove unnecessary std::move in AddToProfiles() and CreateNewUser()Lioncash2018-08-201-2/+2
| | | | | | Moving a const reference isn't possible, so this just results in a copy (and given ProfileInfo is composed of trivial types and aggregates, a move wouldn't really do anything).
* Better UUID randomnessDavid Marcec2018-08-111-2/+7
|
* Removed un-needed count from ListOpenUsers and ListAllUsersDavid Marcec2018-08-111-4/+2
|
* Added better explanations in the profile managerDavid Marcec2018-08-112-1/+34
|
* Code cleanup for profile managerDavid Marcec2018-08-113-40/+47
|
* Removed const from ProfileBase InvalidateDavid Marcec2018-08-111-1/+1
|
* fixed invalid uuid bool operatorDavid Marcec2018-08-111-1/+1
|
* Added GetOpenUserCountDavid Marcec2018-08-113-3/+14
|
* Removed all for loops from the profile managerDavid Marcec2018-08-111-9/+4
|
* Added missing ListAllUsers countDavid Marcec2018-08-111-1/+2
|
* If statement style changeDavid Marcec2018-08-111-11/+19
|
* Second round of account changesDavid Marcec2018-08-113-18/+21
|
* First round of account changesDavid Marcec2018-08-113-49/+55
|
* Refactored profile manager sharingDavid Marcec2018-08-1110-20/+28
|
* Merge remote-tracking branch 'origin/master' into better-accountDavid Marcec2018-08-111-1/+22
|\
| * Service/Account: stub LoadImage functionmailwl2018-08-081-1/+22
| |
* | Added IsUserRegistrationRequestPermittedDavid Marcec2018-08-117-3/+19
| |
* | Don't add user if the uuid already existsDavid Marcec2018-08-091-0/+4
| |
* | Open first user addedDavid Marcec2018-08-081-1/+3
| |
* | Inital pass of account backend implementationDavid Marcec2018-08-083-12/+22
| | | | | | | | This commit verified working on puyo
* | GetProfileBase and GetProfileBaseAndData addedDavid Marcec2018-08-083-44/+106
| |
* | began initial implementation of "ProfileManager"David Marcec2018-08-084-44/+200
| |
* | Switched uuids from u128 to new UUID structDavid Marcec2018-08-082-10/+49
|/
* acc: Add missing function table entries for GetUserCountLioncash2018-08-082-2/+2
| | | | | Given this is stubbed within the common module in 5ac7b84, it should be added to the other relevant tables as well.
* acc: Stub GetUserCount. (#973)bunnei2018-08-083-1/+9
| | | - Used by Pokken Tournament DX.
* Added ability to change username & language code in the settings ui. Added IProfile::Get and SET::GetLanguageCode for libnx tests (#851)David2018-08-031-3/+27
|
* core: Make converting constructors explicit where applicableLioncash2018-07-241-1/+1
| | | | | Avoids unwanted implicit conversions. Thankfully, given the large amount of cleanup in past PRs, only this tiny amount is left over to cover.
* HLE/ACC: Stub IManagerForApplication::GetAccountId to return an error.Subv2018-07-201-6/+8
| | | | | | And make IManagerForApplication::CheckAvailability always return false. Returning a bogus id from GetAccountId causes games to crash on boot. We should investigate this with a hwtest and either stub it properly or implement it.
* Merge pull request #728 from Subv/acc_profilebunnei2018-07-201-7/+16
|\ | | | | HLE/ACC: Change the default user id and small improvements to the way we handle profiles
| * HLE/ACC: Return an IProfile that is consistent with what was requested.Subv2018-07-191-5/+15
| | | | | | | | | | The default username for now is "yuzu". We should eventually allow the creation of users in the emulator and have the ability to modify their parameters.
| * HLE/ACC: Change the default user id to be consistent with what we tell games on startup.Subv2018-07-191-2/+1
| | | | | | | | In IApplicationFunctions::PopLaunchParameter we tell the games that they were launched as user id 1.
* | Merge pull request #727 from Subv/acc_usersbunnei2018-07-201-4/+6
|\ \ | | | | | | HLE/ACC: Write a single whole user id in ListAllUsers and ListOpenUsers.
| * | HLE/ACC: Write a single whole user id in ListAllUsers and ListOpenUsers.Subv2018-07-191-4/+6
| |/ | | | | | | We only emulate a single user id for now.
* / hle/service: Make constructors explicit where applicableLioncash2018-07-191-1/+1
|/ | | | | Prevents implicit construction and makes these lingering non-explicit constructors consistent with the rest of the other classes in services.
* Rename logging macro back to LOG_*James Rowe2018-07-031-10/+10
|
* acc: Move logging macros over to new fmt-compatible onesLioncash2018-04-241-10/+10
|
* service: Use nested namespace specifiers where applicableLioncash2018-04-209-36/+18
| | | | Tidies up namespace declarations
* Various service name fixes - part 2 (rebased) (#322)Hexagon122018-04-171-0/+8
| | | | | | | | | | | | | | | | * Updated ACC with more service names * Updated SVC with more service names * Updated set with more service names * Updated sockets with more service names * Updated SPL with more service names * Updated time with more service names * Updated vi with more service names
* Service/ACC: convert to module, add acc:aa, acc:su, acc:u1 servicesmailwl2018-04-1010-127/+336
|
* acc_u0: Stub ListOpenUsers service function.bunnei2018-02-192-1/+11
|
* service: Remove remaining uses of BufferDescriptor*.bunnei2018-02-141-2/+1
|
* acc_u0: Implement ListAllUsers.bunnei2018-02-092-2/+15
|
* logger: Add "account" service logging category.bunnei2018-02-041-8/+8
|
* acc_u0: Stub out GetLastOpenedUser.bunnei2018-02-042-0/+10
|
* acc:u0 : stub GetAccountIdmailwl2018-02-041-1/+9
|
* hle: Rename RequestBuilder to ResponseBuilder.bunnei2018-01-251-6/+6
|
* service: Fix all incorrect IPC response headers.bunnei2018-01-251-2/+2
|
* acc, set, applet_oe: stub various functions, add set service (#105)goaaats2018-01-192-0/+76
| | | | | | | | | | | | | | * Stubs for various acc:u0 funcs needed * Stub for GetDesiredLanguage in IApplicationFunctions * Add set service + stubs needed for games * Fix formatting * Implement IProfile, IManagerForApplication, return bool in CheckAvailability, style fixes * Remove IProfile::Get(needs more research), fix IPC response sizes
* acc_u0: Add IPC interface and stub InitializeApplicationInfo.bunnei2018-01-174-0/+80