OnixS C++ FIX Engine 4.13.0
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#ifdef ONIXS_FIXENGINE_CXX11
54 Stack(const Stack &) = delete;
55 Stack(Stack &&) = delete;
56
57 Stack & operator=(const Stack &) = delete;
58 Stack & operator=(Stack &&) = delete;
59#endif
60
62
74 // The TCPDirect middleware is NOT thread-safe.
75 // Therefore, the event dispatching should be performed from the same thread that created the stack.
76
77 assert(threadId() == Threading::ThisThread::id() && "should be performed from the same thread that created the stack");
78
79 dispatchEventsImpl();
80 }
81
91 assert(threadId() == Threading::ThisThread::id() && "should be performed from the same thread that created the stack");
92
93 return isQuiescentImpl();
94 }
95
102 return threadId_;
103 }
104
108
109private:
110 void dispatchEventsImpl();
111
112 bool isQuiescentImpl() const;
113
114 class Impl;
115 Impl * const impl_;
116
117 Threading::ThreadId const threadId_;
118
119#ifndef ONIXS_FIXENGINE_CXX11
120 Stack(const Stack &);
121 Stack & operator=(const Stack &);
122#endif
123
124 friend class FIX::ReactorOperator;
125};
126
127}}}
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
#define ONIXS_FIXENGINE_OVERRIDE
Definition Compiler.h:191
The session's network stack reactor interface.
TCPDirect attributes to pass configuration details (a wrapper around the zf_Attributes struct).
A high-level wrapper over the TCPDirect stack.
void dispatchEvents() ONIXS_FIXENGINE_OVERRIDE
Processes events on a stack and performs the necessary handling.
Threading::ThreadId threadId() const ONIXS_FIXENGINE_OVERRIDE
Returns the ID of the thread that created the stack.
ReactorType::Enum type() const ONIXS_FIXENGINE_OVERRIDE
Stack(const Attributes &attr)
Allocates a stack with the supplied attributes.
bool isQuiescent() const ONIXS_FIXENGINE_OVERRIDE
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.