Skip to content
Snippets Groups Projects
DapServiceController.h 1.69 KiB
Newer Older
/****************************************************************************
**
Dmitriy A. Gerasimov's avatar
Dmitriy A. Gerasimov committed
** This file is part of the CellFrameDashboardService application.
** 
** The class implements the main application object CalvinDashboardService. 
** It involves the implementation of the interaction of all the components 
** of the service components. For example, identification of commands, 
** control of the authorization mechanism, management of an GUI client, etc.
**
****************************************************************************/

andrey.daragan's avatar
andrey.daragan committed
#ifndef DAPSERVICECONTROLLER_H
#define DAPSERVICECONTROLLER_H
andrey.daragan's avatar
andrey.daragan committed
#include "DapRpcLocalServer.h"
andrey.daragan's avatar
andrey.daragan committed
#include <QLocalServer>
typedef class DapRpcLocalServer DapUiService;

andrey.daragan's avatar
andrey.daragan committed

#include "Handlers/DapAbstractCommand.h"
#include "Handlers/DapAddWalletCommand.h"

Alexander's avatar
Alexander committed
/**
andrey.daragan's avatar
andrey.daragan committed
 * @brief The DapServiceController class
Alexander's avatar
Alexander committed
 * Service class which provide handle operations with dashboard.
 * Class is server which works clients. Protocol to communacate with client is RPC.
 * Work with serves start from public methos start().
 */
andrey.daragan's avatar
andrey.daragan committed
class DapServiceController : public QObject
andrey.daragan's avatar
andrey.daragan committed
    /// Service core.
    DapUiService    * m_pServer {nullptr};
  
andrey.daragan's avatar
andrey.daragan committed
    /// Standard constructor.
    /// @param parent Parent.
    explicit DapServiceController(QObject * parent = nullptr);
    /// Start service: creating server and socket.
    /// @return Returns true if the service starts successfully, otherwise false.
andrey.daragan's avatar
andrey.daragan committed
    bool start();
    
signals:
    /// The signal is emitted in case of successful connection of a new client.
    void onNewClientConnected();
andrey.daragan's avatar
andrey.daragan committed
    
private slots:
    /// Register command.
    void registerCommand();
andrey.daragan's avatar
andrey.daragan committed
#endif // DAPSERVICECONTROLLER_H