Files
cpp-implementations/subscriber-notifs/include/app/inventory_manager.hpp
2026-01-11 23:10:47 +00:00

20 lines
506 B
C++

#pragma once
#include <string>
#include <unordered_map>
#include "core/subscribable.hpp"
using ProductCount = int;
using ProductId = std::string;
// inventory manager is not generic ( works with the specific types ProductId
// and ProductCount ) but the subscribable is generic
class InventoryManager : public Subscribable<ProductId, ProductCount> {
private:
std::unordered_map<ProductId, int> inventory_;
public:
void setInventory(const ProductId& productId, ProductCount quantity);
};