Commit 65e55c50 authored by Lefebvre, Jordan's avatar Lefebvre, Jordan
Browse files

#1. Starting rsmpbs subpackage and class.

parent a57b7b84
Pipeline #94043 failed with stages
in 4 minutes and 49 seconds
......@@ -12,6 +12,7 @@ IF (NOT TRIBITS_PROCESSING_PACKAGE)
PROJECT(${PROJECT_NAME} NONE)
# enable C++11 by default
SET(rsm_ENABLE_CXX11 ON CACHE BOOL "Compile using the C++11 standard" FORCE)
SET(rsm_ENABLE_Fortran OFF CACHE BOOL "Enable Fortran language" FORCE)
SET(USE_QT5 TRUE)
# disable generating HTML dependencies webpage and xml files
......
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS
core rsmcore SS OPTIONAL
pbs rsmpbs SS OPTIONAL
widgets rsmwidgets SS OPTIONAL
)
......@@ -40,8 +40,8 @@ class SessionControllerImpl
} // SessionControllerImpl destructor
}; // class SessionControllerImpl
SessionController::SessionController(QObject* parent)
: QObject(parent)
SessionController::SessionController()
: QObject(nullptr)
{
qRegisterMetaType<SessionVerbosity>("SessionVerbosity");
p = new SessionControllerImpl();
......@@ -172,4 +172,4 @@ void SessionController::requestExec(QString command)
emit requestExecRequested(command);
}
} // namespace rsm
\ No newline at end of file
} // namespace rsm
......@@ -10,6 +10,11 @@ namespace rsm
{
/** Forward declaration of private implementation */
class SessionControllerImpl;
/**
* @brief The SessionController class
* Non-blocking session controller
*/
class RSM_PUBLIC SessionController : public QObject
{
Q_OBJECT
......@@ -18,7 +23,8 @@ class RSM_PUBLIC SessionController : public QObject
SessionControllerImpl* p;
public:
SessionController(QObject* parent = nullptr);
typedef std::shared_ptr<SessionController> SP;
SessionController();
~SessionController();
QByteArray readExecOutput();
......
TRIBITS_SUBPACKAGE(pbs)
SET(HEADERS
pbssession.hh
)
SET(SOURCES
pbssession.cc
)
QT5_WRAP_CPP(MOC_FILES
${HEADERS}
)
SET(HEADERS
${HEADERS}
)
TRIBITS_ADD_LIBRARY(rsmpbs
SOURCES ${SOURCES} ${MOC_FILES}
NOINSTALLHEADERS ${HEADERS}
)
#
# Add testing directory
#TRIBITS_ADD_TEST_DIRECTORIES(tests)
INSTALL(FILES ${HEADERS} DESTINATION "include/rsmpbs/")
TRIBITS_SUBPACKAGE_POSTPROCESS()
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
LIB_REQUIRED_PACKAGES rsmcore radixcore radixbug
LIB_OPTIONAL_PACKAGES
TEST_REQUIRED_PACKAGES testframework
TEST_OPTIONAL_PACKAGES
LIB_REQUIRED_TPLS Qt5Core LibSSH OpenSSL
LIB_OPTIONAL_TPLS
TEST_REQUIRED_TPLS
TEST_OPTIONAL_TPLS
)
#include "rsmpbs/pbssession.hh"
namespace rsm
{
class PBSSessionImpl
{
public:
};
PBSSession::PBSSession()
: SessionController()
{
p = new PBSSessionImpl();
}
PBSSession::~PBSSession()
{
if (p != nullptr)
{
delete p;
}
}
} // namespace rsm
#ifndef RSMPBS_PBSSESSION_HH_
#define RMSPBS_PBSSESSION_HH_
#include <QObject>
#include "rsmcore/sessioncontroller.hh"
namespace rsm
{
/** forward declaration of private implementation */
class PBSSessionImpl;
class PBSSession : public SessionController
{
Q_OBJECT
PBSSessionImpl* p = nullptr;
public:
PBSSession();
~PBSSession();
};
} // namespace rsm
#endif /* RMSPBS_PBSSESSION_HH_ */
......@@ -54,38 +54,39 @@ ExamplePortalWidget::ExamplePortalWidget(QWidget *parent)
connect(mCommandSubmitButton, &QPushButton::pressed, this,
&ExamplePortalWidget::submitCommandToHost);
mSession = new SessionController();
connect(mSession, &SessionController::connectionFailed, this,
mSession = std::make_shared<SessionController>();
connect(mSession.get(), &SessionController::connectionFailed, this,
&ExamplePortalWidget::connectionFailed);
connect(mSession, &SessionController::connectionSuccessful, this,
connect(mSession.get(), &SessionController::connectionSuccessful, this,
&ExamplePortalWidget::connectionSuccessful);
connect(mSession, &SessionController::disconnectSuccessful, this,
connect(mSession.get(), &SessionController::disconnectSuccessful, this,
&ExamplePortalWidget::disconnectSuccessful);
connect(mSession, &SessionController::interactiveAuthenticationRequested,
this, &ExamplePortalWidget::interactiveAuthenticationRequested);
connect(mSession, &SessionController::getServerPublicKeyFailed, this,
connect(mSession.get(),
&SessionController::interactiveAuthenticationRequested, this,
&ExamplePortalWidget::interactiveAuthenticationRequested);
connect(mSession.get(), &SessionController::getServerPublicKeyFailed, this,
&ExamplePortalWidget::getServerPublicKeyFailed);
connect(mSession, &SessionController::hostUnknown, this,
connect(mSession.get(), &SessionController::hostUnknown, this,
&ExamplePortalWidget::hostUnknown);
connect(mSession, &SessionController::hostPublicKeyChanged, this,
connect(mSession.get(), &SessionController::hostPublicKeyChanged, this,
&ExamplePortalWidget::hostPublicKeyChanged);
connect(mSession, &SessionController::verifyKnownHostSuccessful, this,
connect(mSession.get(), &SessionController::verifyKnownHostSuccessful, this,
&ExamplePortalWidget::verifyKnownHostSuccessful);
connect(mSession, &SessionController::knownHostError, this,
connect(mSession.get(), &SessionController::knownHostError, this,
&ExamplePortalWidget::knownHostError);
connect(mSession, &SessionController::authenticationError, this,
connect(mSession.get(), &SessionController::authenticationError, this,
&ExamplePortalWidget::authenticationError);
connect(mSession, &SessionController::authenticationSucceeded, this,
connect(mSession.get(), &SessionController::authenticationSucceeded, this,
&ExamplePortalWidget::authenticationSucceeded);
connect(mSession, &SessionController::passwordRequested, this,
connect(mSession.get(), &SessionController::passwordRequested, this,
&ExamplePortalWidget::passwordRequested);
connect(mSession, &SessionController::loginBannerIssued, this,
connect(mSession.get(), &SessionController::loginBannerIssued, this,
&ExamplePortalWidget::loginBannerIssued);
connect(mSession, &SessionController::execOutputReady, this,
connect(mSession.get(), &SessionController::execOutputReady, this,
&ExamplePortalWidget::execOutputReady);
connect(mSession, &SessionController::execFailed, this,
connect(mSession.get(), &SessionController::execFailed, this,
&ExamplePortalWidget::execFailed);
connect(mSession, &SessionController::execFinished, this,
connect(mSession.get(), &SessionController::execFinished, this,
&ExamplePortalWidget::execFinished);
}
......
......@@ -10,6 +10,8 @@
#include "rsmcore/sessioncontroller.hh"
#include <memory>
namespace Ui
{
class MainWindow;
......@@ -27,7 +29,7 @@ class ExamplePortalWidget : public QWidget
QLineEdit *mCommandEdit;
QPushButton *mCommandSubmitButton;
QTextEdit *mTextEdit;
rsm::SessionController *mSession;
rsm::SessionController::SP mSession;
public:
ExamplePortalWidget(QWidget *parent = nullptr);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment