2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef WRTDEVICEAPIS_CPU_UNIT_H_
17 #define WRTDEVICEAPIS_CPU_UNIT_H_
20 #include <Cpu/IUnit.h>
22 namespace WrtDeviceApis {
27 class Unit : public Api::IUnit
32 unsigned int getUtilizationPercent() const;
36 * Stores processor utilization statistics.
38 struct UtilizationStats
42 unsigned int m_system;
47 explicit Unit(std::size_t index);
50 * Gets processor utilization statistics.
51 * @return Processor utilization statistics.
52 * @throw UnsupportedException If data could not be retrieved.
54 UtilizationStats getUtilization() const;
57 std::size_t m_index; ///< Index of CPU interface to represent.
60 * Regex pattern used to get processor utilization statistics from
63 std::string m_utilizationPattern;
69 #endif // WRTDEVICEAPIS_CPU_UNIT_H_