OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
TcpStandardStack.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
23
24#include <cassert>
25
26namespace OnixS {
27namespace FIX {
28class ReactorOperator;
29namespace TCPStandard {
30
35{
36public:
41
42 Stack(const Stack &) = delete;
43 Stack(Stack &&) = delete;
44
45 Stack & operator=(const Stack &) = delete;
46 Stack & operator=(Stack &&) = delete;
47
49
58 void dispatchEvents() override {
59 // The TCPStandard middleware is NOT thread-safe.
60 // Therefore, the event dispatching should be performed from the same thread that created the stack.
61
62 assert(threadId() == Threading::ThisThread::id() && "should be performed from the same thread that created the stack");
63
64 dispatchEventsImpl();
65 }
66
75 bool isQuiescent() const override {
76 assert(threadId() == Threading::ThisThread::id() && "should be performed from the same thread that created the stack");
77
78 return isQuiescentImpl();
79 }
80
84 Threading::ThreadId threadId() const override {
85 return threadId_;
86 }
87
88 ReactorType::Enum type() const override {
90 }
91
92private:
93 void dispatchEventsImpl();
94
95 bool isQuiescentImpl() const;
96
97 class Impl;
98 Impl * const impl_;
99
100 Threading::ThreadId const threadId_;
101
102 friend class FIX::ReactorOperator;
103};
104
105}}}
#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
static ThreadId id()
Gets the platform identifier for the current thread.
pthread_t ThreadId
Type alias for thread identifier.
Definition Definitions.h:51
@ TcpStandard
The standard TCP reactor.