CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
carta::SessionManager Class Reference

#include <SessionManager.h>

Collaboration diagram for carta::SessionManager:
[legend]

Public Types

using WSType = uWS::WebSocket< false, true, PerSocketData >
 

Public Member Functions

 SessionManager (ProgramSettings &settings, std::string auth_token, std::shared_ptr< FileListHandler >)
 
void DeleteSession (uint32_t session_id)
 
void OnUpgrade (uWS::HttpResponse< false > *http_response, uWS::HttpRequest *http_request, struct us_socket_context_t *context)
 
void OnConnect (WSType *ws)
 
void OnDisconnect (WSType *ws, int code, std::string_view message)
 
void OnDrain (WSType *ws)
 
void OnMessage (WSType *ws, std::string_view sv_message, uWS::OpCode op_code)
 
void Listen (std::string host, std::vector< int > ports, int default_port, int &port)
 
uWS::App & App ()
 
void RunApp ()
 
bool SendScriptingRequest (int &session_id, uint32_t &scripting_request_id, std::string &target, std::string &action, std::string &parameters, bool &async, std::string &return_path, ScriptingResponseCallback callback, ScriptingSessionClosedCallback session_closed_callback)
 
void OnScriptingAbort (int session_id, uint32_t scripting_request_id)
 

Private Member Functions

std::string IPAsText (std::string_view binary)
 

Private Attributes

uint32_t _session_number
 
std::unordered_map< uint32_t, Session * > _sessions
 
std::mutex _sessions_mutex
 
uWS::App _app
 
ProgramSettings_settings
 
std::string _auth_token
 
std::shared_ptr< FileListHandler_file_list_handler
 

Member Typedef Documentation

◆ WSType

using carta::SessionManager::WSType = uWS::WebSocket<false, true, PerSocketData>

Constructor & Destructor Documentation

◆ SessionManager()

carta::SessionManager::SessionManager ( ProgramSettings settings,
std::string  auth_token,
std::shared_ptr< FileListHandler file_list_handler 
)

Member Function Documentation

◆ App()

uWS::App & carta::SessionManager::App ( )

◆ DeleteSession()

void carta::SessionManager::DeleteSession ( uint32_t  session_id)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IPAsText()

std::string carta::SessionManager::IPAsText ( std::string_view  binary)
private
Here is the caller graph for this function:

◆ Listen()

void carta::SessionManager::Listen ( std::string  host,
std::vector< int >  ports,
int  default_port,
int &  port 
)

◆ OnConnect()

void carta::SessionManager::OnConnect ( WSType ws)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDisconnect()

void carta::SessionManager::OnDisconnect ( WSType ws,
int  code,
std::string_view  message 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDrain()

void carta::SessionManager::OnDrain ( WSType ws)
Here is the caller graph for this function:

◆ OnMessage()

void carta::SessionManager::OnMessage ( WSType ws,
std::string_view  sv_message,
uWS::OpCode  op_code 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnScriptingAbort()

void carta::SessionManager::OnScriptingAbort ( int  session_id,
uint32_t  scripting_request_id 
)

◆ OnUpgrade()

void carta::SessionManager::OnUpgrade ( uWS::HttpResponse< false > *  http_response,
uWS::HttpRequest *  http_request,
struct us_socket_context_t *  context 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunApp()

void carta::SessionManager::RunApp ( )
Here is the call graph for this function:

◆ SendScriptingRequest()

bool carta::SessionManager::SendScriptingRequest ( int &  session_id,
uint32_t &  scripting_request_id,
std::string &  target,
std::string &  action,
std::string &  parameters,
bool &  async,
std::string &  return_path,
ScriptingResponseCallback  callback,
ScriptingSessionClosedCallback  session_closed_callback 
)
Here is the call graph for this function:

Member Data Documentation

◆ _app

uWS::App carta::SessionManager::_app
private

◆ _auth_token

std::string carta::SessionManager::_auth_token
private

◆ _file_list_handler

std::shared_ptr<FileListHandler> carta::SessionManager::_file_list_handler
private

◆ _session_number

uint32_t carta::SessionManager::_session_number
private

◆ _sessions

std::unordered_map<uint32_t, Session*> carta::SessionManager::_sessions
private

◆ _sessions_mutex

std::mutex carta::SessionManager::_sessions_mutex
private

◆ _settings

ProgramSettings& carta::SessionManager::_settings
private

The documentation for this class was generated from the following files: