OnixS C++ CME MDP Conflated UDP Handler  1.1.2
API documentation
Bootstrap.h
Go to the documentation of this file.
1 // Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2 //
3 // This software owned by Onix Solutions Limited [OnixS] and is
4 // protected by copyright law and international copyright treaties.
5 //
6 // Access to and use of the software is governed by the terms of the applicable
7 // OnixS Software Services Agreement (the Agreement) and Customer end user license
8 // agreements granting a non-assignable, non-transferable and non-exclusive license
9 // to use the software for it's own data processing purposes under the terms defined
10 // in the Agreement.
11 //
12 // Except as otherwise granted within the terms of the Agreement, copying or
13 // reproduction of any part of this source code or associated reference material
14 // to any other location for further reproduction or redistribution, and any
15 // amendments to this copyright notice, are expressly prohibited.
16 //
17 // Any reproduction or redistribution for sale or hiring of the Software not in
18 // accordance with the terms of the Agreement is a violation of copyright law.
19 //
20 
21 #pragma once
22 
23 #include <OnixS/CME/ConflatedUDP/Export.h>
24 #include <OnixS/CME/ConflatedUDP/CompilerDetection.h>
25 
26 // Exporting services.
27 
28 #if defined (_MSC_VER)
29 
30 // Qualifiers for public/exported entities.
31 
32 #define \
33  ONIXS_CONFLATEDUDP_EXPORTED_DECL(entity, typeName) \
34  entity ONIXS_CONFLATEDUDP_EXPORTED typeName
35 
36 #else
37 
38 #define \
39  ONIXS_CONFLATEDUDP_EXPORTED_DECL(entity, typeName) \
40  entity typeName
41 
42 #endif // Toolset selector.
43 
44 // Common part of export-related decorations.
45 
46 #define \
47  ONIXS_CONFLATEDUDP_EXPORTED_CLASS_DECL(typeName) \
48  ONIXS_CONFLATEDUDP_EXPORTED_DECL(class, typeName)
49 
50 #define \
51  ONIXS_CONFLATEDUDP_EXPORTED_STRUCT_DECL(typeName) \
52  ONIXS_CONFLATEDUDP_EXPORTED_DECL(struct, typeName)
53 
54 #define \
55  ONIXS_CONFLATEDUDP_EXPORTED_CLASS \
56  class ONIXS_CONFLATEDUDP_EXPORTED
57 
58 #define \
59  ONIXS_CONFLATEDUDP_EXPORTED_STRUCT \
60  struct ONIXS_CONFLATEDUDP_EXPORTED
61 
62 #define \
63  ONIXS_CONFLATEDUDP_INTERNAL_CLASS_DECL(typeName) \
64  class typeName
65 
66 #define \
67  ONIXS_CONFLATEDUDP_INTERNAL_STRUCT_DECL(typeName) \
68  struct typeName
69 
70 #if defined (ONIXS_CONFLATEDUDP_LTWT_AS_EXPORTED)
71 
72 #define \
73  ONIXS_CONFLATEDUDP_LTWT_CLASS \
74  ONIXS_CONFLATEDUDP_EXPORTED_CLASS
75 
76 #define \
77  ONIXS_CONFLATEDUDP_LTWT_STRUCT \
78  ONIXS_CONFLATEDUDP_EXPORTED_STRUCT
79 
80 #define \
81  ONIXS_CONFLATEDUDP_LTWT_EXPORTED \
82  /* Nothing */
83 
84 #define \
85  ONIXS_CONFLATEDUDP_LTWT_CLASS_DECL(name) \
86  ONIXS_CONFLATEDUDP_EXPORTED_CLASS_DECL(name)
87 
88 #define \
89  ONIXS_CONFLATEDUDP_LTWT_STRUCT_DECL(name) \
90  ONIXS_CONFLATEDUDP_EXPORTED_STRUCT_DECL(name)
91 
92 #else
93 
94 #define \
95  ONIXS_CONFLATEDUDP_LTWT_CLASS \
96  class
97 
98 #define \
99  ONIXS_CONFLATEDUDP_LTWT_STRUCT \
100  struct
101 
102 #define \
103  ONIXS_CONFLATEDUDP_LTWT_EXPORTED \
104  ONIXS_CONFLATEDUDP_EXPORTED
105 
106 #define \
107  ONIXS_CONFLATEDUDP_LTWT_CLASS_DECL(name) \
108  class name
109 
110 #define \
111  ONIXS_CONFLATEDUDP_LTWT_STRUCT_DECL(name) \
112  struct name
113 
114 #endif // ONIXS_CONFLATEDUDP_LTWT_AS_EXPORTED
115 
116 // Structure packing.
117 
118 #define \
119  ONIXS_CONFLATEDUDP_TO_STR(entity) \
120  #entity
121 
122 #if defined (_MSC_VER)
123 
124 #define \
125  ONIXS_CONFLATEDUDP_DATA_PACKING_BEGIN(alignment) \
126  __pragma(pack(push, alignment))
127 
128 #define \
129  ONIXS_CONFLATEDUDP_DATA_PACKING_END \
130  __pragma(pack(pop))
131 
132 #elif defined (__GNUC__) && (__GNUC__ >= 3)
133 
134 #define \
135  ONIXS_CONFLATEDUDP_DATA_PACKING_BEGIN(alignment) \
136  _Pragma(ONIXS_CONFLATEDUDP_TO_STR(pack(push, alignment)))
137 
138 #define \
139  ONIXS_CONFLATEDUDP_DATA_PACKING_END \
140  _Pragma("pack(pop)")
141 
142 #else
143 
144 #error \
145  Compiler toolset is not (yet) supported. \
146  Please contact support@onixs.biz for further assistance.
147 
148 #endif
149 
150 // A few decorations for better source-code crafting.
151 
152 #define \
153  ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN \
154  namespace OnixS { namespace CME { namespace ConflatedUDP {
155 
156 #define \
157  ONIXS_CONFLATEDUDP_NAMESPACE_END \
158  }}}
159 
160 #define \
161  ONIXS_CONFLATEDUDPFIX_NAMESPACE_BEGIN \
162  namespace OnixS { namespace CME { namespace ConflatedUDP { namespace FIX {
163 
164 #define \
165  ONIXS_CONFLATEDUDPFIX_NAMESPACE_END \
166  }}}}
167 
168 #define \
169  STD_NAMESPACE_BEGIN \
170  namespace std {
171 
172 #define \
173  STD_NAMESPACE_END \
174  }