11c1b0f19Sopenharmony_ci/*
21c1b0f19Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd.
31c1b0f19Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
41c1b0f19Sopenharmony_ci * you may not use this file except in compliance with the License.
51c1b0f19Sopenharmony_ci * You may obtain a copy of the License at
61c1b0f19Sopenharmony_ci *
71c1b0f19Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
81c1b0f19Sopenharmony_ci *
91c1b0f19Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
101c1b0f19Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
111c1b0f19Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121c1b0f19Sopenharmony_ci * See the License for the specific language governing permissions and
131c1b0f19Sopenharmony_ci * limitations under the License.
141c1b0f19Sopenharmony_ci */
151c1b0f19Sopenharmony_ci#ifndef OHOS_DCAMERA_INDEX_H
161c1b0f19Sopenharmony_ci#define OHOS_DCAMERA_INDEX_H
171c1b0f19Sopenharmony_ci
181c1b0f19Sopenharmony_ci#include <string>
191c1b0f19Sopenharmony_ci
201c1b0f19Sopenharmony_cinamespace OHOS {
211c1b0f19Sopenharmony_cinamespace DistributedHardware {
221c1b0f19Sopenharmony_ciclass DCameraIndex {
231c1b0f19Sopenharmony_cipublic:
241c1b0f19Sopenharmony_ci    DCameraIndex() = default;
251c1b0f19Sopenharmony_ci    explicit DCameraIndex(std::string devId, std::string dhId) : devId_(devId), dhId_(dhId) {}
261c1b0f19Sopenharmony_ci    ~DCameraIndex() = default;
271c1b0f19Sopenharmony_ci
281c1b0f19Sopenharmony_ci    bool operator == (const DCameraIndex& index) const
291c1b0f19Sopenharmony_ci    {
301c1b0f19Sopenharmony_ci        return this->devId_ == index.devId_ && this->dhId_ == index.dhId_;
311c1b0f19Sopenharmony_ci    }
321c1b0f19Sopenharmony_ci
331c1b0f19Sopenharmony_ci    bool operator < (const DCameraIndex& index) const
341c1b0f19Sopenharmony_ci    {
351c1b0f19Sopenharmony_ci        return (this->devId_ + this->dhId_) < (index.devId_ + index.dhId_);
361c1b0f19Sopenharmony_ci    }
371c1b0f19Sopenharmony_ci
381c1b0f19Sopenharmony_ci    std::string devId_;
391c1b0f19Sopenharmony_ci    std::string dhId_;
401c1b0f19Sopenharmony_ci};
411c1b0f19Sopenharmony_ci} // namespace DistributedHardware
421c1b0f19Sopenharmony_ci} // namespace OHOS
431c1b0f19Sopenharmony_ci#endif // OHOS_DCAMERA_INDEX_H
44