OnixS C++ CME Streamlined Market Data Handler  1.1.0.5
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/Streamlined/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_CMESTREAMLINEDMDH_EXPORTED_DECL(entity, typeName) \
33  entity ONIXS_CMESTREAMLINEDMDH_EXPORTED typeName
34 
35 #define \
36  ONIXS_CMESTREAMLINEDMDH_INTERNAL_DECL(entity, typeName) \
37  entity ONIXS_CMESTREAMLINEDMDH_INTERNAL typeName
38 
39 #else
40 
41 #define \
42  ONIXS_CMESTREAMLINEDMDH_EXPORTED_DECL(entity, typeName) \
43  entity typeName
44 
45 #define \
46  ONIXS_CMESTREAMLINEDMDH_INTERNAL_DECL(entity, typeName) \
47  entity typeName
48 
49 #endif // Toolset selector.
50 
51 // Common part of export-related decorations.
52 
53 #define \
54  ONIXS_CMESTREAMLINEDMDH_EXPORTED_CLASS_DECL(typeName) \
55  ONIXS_CMESTREAMLINEDMDH_EXPORTED_DECL(class, typeName)
56 
57 #define \
58  ONIXS_CMESTREAMLINEDMDH_EXPORTED_STRUCT_DECL(typeName) \
59  ONIXS_CMESTREAMLINEDMDH_EXPORTED_DECL(struct, typeName)
60 
61 #define \
62  ONIXS_CMESTREAMLINEDMDH_EXPORTED_CLASS \
63  class ONIXS_CMESTREAMLINEDMDH_EXPORTED
64 
65 #define \
66  ONIXS_CMESTREAMLINEDMDH_EXPORTED_STRUCT \
67  struct ONIXS_CMESTREAMLINEDMDH_EXPORTED
68 
69 #define \
70  ONIXS_CMESTREAMLINEDMDH_INTERNAL_CLASS_DECL(typeName) \
71  ONIXS_CMESTREAMLINEDMDH_INTERNAL_DECL(class, typeName)
72 
73 #define \
74  ONIXS_CMESTREAMLINEDMDH_INTERNAL_STRUCT_DECL(typeName) \
75  ONIXS_CMESTREAMLINEDMDH_INTERNAL_DECL(struct, typeName)
76 
77 #define \
78  ONIXS_CMESTREAMLINEDMDH_INTERNAL_CLASS \
79  class ONIXS_CMESTREAMLINEDMDH_INTERNAL
80 
81 #define \
82  ONIXS_CMESTREAMLINEDMDH_INTERNAL_STRUCT \
83  struct ONIXS_CMESTREAMLINEDMDH_INTERNAL
84 
85 #if defined (ONIXS_CMESTREAMLINEDMDH_LTWT_AS_EXPORTED)
86 
87 #define \
88  ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS \
89  ONIXS_CMESTREAMLINEDMDH_EXPORTED_CLASS
90 
91 #define \
92  ONIXS_CMESTREAMLINEDMDH_LTWT_STRUCT \
93  ONIXS_CMESTREAMLINEDMDH_EXPORTED_STRUCT
94 
95 #define \
96  ONIXS_CMESTREAMLINEDMDH_LTWT_EXPORTED \
97  /* Nothing */
98 
99 #define \
100  ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS_DECL(name) \
101  ONIXS_CMESTREAMLINEDMDH_EXPORTED_CLASS_DECL(name)
102 
103 #define \
104  ONIXS_CMESTREAMLINEDMDH_LTWT_STRUCT_DECL(name) \
105  ONIXS_CMESTREAMLINEDMDH_EXPORTED_STRUCT_DECL(name)
106 
107 #else
108 
109 #define \
110  ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS \
111  class
112 
113 #define \
114  ONIXS_CMESTREAMLINEDMDH_LTWT_STRUCT \
115  struct
116 
117 #define \
118  ONIXS_CMESTREAMLINEDMDH_LTWT_EXPORTED \
119  ONIXS_CMESTREAMLINEDMDH_EXPORTED
120 
121 #define \
122  ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS_DECL(name) \
123  class name
124 
125 #define \
126  ONIXS_CMESTREAMLINEDMDH_LTWT_STRUCT_DECL(name) \
127  struct name
128 
129 #endif // ONIXS_CMESTREAMLINEDMDH_LTWT_AS_EXPORTED
130 
131 // Structure packing.
132 
133 #define \
134  ONIXS_CMESTREAMLINEDMDH_TO_STR(entity) \
135  #entity
136 
137 #if defined (_MSC_VER)
138 
139 #define \
140  ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_BEGIN(alignment) \
141  __pragma(pack(push, alignment))
142 
143 #define \
144  ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_END \
145  __pragma(pack(pop))
146 
147 #elif defined (__GNUC__) && (__GNUC__ >= 3)
148 
149 #define \
150  ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_BEGIN(alignment) \
151  _Pragma(ONIXS_CMESTREAMLINEDMDH_TO_STR(pack(push, alignment)))
152 
153 #define \
154  ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_END \
155  _Pragma("pack(pop)")
156 
157 #else
158 
159 #error \
160  Compiler toolset is not (yet) supported. \
161  Please contact support@onixs.biz for further assistance.
162 
163 #endif
164 
165 // A few decorations for better source-code crafting.
166 
167 #define \
168  ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN \
169  namespace OnixS { namespace CME { namespace Streamlined { namespace MDH {
170 
171 #define \
172  ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END \
173  }}}}
174 
175 #define \
176  STD_NAMESPACE_BEGIN \
177  namespace std {
178 
179 #define \
180  STD_NAMESPACE_END \
181  }