///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018 Statoil ASA // // ResInsight 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) any later version. // // ResInsight 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 at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RicHoloLensSessionObserver.h" #include "RicHoloLensRestClient.h" #include "VdePacketDirectory.h" #include "VdeCachingHashedIdFactory.h" #include #include #include class RimGridView; //================================================================================================== // // // //================================================================================================== class RicHoloLensSession : public QObject, private RicHoloLensRestResponseHandler { public: ~RicHoloLensSession(); static RicHoloLensSession* createSession(const QString& serverUrl, const QString& sessionName, const QByteArray& sessionPinCode, RicHoloLensSessionObserver* sessionObserver); static RicHoloLensSession* createDummyFileBackedSession(); void destroySession(); bool isSessionValid() const; void updateSessionDataFromView(const RimGridView& activeView); private: RicHoloLensSession(); virtual void handleSuccessfulCreateSession() override; virtual void handleFailedCreateSession() override; virtual void handleSuccessfulSendMetaData(int metaDataSequenceNumber, const QByteArray& jsonServerResponseString) override; virtual void handleError(const QString& errMsg, const QString& url, const QString& serverData) override; static bool parseJsonIntegerArray(const QByteArray& jsonString, std::vector* integerArr); void notifyObserver(RicHoloLensSessionObserver::Notification notification); private: bool m_isSessionValid; QPointer m_restClient; int m_lastExtractionMetaDataSequenceNumber; std::vector m_lastExtractionAllReferencedPacketIdsArr; VdeCachingHashedIdFactory m_cachingIdFactory; VdePacketDirectory m_packetDirectory; RicHoloLensSessionObserver* m_sessionObserver; bool m_dbgEnableFileExport; };