chromium/third_party/webrtc/test/pc/e2e/analyzer/video/names_collection.h

/*
 *  Copyright (c) 2022 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef TEST_PC_E2E_ANALYZER_VIDEO_NAMES_COLLECTION_H_
#define TEST_PC_E2E_ANALYZER_VIDEO_NAMES_COLLECTION_H_

#include <map>
#include <set>
#include <string>
#include <vector>

#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "api/array_view.h"

namespace webrtc {

// Contains mapping between string names and unique size_t values (indexes).
// Once the name is added to the collection it is guaranteed:
//   1. Name will have the same index until collection will be destructed
//   2. Adding, removing and re-adding name won't change its index
//
// The name is considered in the collection if it was added and wasn't removed.
// Adding the name when it is in the collection won't change the collection, the
// same as removing the name when it is removed.
//
// Collection will return name's index and name for the index independently from
// was name removed or not. Once the name was added to the collection the index
// will be allocated for it. To check if name is in collection right now user
// has to explicitly call to `HasName` function.
class NamesCollection {};

}  // namespace webrtc

#endif  // TEST_PC_E2E_ANALYZER_VIDEO_NAMES_COLLECTION_H_