OnixS C++ ICE Binary Order Entry Handler 1.0.0
API Documentation
Loading...
Searching...
No Matches
Defines.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
21#include <OnixS/ICE/BOE/ABI.h>
22
23#include <vector>
24#include <string>
25#include <set>
26#include <memory>
27
28#if defined(_WIN32) // Windows platform.
29
30#if !defined(STRICT)
31#define STRICT
32#endif
33
34#include <winsock2.h>
35
36#endif
37
39
40typedef unsigned short Port;
41
43typedef unsigned char Byte;
44
46typedef std::vector<Byte> Bytes;
47
48#if defined (_WIN32)
50typedef SOCKET Handle;
51#else
53typedef int Handle;
54#endif
55
58 SocketOption() noexcept
59 : optname(0), optval(nullptr), optlen(0) {}
60
61 SocketOption(int optionName, const void* optionValue, int optionLength) noexcept
62 : optname(optionName), optval(optionValue), optlen(optionLength) {}
63
65 const void * optval;
66 int optlen;
67};
68
69typedef size_t CpuIndex;
70typedef std::set<CpuIndex> CpuIndexes;
71typedef std::pair<Port, Port> PortRange;
72
74typedef std::vector<SocketOption> SocketOptions;
75
77{
78 std::string name;
80 int priority {0};
81 int policy {0};
82};
83
85{
86 static constexpr int UndefinedPriorityAndPolicy = 255;
87};
88
91bool isDebugBuild() noexcept;
92
93ONIXS_ICEBOE_FORCEINLINE
94constexpr bool isNdebug() noexcept
95{
96#if defined(NDEBUG)
97 return true;
98#else
99 return false;
100#endif
101}
102
#define ONIXS_ICEBOE_NAMESPACE_BEGIN
Definition ABI.h:94
#define ONIXS_ICEBOE_NAMESPACE_END
Definition ABI.h:98
#define ONIXS_ICEBOE_EXPORTED
Definition Compiler.h:153
unsigned short Port
Definition Defines.h:40
std::vector< SocketOption > SocketOptions
Socket options.
Definition Defines.h:74
bool isDebugBuild() noexcept
size_t CpuIndex
Definition Defines.h:69
std::pair< Port, Port > PortRange
Definition Defines.h:71
int Handle
Type alias for socket handle.
Definition Defines.h:53
ONIXS_ICEBOE_FORCEINLINE constexpr bool isNdebug() noexcept
Definition Defines.h:94
std::set< CpuIndex > CpuIndexes
Definition Defines.h:70
unsigned char Byte
Type alias for byte.
Definition Defines.h:43
std::vector< Byte > Bytes
Sequence of bytes.
Definition Defines.h:46
static constexpr int UndefinedPriorityAndPolicy
Definition Defines.h:86
SocketOption(int optionName, const void *optionValue, int optionLength) noexcept
Definition Defines.h:61