Solid

frontend/processor.h
1/*
2 SPDX-FileCopyrightText: 2006-2007 Kevin Ottens <ervin@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef SOLID_PROCESSOR_H
8#define SOLID_PROCESSOR_H
9
10#include <solid/solid_export.h>
11
12#include <solid/deviceinterface.h>
13
14namespace Solid
15{
16class ProcessorPrivate;
17class Device;
18
19/**
20 * @class Solid::Processor processor.h <Solid/Processor>
21 *
22 * This device interface is available on processors.
23 */
24class SOLID_EXPORT Processor : public DeviceInterface
25{
26 Q_OBJECT
27 Q_PROPERTY(int number READ number)
28 Q_PROPERTY(qulonglong maxSpeed READ maxSpeed)
29 Q_PROPERTY(bool canChangeFrequency READ canChangeFrequency)
30 Q_PROPERTY(InstructionSets instructionSets READ instructionSets)
31 Q_DECLARE_PRIVATE(Processor)
32 friend class Device;
33
34private:
35 /**
36 * Creates a new Processor object.
37 * You generally won't need this. It's created when necessary using
38 * Device::as().
39 *
40 * @param backendObject the device interface object provided by the backend
41 * @see Solid::Device::as()
42 */
43 SOLID_NO_EXPORT explicit Processor(QObject *backendObject);
44
45public:
46 /**
47 * This enum contains the list of architecture extensions you
48 * can query.
49 *
50 * @see InstructionSets
51 */
53 NoExtensions = 0x0,
54 IntelMmx = 0x1,
55 IntelSse = 0x2,
56 IntelSse2 = 0x4,
57 IntelSse3 = 0x8,
58 IntelSsse3 = 0x80,
59 IntelSse4 = 0x10,
60 IntelSse41 = 0x10,
61 IntelSse42 = 0x100,
62 Amd3DNow = 0x20,
63 AltiVec = 0x40,
64 };
65 Q_ENUM(InstructionSet)
66
67 /*
68 * Stores a combination of #InstructionSet values.
69 */
70 Q_DECLARE_FLAGS(InstructionSets, InstructionSet)
71 Q_FLAG(InstructionSets)
72
73 /**
74 * Destroys a Processor object.
75 */
76 ~Processor() override;
77
78 /**
79 * Get the Solid::DeviceInterface::Type of the Processor device interface.
80 *
81 * @return the Processor device interface type
82 * @see Solid::Ifaces::Enums::DeviceInterface::Type
83 */
85 {
86 return DeviceInterface::Processor;
87 }
88
89 /**
90 * Retrieves the processor number in the system.
91 *
92 * @return the internal processor number in the system, starting from zero
93 */
94 int number() const;
95
96 /**
97 * Retrieves the maximum speed of the processor.
98 *
99 * @return the maximum speed in MHz, or 0 if the device can't be queried for this
100 * information.
101 */
102 int maxSpeed() const;
103
104 /**
105 * Indicates if the processor can change the CPU frequency.
106 *
107 * True if a processor is able to change its own CPU frequency.
108 * (generally for power management).
109 *
110 * @return true if the processor can change CPU frequency, false otherwise
111 */
112 bool canChangeFrequency() const;
113
114 /**
115 * Queries the instructions set extensions of the CPU.
116 *
117 * @return the extensions supported by the CPU
118 * @see Solid::Processor::InstructionSet
119 */
120 InstructionSets instructionSets() const;
121};
122
123Q_DECLARE_OPERATORS_FOR_FLAGS(Processor::InstructionSets)
124
125}
126
127#endif
Base class of all the device interfaces.
Type
This enum type defines the type of device interface that a Device can have.
This class allows applications to deal with devices available in the underlying system.
This device interface is available on processors.
InstructionSet
This enum contains the list of architecture extensions you can query.
static Type deviceInterfaceType()
Get the Solid::DeviceInterface::Type of the Processor device interface.
The single responsibility of this class is to create arguments valid for logind Inhibit call.
Definition fakebattery.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:56:28 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.