OnixS C++ CME Market Data Handler  5.4.0
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/MDH/Export.h>
24 
25 // Exporting services.
26 
27 #if defined (_MSC_VER)
28 
29 // Qualifiers for public/exported entities.
30 
31 #define \
32  ONIXS_CMEMDH_EXPORTED_DECL(entity, typeName) \
33  entity ONIXS_CMEMDH_EXPORTED typeName
34 
35 #else
36 
37 #define \
38  ONIXS_CMEMDH_EXPORTED_DECL(entity, typeName) \
39  entity typeName
40 
41 #endif // Toolset selector.
42 
43 // Common part of export-related decorations.
44 
45 #define \
46  ONIXS_CMEMDH_EXPORTED_CLASS_DECL(typeName) \
47  ONIXS_CMEMDH_EXPORTED_DECL(class, typeName)
48 
49 #define \
50  ONIXS_CMEMDH_EXPORTED_STRUCT_DECL(typeName) \
51  ONIXS_CMEMDH_EXPORTED_DECL(struct, typeName)
52 
53 #define \
54  ONIXS_CMEMDH_EXPORTED_CLASS \
55  class ONIXS_CMEMDH_EXPORTED
56 
57 #define \
58  ONIXS_CMEMDH_EXPORTED_STRUCT \
59  struct ONIXS_CMEMDH_EXPORTED
60 
61 #define \
62  ONIXS_CMEMDH_INTERNAL_CLASS_DECL(typeName) \
63  class typeName
64 
65 #define \
66  ONIXS_CMEMDH_INTERNAL_STRUCT_DECL(typeName) \
67  struct typeName
68 
69 #if defined (ONIXS_CMEMDH_LTWT_AS_EXPORTED)
70 
71 #define \
72  ONIXS_CMEMDH_LTWT_CLASS \
73  ONIXS_CMEMDH_EXPORTED_CLASS
74 
75 #define \
76  ONIXS_CMEMDH_LTWT_STRUCT \
77  ONIXS_CMEMDH_EXPORTED_STRUCT
78 
79 #define \
80  ONIXS_CMEMDH_LTWT_EXPORTED \
81  /* Nothing */
82 
83 #define \
84  ONIXS_CMEMDH_LTWT_CLASS_DECL(name) \
85  ONIXS_CMEMDH_EXPORTED_CLASS_DECL(name)
86 
87 #define \
88  ONIXS_CMEMDH_LTWT_STRUCT_DECL(name) \
89  ONIXS_CMEMDH_EXPORTED_STRUCT_DECL(name)
90 
91 #else
92 
93 #define \
94  ONIXS_CMEMDH_LTWT_CLASS \
95  class
96 
97 #define \
98  ONIXS_CMEMDH_LTWT_STRUCT \
99  struct
100 
101 #define \
102  ONIXS_CMEMDH_LTWT_EXPORTED \
103  ONIXS_CMEMDH_EXPORTED
104 
105 #define \
106  ONIXS_CMEMDH_LTWT_CLASS_DECL(name) \
107  class name
108 
109 #define \
110  ONIXS_CMEMDH_LTWT_STRUCT_DECL(name) \
111  struct name
112 
113 #endif // ONIXS_CMEMDH_LTWT_AS_EXPORTED
114 
115 // Structure packing.
116 
117 #define \
118  ONIXS_CMEMDH_TO_STR(entity) \
119  #entity
120 
121 #if defined (_MSC_VER)
122 
123 #define \
124  ONIXS_CMEMDH_DATA_PACKING_BEGIN(alignment) \
125  __pragma(pack(push, alignment))
126 
127 #define \
128  ONIXS_CMEMDH_DATA_PACKING_END \
129  __pragma(pack(pop))
130 
131 #elif defined (__GNUC__) && (__GNUC__ >= 3)
132 
133 #define \
134  ONIXS_CMEMDH_DATA_PACKING_BEGIN(alignment) \
135  _Pragma(ONIXS_CMEMDH_TO_STR(pack(push, alignment)))
136 
137 #define \
138  ONIXS_CMEMDH_DATA_PACKING_END \
139  _Pragma("pack(pop)")
140 
141 #else
142 
143 #error \
144  Compiler toolset is not (yet) supported. \
145  Please contact support@onixs.biz for further assistance.
146 
147 #endif
148 
149 // A few decorations for better source-code crafting.
150 
151 #define \
152  ONIXS_CMEMDH_NAMESPACE_BEGIN \
153  namespace OnixS { namespace CME { namespace MDH {
154 
155 #define \
156  ONIXS_CMEMDH_NAMESPACE_END \
157  }}}
158 
159 #define \
160  ONIXS_CMEMDHFIX_NAMESPACE_BEGIN \
161  namespace OnixS { namespace CME { namespace MDH { namespace FIX {
162 
163 #define \
164  ONIXS_CMEMDHFIX_NAMESPACE_END \
165  }}}}
166 
167 #define \
168  STD_NAMESPACE_BEGIN \
169  namespace std {
170 
171 #define \
172  STD_NAMESPACE_END \
173  }