OnixS C++ B3 BOE Binary Order Entry 1.3.0
API Documentation
Loading...
Searching...
No Matches
Defines.h
Go to the documentation of this file.
1#pragma once
2
3/*
4* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
5*
6* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
7* and international copyright treaties.
8*
9* Access to and use of the software is governed by the terms of the applicable OnixS Software
10* Services Agreement (the Agreement) and Customer end user license agreements granting
11* a non-assignable, non-transferable and non-exclusive license to use the software
12* for it's own data processing purposes under the terms defined in the Agreement.
13*
14* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
15* of this source code or associated reference material to any other location for further reproduction
16* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
17*
18* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
19* the terms of the Agreement is a violation of copyright law.
20*/
21
24
25#include <vector>
26#include <string>
27#include <set>
28#include <memory>
29
30#if defined(_WIN32) // Windows platform.
31
32#if !defined(STRICT)
33#define STRICT
34#endif
35
36#include <winsock2.h>
37
38#endif
39
40namespace OnixS {
41namespace B3 {
42namespace BOE {
43
44typedef unsigned short Port;
46typedef unsigned char Byte;
47
49typedef std::vector<Byte> Bytes;
50
51#if defined (_WIN32)
53typedef SOCKET Handle;
54#else
56typedef int Handle;
57#endif
58
63
64 SocketOption(int optionName, const void* optionValue, int optionLength) ONIXS_B3_BOE_NOTHROW
65 : optname(optionName), optval(optionValue), optlen(optionLength) {}
66
68 const void * optval;
69 int optlen;
70};
71
72typedef size_t CpuIndex;
73typedef std::set<CpuIndex> CpuIndexes;
74typedef std::pair<Port, Port> PortRange;
75
77typedef std::vector<SocketOption> SocketOptions;
78
80 std::string name;
83 int policy;
84
86 : priority(0)
87 , policy(0)
88 {
89 }
90};
91
97
98template <typename T>
100{
101#if defined (ONIXS_B3_BOE_CXX11)
102 typedef std::unique_ptr<T> UniquePtr;
103#else
104 typedef std::auto_ptr<T> UniquePtr;
105#endif
106};
107
108}
109}
110}
#define ONIXS_B3_BOE_NULLPTR
Definition Compiler.h:188
#define ONIXS_B3_BOE_NOTHROW
Definition Compiler.h:182
unsigned short Port
Definition Defines.h:44
std::vector< SocketOption > SocketOptions
Socket options.
Definition Defines.h:77
size_t CpuIndex
Definition Defines.h:72
std::pair< Port, Port > PortRange
Definition Defines.h:74
int Handle
Type alias for socket handle.
Definition Defines.h:56
std::set< CpuIndex > CpuIndexes
Definition Defines.h:73
unsigned char Byte
Type alias for byte.
Definition Defines.h:46
std::vector< Byte > Bytes
Sequence of bytes.
Definition Defines.h:49
std::unique_ptr< T > UniquePtr
Definition Defines.h:102
SocketOption(int optionName, const void *optionValue, int optionLength) noexcept
Definition Defines.h:64