FIX 会话管理器
More...
#include <session_manager.hpp>
FIX 会话管理器
线程安全地管理所有活跃的 FIX 会话,提供:
- 使用场景
- MatchingEngine 产生 ExecutionReport 后,通过 SessionManager 找到对应的 Session 并发送消息。
- 线程安全
- 所有公共方法都是线程安全的。
- 使用示例
FIX 消息的面向对象封装
Definition fix_codec.hpp:46
FIX 会话管理器
Definition session_manager.hpp:62
bool unregisterSession(const SessionID &sessionID)
注销会话
Definition session_manager.cpp:31
void registerSession(std::shared_ptr< Session > session)
注册会话
Definition session_manager.cpp:11
bool sendMessage(const SessionID &sessionID, FixMessage &msg)
向指定会话发送消息
Definition session_manager.cpp:51
◆ SessionManager() [1/2]
| fix40::SessionManager::SessionManager |
( |
| ) |
|
|
default |
◆ ~SessionManager()
| fix40::SessionManager::~SessionManager |
( |
| ) |
|
|
default |
◆ SessionManager() [2/2]
◆ findSession()
| std::shared_ptr< Session > fix40::SessionManager::findSession |
( |
const SessionID & |
sessionID | ) |
const |
查找会话
- Parameters
-
- Returns
- std::shared_ptr<Session> 会话对象,不存在返回 nullptr
◆ forEachSession()
| void fix40::SessionManager::forEachSession |
( |
std::function< void(const SessionID &, std::shared_ptr< Session >)> |
callback | ) |
const |
◆ getSessionCount()
| size_t fix40::SessionManager::getSessionCount |
( |
| ) |
const |
◆ hasSession()
| bool fix40::SessionManager::hasSession |
( |
const SessionID & |
sessionID | ) |
const |
◆ operator=()
◆ registerSession()
| void fix40::SessionManager::registerSession |
( |
std::shared_ptr< Session > |
session | ) |
|
注册会话
- Parameters
-
将会话添加到管理器中。如果已存在相同 SessionID 的会话, 会替换旧的会话。
◆ sendMessage()
◆ unregisterSession()
| bool fix40::SessionManager::unregisterSession |
( |
const SessionID & |
sessionID | ) |
|
注销会话
- Parameters
-
- Returns
- true 成功注销
-
false 会话不存在
The documentation for this class was generated from the following files: