/** * @RDE_HEADER@ * Data Plugin for InfrastructureManagement * $Id$ * $HeadURL$ * $Author$ * * Created by Mike Wille, SLSE, 2016-08-24 */ #pragma once #include #include #include #include namespace InfrastructureManagement { class ForeignInterfaceImpl final : public ForeignDataInterface { Q_OBJECT public: explicit ForeignInterfaceImpl(const std::shared_ptr &dtc, int exerciseId = -1); ~ForeignInterfaceImpl(); // lazy-initialisation: // is called at beginning of every access method void enableIsmForeignInterface() const; // mainStructureElements (buildings) //@{ bool mountingPoints(const std::function &cb) override final; bool mountingPoints(const std::function &cb) override final; QHash mountingPoints() const override final; MountingPoint mountingPoint(int32_t mountingPointId) const override final; //@} // mainSchedule //@{ MainSchedule mainSchedule(int32_t scheduleId) override final; void setScheduleId(int32_t scheduleId) override final; int32_t scheduleId() const override final; //@} // buildings in current exercise //@{ QSet buildingsInCurrentExercise() override final; const QSet& buildingsInCurrentExercise() const override final; bool isBuildingsInCurrentExercise(int buildingId) const override final; //@} private Q_SLOTS: void onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType); void onMountingPointAssetChanged(const InfrastructureManagement::MountingPointAsset &data, DataModification modType); void onMainScheduleChanged(const InfrastructureManagement::MainSchedule &data, DataModification modType); private: // methods void init(); private: // attributes std::shared_ptr m_dtc; QMutex m_mutex; QHash m_mountingPoints; // By SeId QHash m_mountingPointAssetMap; // key: structureElementId/mountingPointId - value: assetId QSet m_bldgsInExcersise; // All Buildings avaiable in this Exercise int32_t m_scheduleId; int32_t m_exerciseId{-1}; NGL::INGLLogger &m_logger; }; } // namespace InfrastructureManagement