xref: /aosp_15_r20/external/mesa3d/src/tool/pps/pps_counter.cc (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2019-2020 Collabora, Ltd.
3  * Author: Antonio Caggiano <[email protected]>
4  * Author: Rohan Garg <[email protected]>
5  * Author: Robert Beckett <[email protected]>
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)19 Counter::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) const28 bool Counter::operator==(const Counter &other) const
29 {
30    return id == other.id;
31 }
32 
33 } // namespace pps
34