#ifndef CHROME_BROWSER_APPS_BROWSER_INSTANCE_BROWSER_APP_INSTANCE_MAP_H_
#define CHROME_BROWSER_APPS_BROWSER_INSTANCE_BROWSER_APP_INSTANCE_MAP_H_
#include <map>
#include <memory>
#include <set>
#include <utility>
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/ranges/algorithm.h"
namespace apps {
BrowserAppInstanceMap;
template <typename KeyT, typename ValueT>
ValueT& AddInstance(BrowserAppInstanceMap<KeyT, ValueT>& instances,
const KeyT& key,
std::unique_ptr<ValueT> instance) { … }
template <typename KeyT, typename ValueT>
std::unique_ptr<ValueT> PopInstanceIfExists(
BrowserAppInstanceMap<KeyT, ValueT>& instances,
const KeyT& key) { … }
template <typename KeyT, typename ValueT>
ValueT* GetInstance(const BrowserAppInstanceMap<KeyT, ValueT>& instances,
const KeyT& key) { … }
template <typename KeyT, typename ValueT, typename PredicateT>
void SelectInstances(std::set<const ValueT*>& result,
const BrowserAppInstanceMap<KeyT, ValueT>& instances,
PredicateT predicate) { … }
template <typename KeyT, typename ValueT, typename PredicateT>
const ValueT* FindInstanceIf(
const BrowserAppInstanceMap<KeyT, ValueT>& instances,
PredicateT predicate) { … }
}
#endif