std::string_view 的使用
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include <string_view>
|
||||
|
||||
#include "Core/Base/global_include.h"
|
||||
#include "Core/socket/ByteOrder.h"
|
||||
@@ -10,7 +11,7 @@
|
||||
|
||||
class WebSocket_Manager {
|
||||
public:
|
||||
explicit WebSocket_Manager(std::string path);
|
||||
explicit WebSocket_Manager(std::string_view path);
|
||||
~WebSocket_Manager() = default;
|
||||
void remove(const drogon::WebSocketConnectionPtr &conn);
|
||||
void add(const drogon::WebSocketConnectionPtr &conn);
|
||||
@@ -26,8 +27,8 @@ protected:
|
||||
|
||||
class Ws_Mgr : public Psc::Singleton<Ws_Mgr> {
|
||||
public:
|
||||
std::shared_ptr<WebSocket_Manager> register_ws(std::string path);
|
||||
std::shared_ptr<WebSocket_Manager> get_ws(std::string path);
|
||||
std::shared_ptr<WebSocket_Manager> register_ws(std::string_view path);
|
||||
std::shared_ptr<WebSocket_Manager> get_ws(std::string_view path);
|
||||
std::map<std::string, std::shared_ptr<WebSocket_Manager>> map;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user