freebsdbackend.h 1.26 KB
Newer Older
David Redondo's avatar
David Redondo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
/*
    Copyright (c) 2020 David Redondo <kde@david-redondo.de>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 3 of
    the license or (at your option) at any later version that is
    accepted by the membership of KDE e.V. (or its successor
    approved by the membership of KDE e.V.), which shall act as a
    proxy as defined in Section 14 of version 3 of the license.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
*/

#ifndef FREEBSDBACKEND_H
#define FREEBSDBACKEND_H

#include "backend.h"

#include <QVector>

#include <kvm.h> // can't forward declare typedefed kvm_t

class SensorProperty;

class FreeBsdMemoryBackend : public MemoryBackend {
public:
    FreeBsdMemoryBackend(SensorContainer *container);
    void update() override;
private:
    void makeSensors() override;
    unsigned long long pagesToBytes(uint32_t pages);

    unsigned int m_pageSize;
    kvm_t *m_kd;
    QVector<SensorProperty*> m_sysctlSensors;
};

#endif