2025-05-31 03:57:32 +00:00
|
|
|
|
#pragma once
|
2025-06-14 06:29:43 +00:00
|
|
|
|
#include "componentbasic.h"
|
|
|
|
|
#include <route_access.h>
|
|
|
|
|
#include <QHash>
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ·<><C2B7><EFBFBD><EFBFBD>Դ
|
|
|
|
|
/// </summary>
|
|
|
|
|
struct RouteResource {
|
|
|
|
|
QList<LonLatPos> _route_points;
|
|
|
|
|
|
|
|
|
|
RouteResource& operator=(const RouteResource& other);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ƽ<><C6BD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
/// </summary>
|
2025-06-22 02:05:31 +00:00
|
|
|
|
class COMPONENTBASIC_EXPORT PlainRouteManagePlugin : public ProcList<
|
2025-06-14 06:29:43 +00:00
|
|
|
|
WsRespond<NewPlainRoute, RespondDefault>,
|
|
|
|
|
WsRespond<RemovePlainRoute, RespondDefault>,
|
|
|
|
|
WsRespond<PlainRouteReset, RespondDefault>,
|
|
|
|
|
WsRespond<PlainRouteQuery, PlainRouteInfo>
|
|
|
|
|
> {
|
|
|
|
|
private:
|
|
|
|
|
std::weak_ptr<WsEntity> _bind_entity;
|
|
|
|
|
QHash<QString, RouteResource> _route_resource_map;
|
|
|
|
|
|
|
|
|
|
public:
|
2025-06-22 02:05:31 +00:00
|
|
|
|
PlainRouteManagePlugin();
|
2025-06-14 06:29:43 +00:00
|
|
|
|
|
|
|
|
|
// ͨ<><CDA8> ProcList <20>̳<EFBFBD>
|
|
|
|
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const NewPlainRoute> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
|
|
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const RemovePlainRoute> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
|
|
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const PlainRouteReset> in, QList<std::shared_ptr<RespondDefault>>& out) override;
|
|
|
|
|
void execute(std::shared_ptr<Immediate> map, std::shared_ptr<const PlainRouteQuery> in, QList<std::shared_ptr<PlainRouteInfo>>& out) override;
|
|
|
|
|
|
|
|
|
|
void recoveryFrom(const QJsonObject& obj) override;
|
|
|
|
|
void saveTo(QJsonObject& obj) const override;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<WsComponent> defaultNew() const override;
|
|
|
|
|
void bindEntity(std::weak_ptr<WsEntity> host) override;
|
|
|
|
|
QString name() const override;
|
2025-05-31 03:57:32 +00:00
|
|
|
|
};
|
|
|
|
|
|