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 >
 
typedef void(SessionManager::* MessageHandler) (Session *, std::string_view, const EventHeader &)
 

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

void RegisterViewerHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void ResumeSessionHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetImageChannelsHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetCursorHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetHistogramRequirementsHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void CloseFileHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void StartAnimationHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void AnimationFlowControlHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void FileInfoRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void OpenFileHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void AddRequiredTilesHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void RegionFileInfoRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void ImportRegionHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void ExportRegionHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetContourParametersHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void ScriptingResponseHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetRegionHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void RemoveRegionHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetSpectralRequirementsHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void CatalogFileInfoRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void OpenCatalogFileHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void CloseCatalogFileHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void CatalogFilterRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void StopMomentCalcHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SaveFileHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void ConcatStokesFilesHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void StopFileListHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetSpatialRequirementsHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetStatsRequirementsHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void MomentRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void FileListRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void RegionListRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void CatalogListRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void PvRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void StopPvCalcHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void FittingRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void SetVectorOverlayParametersHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void StopFittingHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void StopPvPreviewHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void ClosePvReviewHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void RemoteFileRequestHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
void ChannelMapFlowControlHandler (Session *session, std::string_view sv_message, const EventHeader &head)
 
std::string IPAsText (std::string_view binary)
 

Private Attributes

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

Static Private Attributes

static std::unordered_map< CARTA::EventType, MessageHandler_message_handlers
 

Member Typedef Documentation

◆ MessageHandler

typedef void(SessionManager::* carta::SessionManager::MessageHandler) (Session *, std::string_view, const EventHeader &)

◆ 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

◆ AddRequiredTilesHandler()

void carta::SessionManager::AddRequiredTilesHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ AnimationFlowControlHandler()

void carta::SessionManager::AnimationFlowControlHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ App()

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

◆ CatalogFileInfoRequestHandler()

void carta::SessionManager::CatalogFileInfoRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ CatalogFilterRequestHandler()

void carta::SessionManager::CatalogFilterRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ CatalogListRequestHandler()

void carta::SessionManager::CatalogListRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ ChannelMapFlowControlHandler()

void carta::SessionManager::ChannelMapFlowControlHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ CloseCatalogFileHandler()

void carta::SessionManager::CloseCatalogFileHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ CloseFileHandler()

void carta::SessionManager::CloseFileHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ ClosePvReviewHandler()

void carta::SessionManager::ClosePvReviewHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ ConcatStokesFilesHandler()

void carta::SessionManager::ConcatStokesFilesHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ 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:

◆ ExportRegionHandler()

void carta::SessionManager::ExportRegionHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ FileInfoRequestHandler()

void carta::SessionManager::FileInfoRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ FileListRequestHandler()

void carta::SessionManager::FileListRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ FittingRequestHandler()

void carta::SessionManager::FittingRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ ImportRegionHandler()

void carta::SessionManager::ImportRegionHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call 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 
)

◆ MomentRequestHandler()

void carta::SessionManager::MomentRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ 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:

◆ OpenCatalogFileHandler()

void carta::SessionManager::OpenCatalogFileHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ OpenFileHandler()

void carta::SessionManager::OpenFileHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ PvRequestHandler()

void carta::SessionManager::PvRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ RegionFileInfoRequestHandler()

void carta::SessionManager::RegionFileInfoRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ RegionListRequestHandler()

void carta::SessionManager::RegionListRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ RegisterViewerHandler()

void carta::SessionManager::RegisterViewerHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ RemoteFileRequestHandler()

void carta::SessionManager::RemoteFileRequestHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ RemoveRegionHandler()

void carta::SessionManager::RemoveRegionHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ ResumeSessionHandler()

void carta::SessionManager::ResumeSessionHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ RunApp()

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

◆ SaveFileHandler()

void carta::SessionManager::SaveFileHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ ScriptingResponseHandler()

void carta::SessionManager::ScriptingResponseHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
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:

◆ SetContourParametersHandler()

void carta::SessionManager::SetContourParametersHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ SetCursorHandler()

void carta::SessionManager::SetCursorHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ SetHistogramRequirementsHandler()

void carta::SessionManager::SetHistogramRequirementsHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ SetImageChannelsHandler()

void carta::SessionManager::SetImageChannelsHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ SetRegionHandler()

void carta::SessionManager::SetRegionHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ SetSpatialRequirementsHandler()

void carta::SessionManager::SetSpatialRequirementsHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ SetSpectralRequirementsHandler()

void carta::SessionManager::SetSpectralRequirementsHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ SetStatsRequirementsHandler()

void carta::SessionManager::SetStatsRequirementsHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ SetVectorOverlayParametersHandler()

void carta::SessionManager::SetVectorOverlayParametersHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ StartAnimationHandler()

void carta::SessionManager::StartAnimationHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ StopFileListHandler()

void carta::SessionManager::StopFileListHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ StopFittingHandler()

void carta::SessionManager::StopFittingHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ StopMomentCalcHandler()

void carta::SessionManager::StopMomentCalcHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ StopPvCalcHandler()

void carta::SessionManager::StopPvCalcHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
Here is the call graph for this function:

◆ StopPvPreviewHandler()

void carta::SessionManager::StopPvPreviewHandler ( Session session,
std::string_view  sv_message,
const EventHeader head 
)
private
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

◆ _message_handlers

std::unordered_map< CARTA::EventType, SessionManager::MessageHandler > carta::SessionManager::_message_handlers
staticprivate

◆ _real_session_id

std::unordered_map<uint32_t, uint32_t> carta::SessionManager::_real_session_id
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: