overte-HifiExperiments/assignment-client/src/AssignmentClientMonitor.h
2015-02-23 11:12:19 -08:00

44 lines
1.1 KiB
C++

//
// AssignmentClientMonitor.h
// assignment-client/src
//
// Created by Stephen Birarda on 1/10/2014.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_AssignmentClientMonitor_h
#define hifi_AssignmentClientMonitor_h
#include <QtCore/QCoreApplication>
#include <QtCore/qpointer.h>
#include <QtCore/QProcess>
#include <QtCore/QDateTime>
#include <Assignment.h>
#include "AssignmentClientChildData.h"
extern const char* NUM_FORKS_PARAMETER;
class AssignmentClientMonitor : public QCoreApplication {
Q_OBJECT
public:
AssignmentClientMonitor(int &argc, char **argv, const unsigned int numAssignmentClientForks);
~AssignmentClientMonitor();
void stopChildProcesses();
private slots:
void readPendingDatagrams();
void checkSpares();
private:
void spawnChildClient();
QStringList _childArguments;
QTimer _checkSparesTimer; // every few seconds see if it need fewer or more spare children
};
#endif // hifi_AssignmentClientMonitor_h