OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
TcpDirectStack.h
Go to the documentation of this file.
1/*
2* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3*
4* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5* and international copyright treaties.
6*
7* Access to and use of the software is governed by the terms of the applicable OnixS Software
8* Services Agreement (the Agreement) and Customer end user license agreements granting
9* a non-assignable, non-transferable and non-exclusive license to use the software
10* for it's own data processing purposes under the terms defined in the Agreement.
11*
12* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13* of this source code or associated reference material to any other location for further reproduction
14* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15*
16* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17* the terms of the Agreement is a violation of copyright law.
18*/
19#pragma once
20
24
25#include <cassert>
26
27namespace OnixS {
28namespace FIX {
29class ReactorOperator;
30namespace TCPDirect {
31
36{
37public:
51 explicit Stack(const Attributes & attr);
52
53 Stack(const Stack &) = delete;
54 Stack(Stack &&) = delete;
55
56 Stack & operator=(const Stack &) = delete;
57 Stack & operator=(Stack &&) = delete;
58
60
74 void dispatchEvents() override {
75 // The TCPDirect middleware is NOT thread-safe.
76 // Therefore, the event dispatching should be performed from the same thread that created the stack.
77
78 assert(threadId() == Threading::ThisThread::id() && "should be performed from the same thread that created the stack");
79
80 dispatchEventsImpl();
81 }
82
94 bool isQuiescent() const override {
95 assert(threadId() == Threading::ThisThread::id() && "should be performed from the same thread that created the stack");
96
97 return isQuiescentImpl();
98 }
99
105 Threading::ThreadId threadId() const override {
106 return threadId_;
107 }
108
109 ReactorType::Enum type() const override {
111 }
112
113private:
114 void dispatchEventsImpl();
115
116 bool isQuiescentImpl() const;
117
118 class Impl;
119 Impl * const impl_;
120
121 Threading::ThreadId const threadId_;
122
123 friend class FIX::ReactorOperator;
124};
125
126}}}
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
The session's network stack reactor interface.
Stack & operator=(Stack &&)=delete
bool isQuiescent() const override
ReactorType::Enum type() const override
Threading::ThreadId threadId() const override
Stack(const Stack &)=delete
Stack & operator=(const Stack &)=delete
Stack(const Attributes &attr)
static ThreadId id()
Gets the platform identifier for the current thread.
pthread_t ThreadId
Type alias for thread identifier.
Definition Definitions.h:51
@ TcpDirect
The Solarflare TCPDirect reactor.