1e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//
2e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  Copyright (C) 2015 Google, Inc.
3e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//
4e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  Licensed under the Apache License, Version 2.0 (the "License");
5e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  you may not use this file except in compliance with the License.
6e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  You may obtain a copy of the License at:
7e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//
8e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  http://www.apache.org/licenses/LICENSE-2.0
9e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//
10e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  Unless required by applicable law or agreed to in writing, software
11e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  distributed under the License is distributed on an "AS IS" BASIS,
12e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  See the License for the specific language governing permissions and
14e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//  limitations under the License.
15e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski//
16e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski
17e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski#include <bluetooth/descriptor.h>
18e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski
19e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowskinamespace bluetooth {
20e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub PawlowskiDescriptor::Descriptor(const Descriptor& other) {
21e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  handle_ = other.handle_;
22e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  uuid_ = other.uuid_;
23e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  permissions_ = other.permissions_;
24e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski}
25e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski
26e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub PawlowskiDescriptor& Descriptor::operator=(const Descriptor& other) {
27e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  if (*this == other) return *this;
28e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski
29e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  handle_ = other.handle_;
30e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  uuid_ = other.uuid_;
31e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  permissions_ = other.permissions_;
32e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski
33e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  return *this;
34e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski}
35e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski
36e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowskibool Descriptor::Equals(const Descriptor& other) const {
37e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  return handle_ == other.handle_ && uuid_ == other.uuid_ &&
38e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski         permissions_ == other.permissions_;
39e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski}
40e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski
41e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowskibool Descriptor::operator==(const Descriptor& rhs) const { return Equals(rhs); }
42e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski
43e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowskibool Descriptor::operator!=(const Descriptor& rhs) const {
44e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski  return !Equals(rhs);
45e39e5ae5527fcee25cb17cea70c8ebf9d331678eJakub Pawlowski}
46d19e0785e662e640191a075eda07acce61c2aedaMarie Janssen}
47