mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:00:05 +00:00
Add timeline manager
This commit is contained in:
parent
5453997208
commit
81eb3b1af3
3 changed files with 81 additions and 0 deletions
|
|
@ -65,12 +65,14 @@ set(HDR_MANAGER source/scwx/qt/manager/radar_product_manager.hpp
|
||||||
source/scwx/qt/manager/resource_manager.hpp
|
source/scwx/qt/manager/resource_manager.hpp
|
||||||
source/scwx/qt/manager/settings_manager.hpp
|
source/scwx/qt/manager/settings_manager.hpp
|
||||||
source/scwx/qt/manager/text_event_manager.hpp
|
source/scwx/qt/manager/text_event_manager.hpp
|
||||||
|
source/scwx/qt/manager/timeline_manager.hpp
|
||||||
source/scwx/qt/manager/update_manager.hpp)
|
source/scwx/qt/manager/update_manager.hpp)
|
||||||
set(SRC_MANAGER source/scwx/qt/manager/radar_product_manager.cpp
|
set(SRC_MANAGER source/scwx/qt/manager/radar_product_manager.cpp
|
||||||
source/scwx/qt/manager/radar_product_manager_notifier.cpp
|
source/scwx/qt/manager/radar_product_manager_notifier.cpp
|
||||||
source/scwx/qt/manager/resource_manager.cpp
|
source/scwx/qt/manager/resource_manager.cpp
|
||||||
source/scwx/qt/manager/settings_manager.cpp
|
source/scwx/qt/manager/settings_manager.cpp
|
||||||
source/scwx/qt/manager/text_event_manager.cpp
|
source/scwx/qt/manager/text_event_manager.cpp
|
||||||
|
source/scwx/qt/manager/timeline_manager.cpp
|
||||||
source/scwx/qt/manager/update_manager.cpp)
|
source/scwx/qt/manager/update_manager.cpp)
|
||||||
set(HDR_MAP source/scwx/qt/map/alert_layer.hpp
|
set(HDR_MAP source/scwx/qt/map/alert_layer.hpp
|
||||||
source/scwx/qt/map/color_table_layer.hpp
|
source/scwx/qt/map/color_table_layer.hpp
|
||||||
|
|
|
||||||
48
scwx-qt/source/scwx/qt/manager/timeline_manager.cpp
Normal file
48
scwx-qt/source/scwx/qt/manager/timeline_manager.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
#include <scwx/qt/manager/timeline_manager.hpp>
|
||||||
|
#include <scwx/util/logger.hpp>
|
||||||
|
|
||||||
|
namespace scwx
|
||||||
|
{
|
||||||
|
namespace qt
|
||||||
|
{
|
||||||
|
namespace manager
|
||||||
|
{
|
||||||
|
|
||||||
|
static const std::string logPrefix_ = "scwx::qt::manager::timeline_manager";
|
||||||
|
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
|
||||||
|
|
||||||
|
class TimelineManager::Impl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit Impl(TimelineManager* self) : self_ {self} {}
|
||||||
|
|
||||||
|
~Impl() {}
|
||||||
|
|
||||||
|
TimelineManager* self_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TimelineManager::TimelineManager() : p(std::make_unique<Impl>(this)) {}
|
||||||
|
TimelineManager::~TimelineManager() = default;
|
||||||
|
|
||||||
|
std::shared_ptr<TimelineManager> TimelineManager::Instance()
|
||||||
|
{
|
||||||
|
static std::weak_ptr<TimelineManager> timelineManagerReference_ {};
|
||||||
|
static std::mutex instanceMutex_ {};
|
||||||
|
|
||||||
|
std::unique_lock lock(instanceMutex_);
|
||||||
|
|
||||||
|
std::shared_ptr<TimelineManager> timelineManager =
|
||||||
|
timelineManagerReference_.lock();
|
||||||
|
|
||||||
|
if (timelineManager == nullptr)
|
||||||
|
{
|
||||||
|
timelineManager = std::make_shared<TimelineManager>();
|
||||||
|
timelineManagerReference_ = timelineManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
return timelineManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace manager
|
||||||
|
} // namespace qt
|
||||||
|
} // namespace scwx
|
||||||
31
scwx-qt/source/scwx/qt/manager/timeline_manager.hpp
Normal file
31
scwx-qt/source/scwx/qt/manager/timeline_manager.hpp
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace scwx
|
||||||
|
{
|
||||||
|
namespace qt
|
||||||
|
{
|
||||||
|
namespace manager
|
||||||
|
{
|
||||||
|
|
||||||
|
class TimelineManager : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit TimelineManager();
|
||||||
|
~TimelineManager();
|
||||||
|
|
||||||
|
static std::shared_ptr<TimelineManager> Instance();
|
||||||
|
|
||||||
|
private:
|
||||||
|
class Impl;
|
||||||
|
std::unique_ptr<Impl> p;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace manager
|
||||||
|
} // namespace qt
|
||||||
|
} // namespace scwx
|
||||||
Loading…
Add table
Add a link
Reference in a new issue