[*] nuke unordered-dense, use boost::container::unordered_flat_{map,set}

Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie
2026-08-30 08:15:47 +00:00
parent e5b656e372
commit 9d5861e830
115 changed files with 350 additions and 347 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ public:
Common::Input::ButtonNames GetUIName(const Common::ParamPackage& params) const override;
private:
ankerl::unordered_dense::map<PadIdentifier, jobject> input_devices;
boost::container::unordered_flat_map<PadIdentifier, jobject> input_devices;
/// Returns the correct identifier corresponding to the player index
PadIdentifier GetIdentifier(const std::string& guid, size_t port) const;
+1 -1
View File
@@ -732,7 +732,7 @@ SDLDriver::~SDLDriver() {
std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const {
std::vector<Common::ParamPackage> devices;
ankerl::unordered_dense::map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
boost::container::unordered_flat_map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
for (const auto& [key, value] : joystick_map) {
for (const auto& joystick : value) {
if (!joystick->GetSDLJoystick()) {
+3 -2
View File
@@ -9,7 +9,8 @@
#include <atomic>
#include <mutex>
#include <thread>
#include <ankerl/unordered_dense.h>
#include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <SDL3/SDL.h>
@@ -117,7 +118,7 @@ private:
Common::SPSCQueue<VibrationRequest> vibration_queue;
/// Map of GUID of a list of corresponding virtual Joysticks
ankerl::unordered_dense::map<Common::UUID, std::vector<std::shared_ptr<SDLJoystick>>> joystick_map;
boost::container::unordered_flat_map<Common::UUID, std::vector<std::shared_ptr<SDLJoystick>>> joystick_map;
std::mutex joystick_map_mutex;
bool start_thread = false;
+7 -7
View File
@@ -8,7 +8,7 @@
#include <functional>
#include <mutex>
#include <ankerl/unordered_dense.h>
#include <boost/container/flat_map.hpp>
#include "common/common_types.h"
#include "common/input.h"
@@ -270,10 +270,10 @@ protected:
private:
struct ControllerData {
ankerl::unordered_dense::map<int, bool> buttons;
ankerl::unordered_dense::map<int, u8> hat_buttons;
ankerl::unordered_dense::map<int, float> axes;
ankerl::unordered_dense::map<int, BasicMotion> motions;
boost::container::flat_map<int, bool> buttons;
boost::container::flat_map<int, u8> hat_buttons;
boost::container::flat_map<int, float> axes;
boost::container::flat_map<int, BasicMotion> motions;
Common::Input::BatteryLevel battery{};
Common::Input::BodyColorStatus color{};
Common::Input::CameraStatus camera{};
@@ -301,8 +301,8 @@ private:
bool configuring{false};
const std::string input_engine;
int last_callback_key = 0;
ankerl::unordered_dense::map<PadIdentifier, ControllerData> controller_list;
ankerl::unordered_dense::map<int, InputIdentifier> callback_list;
boost::container::unordered_flat_map<PadIdentifier, ControllerData> controller_list;
boost::container::unordered_flat_map<int, InputIdentifier> callback_list;
MappingCallback mapping_callback;
};
+5 -4
View File
@@ -8,7 +8,8 @@
#include <memory>
#include <string>
#include <ankerl/unordered_dense.h>
#include <boost/unordered/unordered_flat_map.hpp>
#include <boost/unordered/unordered_flat_set.hpp>
#include <vector>
namespace Common {
@@ -56,9 +57,9 @@ enum class InputType { None, Button, Stick, Motion, Touch };
* Given a ParamPackage for a Device returned from `GetInputDevices`, attempt to get the default
* mapping for the device.
*/
using AnalogMapping = ankerl::unordered_dense::map<Settings::NativeAnalog::Values, Common::ParamPackage>;
using ButtonMapping = ankerl::unordered_dense::map<Settings::NativeButton::Values, Common::ParamPackage>;
using MotionMapping = ankerl::unordered_dense::map<Settings::NativeMotion::Values, Common::ParamPackage>;
using AnalogMapping = boost::container::unordered_flat_map<Settings::NativeAnalog::Values, Common::ParamPackage>;
using ButtonMapping = boost::container::unordered_flat_map<Settings::NativeButton::Values, Common::ParamPackage>;
using MotionMapping = boost::container::unordered_flat_map<Settings::NativeMotion::Values, Common::ParamPackage>;
class InputSubsystem {
public: