File indexing completed on 2024-05-12 04:01:52

0001 /*
0002     SPDX-FileCopyrightText: 2006 Kevin Ottens <ervin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef SOLID_IFACES_PROCESSOR_H
0008 #define SOLID_IFACES_PROCESSOR_H
0009 
0010 #include <solid/devices/ifaces/deviceinterface.h>
0011 #include <solid/processor.h>
0012 
0013 namespace Solid
0014 {
0015 namespace Ifaces
0016 {
0017 /**
0018  * This device interface is available on processors.
0019  */
0020 class Processor : virtual public DeviceInterface
0021 {
0022 public:
0023     /**
0024      * Destroys a Processor object.
0025      */
0026     ~Processor() override;
0027 
0028     /**
0029      * Retrieves the processor number in the system.
0030      *
0031      * @return the internal processor number in the system, starting from zero
0032      */
0033     virtual int number() const = 0;
0034 
0035     /**
0036      * Retrieves the maximum speed of the processor.
0037      *
0038      * @return the maximum speed in MHz
0039      */
0040     virtual int maxSpeed() const = 0;
0041 
0042     /**
0043      * Indicates if the processor can change the CPU frequency.
0044      *
0045      * True if a processor is able to change its own CPU frequency.
0046      *  (generally for power management).
0047      *
0048      * @return true if the processor can change CPU frequency, false otherwise
0049      */
0050     virtual bool canChangeFrequency() const = 0;
0051 
0052     /**
0053      * Queries the instructions set extensions of the CPU.
0054      *
0055      * @return the extensions supported by the CPU
0056      */
0057     virtual Solid::Processor::InstructionSets instructionSets() const = 0;
0058 };
0059 }
0060 }
0061 
0062 Q_DECLARE_INTERFACE(Solid::Ifaces::Processor, "org.kde.Solid.Ifaces.Processor/0.1")
0063 
0064 #endif