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_IMANAGER_H_
17 #define WRTDEVICEAPIS_CPU_IMANAGER_H_
20 #include <dpl/noncopyable.h>
21 #include <Cpu/IUnit.h>
23 namespace WrtDeviceApis {
27 class IManager : private DPL::Noncopyable
30 static IManager& getInstance();
33 virtual ~IManager() = 0;
36 * Gets interface to CPU.
37 * @param index Index of CPU to get (1-based).
38 * @return Interface to CPU.
39 * @throw PlatformException If platform error occurs.
40 * @throw OutOfRangeException If index is greater than available CPUs.
41 * @remarks On some platforms passing 0 as index may return unit object
42 * that gives avarage data for all CPUs. If such interface is
43 * not supported then NULL is returned.
44 * @remarks Ownership is NOT passed to the caller.
46 virtual IUnit* getUnit(std::size_t index) const = 0;
49 * Gets number of available CPUs.
50 * @return Number of CPUs.
52 virtual std::size_t getUnitsCount() const = 0;
59 #endif // WRTDEVICEAPIS_CPU_IMANAGER_H_