Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Helper class to remove outdated telegram files in a directory
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-09-26
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
|
||||
class QThread;
|
||||
class XDR_Wrapper_it;
|
||||
namespace TetraRadio
|
||||
{
|
||||
class DirectoryCleanerWorker;
|
||||
class DirectoryCleaner : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DirectoryCleaner(const QString &directory, unsigned int maxAgeSec, QObject *parent = nullptr);
|
||||
~DirectoryCleaner();
|
||||
private:
|
||||
// remove xdr telegrams which are regenerated on startup (e.g. AES telegrams)
|
||||
// and therefore must not be reread on startup
|
||||
void doInitialCleanup(const QString &directory);
|
||||
bool teleShouldBeRemoved(int teleId);
|
||||
QThread *m_cleanerThread;
|
||||
DirectoryCleanerWorker *m_worker;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
class DirectoryCleanerWorker: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DirectoryCleanerWorker(const QString &directory, unsigned int maxAgeSec);
|
||||
~DirectoryCleanerWorker() = default;
|
||||
public Q_SLOTS:
|
||||
void onTimeout();
|
||||
private:
|
||||
void doCleanup();
|
||||
private:
|
||||
QString m_directory;
|
||||
qint64 m_maxAgeSec;
|
||||
bool m_bWarnedOnce;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
} // namespace TetraRadio
|
||||
Reference in new issue
Block a user