#pragma once

#include <mutex>
#include <string>
#include <unordered_map>

class PlacementLoadState {
private:
    std::unordered_map<std::string, bool> m_placementLoadState;
    std::mutex m_mutex;
public:
    void Set(const std::string& key, bool value) {
        std::lock_guard<std::mutex> lock(m_mutex);
        m_placementLoadState[key] = value;
    }
    bool Get(const std::string& key, bool defaultValue = false) {
        std::lock_guard<std::mutex> lock(m_mutex);
        auto it = m_placementLoadState.find(key);
        return (it != m_placementLoadState.end()) ? it->second : defaultValue;
    }
    bool Contains(const std::string& key) {
        std::lock_guard<std::mutex> lock(m_mutex);
        return m_placementLoadState.find(key) != m_placementLoadState.end();
    }
};
