1 /* 2 * Copyright © 2019-2020 Collabora, Ltd. 3 * Author: Antonio Caggiano <antonio.caggiano@collabora.com> 4 * Author: Rohan Garg <rohan.garg@collabora.com> 5 * Author: Robert Beckett <bob.beckett@collabora.com> 6 * 7 * SPDX-License-Identifier: MIT 8 */ 9 10 #include "pps_counter.h" 11 12 #include <cassert> 13 #include <cstring> 14 15 #include "pps_algorithm.h" 16 17 namespace pps 18 { Counter(int32_t id,const std::string & name,int32_t group)19Counter::Counter(int32_t id, const std::string &name, int32_t group) 20 : id {id} 21 , name {name} 22 , group {group} 23 { 24 assert(id >= 0 && "Invalid counter ID"); 25 assert(group >= 0 && "Invalid group ID"); 26 } 27 operator ==(const Counter & other) const28bool Counter::operator==(const Counter &other) const 29 { 30 return id == other.id; 31 } 32 33 } // namespace pps 34