OnixS C++ FIX Engine 4.13.0
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#ifdef ONIXS_FIXENGINE_CXX11
43 Stack(const Stack &) = delete;
44 Stack(Stack &&) = delete;
45
46 Stack & operator=(const Stack &) = delete;
47 Stack & operator=(Stack &&) = delete;
48#endif
49
51
61 // The TCPStandard middleware is NOT thread-safe.
62 // Therefore, the event dispatching should be performed from the same thread that created the stack.
63
64 assert(threadId() == Threading::ThisThread::id() && "should be performed from the same thread that created the stack");
65
66 dispatchEventsImpl();
67 }
68
78 assert(threadId() == Threading::ThisThread::id() && "should be performed from the same thread that created the stack");
79
80 return isQuiescentImpl();
81 }
82
87 return threadId_;
88 }
89
93
94private:
95 void dispatchEventsImpl();
96
97 bool isQuiescentImpl() const;
98
99 class Impl;
100 Impl * const impl_;
101
102 Threading::ThreadId const threadId_;
103
104#ifndef ONIXS_FIXENGINE_CXX11
105 Stack(const Stack &);
106 Stack & operator=(const Stack &);
107#endif
108
109 friend class FIX::ReactorOperator;
110};
111
112}}}
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
#define ONIXS_FIXENGINE_OVERRIDE
Definition Compiler.h:191
The session's network stack reactor interface.
A high-level wrapper over the TCP standard stack.
void dispatchEvents() ONIXS_FIXENGINE_OVERRIDE
Processes events on a stack and performs the necessary handling.
Threading::ThreadId threadId() const ONIXS_FIXENGINE_OVERRIDE
ReactorType::Enum type() const ONIXS_FIXENGINE_OVERRIDE
Stack()
Allocates a TCP stack.
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
@ TcpStandard
The standard TCP reactor.