CARLA
 
载入中...
搜索中...
未找到
Public 成员函数 | Private 成员函数 | Private 属性 | 所有成员列表
Router类 参考

#include <router.h>

+ 类 Router 继承关系图:
+ Router 的协作图:

Public 成员函数

void AsyncRun (size_t worker_threads)
 
PrimaryCommands & GetCommander ()
 
boost::asio::ip::tcp::endpoint GetLocalEndpoint () const
 
std::weak_ptr< Primary > GetNextServer ()
 
bool HasClientsConnected ()
 
 Router (uint16_t port)
 
 Router (void)
 
void SetCallbacks ()
 
void SetNewConnectionCallback (std::function< void(void)>)
 
void Stop ()
 
void Write (MultiGPUCommand id, Buffer &&buffer)
 
std::future< SessionInfoWriteToNext (MultiGPUCommand id, Buffer &&buffer)
 
std::future< SessionInfoWriteToOne (std::weak_ptr< Primary > server, MultiGPUCommand id, Buffer &&buffer)
 
 ~Router ()
 

Private 成员函数

void ClearSessions ()
 
void ConnectSession (std::shared_ptr< Primary > session)
 
void DisconnectSession (std::shared_ptr< Primary > session)
 

Private 属性

std::function< void(void)> _callback
 
PrimaryCommands _commander
 
boost::asio::ip::tcp::endpoint _endpoint
 
std::shared_ptr< Listener > _listener
 
std::mutex _mutex
 
uint32_t _next
 
ThreadPool _pool
 
std::unordered_map< Primary *, std::shared_ptr< std::promise< SessionInfo > > > _promises
 
std::vector< std::shared_ptr< Primary > > _sessions
 

详细描述

在文件 router.h49 行定义.

构造及析构函数说明

◆ Router() [1/2]

Router::Router ( void )

在文件 router.cpp15 行定义.

◆ Router() [2/2]

Router::Router ( uint16_t port)
explicit

在文件 router.cpp40 行定义.

引用了 _endpoint, _listener , 以及 _pool.

◆ ~Router()

Router::~Router ( )

在文件 router.cpp20 行定义.

引用了 Stop().

+ 函数调用图:

成员函数说明

◆ AsyncRun()

void Router::AsyncRun ( size_t worker_threads)

在文件 router.cpp104 行定义.

引用了 _pool.

◆ ClearSessions()

void Router::ClearSessions ( )
private

在文件 router.cpp145 行定义.

引用了 _mutex , 以及 _sessions.

被这些函数引用 Stop().

+ 这是这个函数的调用关系图:

◆ ConnectSession()

void Router::ConnectSession ( std::shared_ptr< Primary > session)
private

在文件 router.cpp118 行定义.

引用了 _callback, _mutex, _sessions , 以及 DEBUG_ASSERT.

◆ DisconnectSession()

void Router::DisconnectSession ( std::shared_ptr< Primary > session)
private

在文件 router.cpp133 行定义.

引用了 _mutex, _sessions , 以及 DEBUG_ASSERT.

◆ GetCommander()

PrimaryCommands & Router::GetCommander ( )
inline

在文件 router.h72 行定义.

引用了 _commander.

◆ GetLocalEndpoint()

boost::asio::ip::tcp::endpoint Router::GetLocalEndpoint ( ) const

在文件 router.cpp109 行定义.

引用了 _endpoint.

◆ GetNextServer()

std::weak_ptr< Primary > Router::GetNextServer ( )

在文件 router.cpp264 行定义.

引用了 _mutex, _next , 以及 _sessions.

◆ HasClientsConnected()

bool Router::HasClientsConnected ( )
inline

在文件 router.h68 行定义.

引用了 _sessions.

◆ SetCallbacks()

void Router::SetCallbacks ( )

在文件 router.cpp58 行定义.

引用了 _commander, _endpoint, _listener , 以及 _promises.

◆ SetNewConnectionCallback()

void Router::SetNewConnectionCallback ( std::function< void(void)> func)

在文件 router.cpp97 行定义.

引用了 _callback.

◆ Stop()

void Router::Stop ( )

在文件 router.cpp29 行定义.

引用了 _listener, _pool , 以及 ClearSessions().

被这些函数引用 ~Router().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ Write()

void Router::Write ( MultiGPUCommand id,
Buffer && buffer )

在文件 router.cpp161 行定义.

引用了 _mutex, _sessions , 以及 carla::BufferView::CreateFrom().

+ 函数调用图:

◆ WriteToNext()

std::future< SessionInfo > Router::WriteToNext ( MultiGPUCommand id,
Buffer && buffer )

在文件 router.cpp193 行定义.

引用了 _mutex, _next, _promises, _sessions , 以及 carla::BufferView::CreateFrom().

+ 函数调用图:

◆ WriteToOne()

std::future< SessionInfo > Router::WriteToOne ( std::weak_ptr< Primary > server,
MultiGPUCommand id,
Buffer && buffer )

在文件 router.cpp235 行定义.

引用了 _mutex, _promises , 以及 carla::BufferView::CreateFrom().

+ 函数调用图:

类成员变量说明

◆ _callback

std::function<void(void)> Router::_callback
private

在文件 router.h92 行定义.

被这些函数引用 ConnectSession() , 以及 SetNewConnectionCallback().

◆ _commander

PrimaryCommands Router::_commander
private

在文件 router.h91 行定义.

被这些函数引用 GetCommander() , 以及 SetCallbacks().

◆ _endpoint

boost::asio::ip::tcp::endpoint Router::_endpoint
private

在文件 router.h86 行定义.

被这些函数引用 GetLocalEndpoint(), Router() , 以及 SetCallbacks().

◆ _listener

std::shared_ptr<Listener> Router::_listener
private

在文件 router.h88 行定义.

被这些函数引用 Router(), SetCallbacks() , 以及 Stop().

◆ _mutex

std::mutex Router::_mutex
private

在文件 router.h84 行定义.

被这些函数引用 ClearSessions(), ConnectSession(), DisconnectSession(), GetNextServer(), Write(), WriteToNext() , 以及 WriteToOne().

◆ _next

uint32_t Router::_next
private

在文件 router.h89 行定义.

被这些函数引用 GetNextServer() , 以及 WriteToNext().

◆ _pool

ThreadPool Router::_pool
private

在文件 router.h85 行定义.

被这些函数引用 AsyncRun(), Router() , 以及 Stop().

◆ _promises

std::unordered_map<Primary *, std::shared_ptr<std::promise<SessionInfo> > > Router::_promises
private

在文件 router.h90 行定义.

被这些函数引用 SetCallbacks(), WriteToNext() , 以及 WriteToOne().

◆ _sessions

std::vector<std::shared_ptr<Primary> > Router::_sessions
private

该类的文档由以下文件生成: