FZ: use type aliases for Data types

This commit is contained in:
yuyoyuppe 2020-12-28 19:54:23 +03:00 committed by Andrey Nekrasov
parent 9939779932
commit 3eff741da8
2 changed files with 6 additions and 5 deletions

View File

@ -11,6 +11,7 @@
#include <optional> #include <optional>
#include <vector> #include <vector>
#include <winnt.h> #include <winnt.h>
#include <lib/JsonHelpers.h>
namespace FancyZonesDataTypes namespace FancyZonesDataTypes
{ {
@ -41,13 +42,13 @@ public:
std::optional<FancyZonesDataTypes::CustomZoneSetData> FindCustomZoneSet(const std::wstring& guid) const; std::optional<FancyZonesDataTypes::CustomZoneSetData> FindCustomZoneSet(const std::wstring& guid) const;
inline const std::unordered_map<std::wstring, FancyZonesDataTypes::DeviceInfoData>& GetDeviceInfoMap() const inline const JSONHelpers::TDeviceInfoMap & GetDeviceInfoMap() const
{ {
std::scoped_lock lock{ dataLock }; std::scoped_lock lock{ dataLock };
return deviceInfoMap; return deviceInfoMap;
} }
inline const std::unordered_map<std::wstring, FancyZonesDataTypes::CustomZoneSetData>& GetCustomZoneSetsMap() const inline const JSONHelpers::TCustomZoneSetsMap & GetCustomZoneSetsMap() const
{ {
std::scoped_lock lock{ dataLock }; std::scoped_lock lock{ dataLock };
return customZoneSetsMap; return customZoneSetsMap;
@ -127,9 +128,9 @@ private:
// Maps app path to app's zone history data // Maps app path to app's zone history data
std::unordered_map<std::wstring, std::vector<FancyZonesDataTypes::AppZoneHistoryData>> appZoneHistoryMap{}; std::unordered_map<std::wstring, std::vector<FancyZonesDataTypes::AppZoneHistoryData>> appZoneHistoryMap{};
// Maps device unique ID to device data // Maps device unique ID to device data
std::unordered_map<std::wstring, FancyZonesDataTypes::DeviceInfoData> deviceInfoMap{}; JSONHelpers::TDeviceInfoMap deviceInfoMap{};
// Maps custom zoneset UUID to it's data // Maps custom zoneset UUID to it's data
std::unordered_map<std::wstring, FancyZonesDataTypes::CustomZoneSetData> customZoneSetsMap{}; JSONHelpers::TCustomZoneSetsMap customZoneSetsMap{};
std::wstring zonesSettingsFileName; std::wstring zonesSettingsFileName;
std::wstring appZoneHistoryFileName; std::wstring appZoneHistoryFileName;

View File

@ -487,7 +487,7 @@ namespace JSONHelpers
{ {
try try
{ {
std::unordered_map<std::wstring, FancyZonesDataTypes::DeviceInfoData> appliedZonesets; TDeviceInfoMap appliedZonesets;
auto zonesets = json.GetNamedArray(NonLocalizable::AppliedZonesets); auto zonesets = json.GetNamedArray(NonLocalizable::AppliedZonesets);
for (const auto& zoneset : zonesets) for (const auto& zoneset : zonesets)