OnixS C++ CME iLink 3 Binary Order Entry Handler  1.9.0
API Documentation
Messages.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 <cassert>
24 #include <stdexcept>
25 
26 #include <OnixS/CME/iLink3/ABI.h>
29 
31 
32 /// Negotiate.
35 : SbeMessage
36 {
37  /// Used template schema.
39 
40  /// This type alias.
42 
43  /// Message template ID from SBE schema.
44  enum { TemplateId = 500 };
45 
46  /// Initializes a blank instance.
47  Negotiate500() ONIXS_ILINK3_DEFAULT;
48 
49  /// Initializes an instance over the given memory block.
51  void* data,
52  EncodedLength length,
53  SchemaVersion version = Schema::Version)
54  : SbeMessage(data, length, version)
55  {
56  checkVersion<Schema>(version);
57  checkLength(length, version);
58  initHeader(TemplateId, blockLength(version), Schema::Id);
59  reset();
60  }
61 
62  /// Initializes an instance over the given memory block
63  /// With no variable-length fields initialization
64  /// It is assumed that the user does such an initialization manually.
66  void* data,
67  EncodedLength length,
69  SchemaVersion version = Schema::Version)
70  : SbeMessage(data, length, version)
71  {
72  checkVersion<Schema>(version);
73  checkLength(length, version);
74  initHeader(TemplateId, blockLength(version), Schema::Id);
75  resetVariableFields();
76  }
77 
78  /// Initializes an instance over the existing memory block.
80  void* data,
81  EncodedLength length,
82  NoInit)
83  : SbeMessage(data, length)
84  {
85  assert(TemplateId == templateId());
86 
87  checkSchema<Schema>(schemaId(), version());
88  checkLength(length, version());
89  checkVarLenFields();
90  }
91 
92  /// Initializes an instance over the existing memory block.
93  /// Performs no checks.
95  void* data,
96  EncodedLength length,
97  NoInit,
98  NoCheck)
100  : SbeMessage(data, length, NoCheck())
101  {
102  assert(schemaId() == Schema::Id);
103  assert(version() >= Schema::MinimalVersion);
104  assert(TemplateId == templateId());
105  }
106 
107  /// Constant value representing type of flow from customer to
108  /// CME.
114  {
115  return constructStrRef("IDEMPOTENT");
116  }
117 
118  /// Constant value representing type of flow from customer to
119  /// CME.
120 
121  /// Constant value representing CME HMAC version.
127  {
128  return constructStrRef("CME-1-SHA-256");
129  }
130 
131  /// Constant value representing CME HMAC version.
132 
133  /// Contains the HMAC signature.
137  {
140 
141  return fixedStr<length>(offset);
142  }
143 
144  /// Contains the HMAC signature.
145  ThisType& setHmacSignature(StrRef value)
147  {
150 
151  setFixedStr<length>(offset, value);
152  return *this;
153  }
154 
155  /// Contains the AccessKeyID assigned to this session on this
156  /// port.
160  {
163 
164  return fixedStr<length>(offset);
165  }
166 
167  /// Contains the AccessKeyID assigned to this session on this
168  /// port.
169  ThisType& setAccessKeyId(StrRef value)
171  {
174 
175  setFixedStr<length>(offset, value);
176  return *this;
177  }
178 
179  /// Session Identifier defined as type long (uInt64);
180  /// recommended to use timestamp as number of microseconds
181  /// since epoch (Jan 1, 1970).
183  UInt64 uuId() const
185  {
187 
188  return ordinary<UInt64>(offset);
189  }
190 
191  /// Session Identifier defined as type long (uInt64);
192  /// recommended to use timestamp as number of microseconds
193  /// since epoch (Jan 1, 1970).
194  ThisType& setUuId(UInt64 value)
196  {
198 
199  setOrdinary(offset, value);
200  return *this;
201  }
202 
203  /// Time of request; recommended to use timestamp as number of
204  /// nanoseconds since epoch (Jan 1, 1970).
208  {
210 
211  return ordinary<UInt64>(offset);
212  }
213 
214  /// Time of request; recommended to use timestamp as number of
215  /// nanoseconds since epoch (Jan 1, 1970).
216  ThisType& setRequestTimestamp(UInt64 value)
218  {
220 
221  setOrdinary(offset, value);
222  return *this;
223  }
224 
225  /// Session ID.
227  StrRef session() const
229  {
232 
233  return fixedStr<length>(offset);
234  }
235 
236  /// Session ID.
237  ThisType& setSession(StrRef value)
239  {
242 
243  setFixedStr<length>(offset, value);
244  return *this;
245  }
246 
247  /// Firm ID.
249  StrRef firm() const
251  {
254 
255  return fixedStr<length>(offset);
256  }
257 
258  /// Firm ID.
259  ThisType& setFirm(StrRef value)
261  {
264 
265  setFixedStr<length>(offset, value);
266  return *this;
267  }
268 
269  /// Not used and will be set to 0.
273  {
274  return getVariableLengthField(
275  CredentialsAccess(),
276  *this);
277  }
278 
279  /// Not used and will be set to 0.
280  ThisType& setCredentials(StrRef value)
281  {
282  setVariableLengthField(
283  CredentialsAccess(),
284  value,
285  *this);
286 
287  return *this;
288  }
289 
290  /// Size of message body in bytes.
293  static
296  ONIXS_ILINK3_UNUSED SchemaVersion version)
298  {
299  return
300  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
301  76;
302  }
303 
304  /// Minimal variable fields size (when variable-length fields are empty).
308  static
311  ONIXS_ILINK3_UNUSED SchemaVersion version)
312  {
313  return
314  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
315  DATA::Size;
316  }
317 
318  /// Maximal message size.
324  {
325  return
326  MessageHeaderBuilder::Size +
327  blockLength(Schema::Version) +
328  DATA::Size + (std::numeric_limits<DATA::Length>::max)();
329  }
330 
331  /// Reset all variable-length fields if any.
334  {
335  setCredentialsToNull();
336  return *this;
337  }
338 
339  /// Reset all variable-length and optional fields if any.
340  ThisType& reset()
342  {
343  resetVariableFields();
344  return *this;
345  }
346 
347  /// \return class name.
351  static const Char* className()
352  {
353  return "Negotiate500";
354  }
355 
356  /// FIX message type.
360  static StrRef fixType()
362  {
363  return constructStrRef("Negotiate");
364  }
365 
366  /// \return a human-readable presentation.
368  std::string toString() const;
369 
370  /// \return the end of the message.
372  const void* tail() const
374  {
375  return
376  toOpaquePtr(
377  (credentials().end()));
378  }
379 
380  /// \return the size occupied by the message.
384  {
385  return
386  SbeMessage::calculateBinarySize(tail());
387  }
388 
389 private:
390  void checkLength(
391  EncodedLength length, SchemaVersion version) const
392  {
393  const EncodedLength minimalRequiredLength =
394  blockLength(version) +
395  MessageHeader::Size +
396  getMinimalVariableFieldsSize(version);
397 
398  checkBinaryLength(
399  *this, length, minimalRequiredLength);
400  }
401 
402  /// Checks variable fields consistency.
403  void checkVarLenFields() const
404  {
405  variableLengthFields().
406  checkTail<DATA>();
407  }
408 
409  /// Access helper.
410  struct CredentialsAccess
411  {
412  DATA& operator()(
413  const Negotiate500& obj) const
414  {
415  return obj.
416  variableLengthFields().
417  head<DATA>();
418  }
419  };
420 
421  /// Reset the field.
422  /// All the following data will be invalidated.
423  ThisType& setCredentialsToNull()
425  {
426  setVariableLengthFieldToNull(
427  CredentialsAccess(),
428  *this);
429 
430  return *this;
431  }
432 };
433 
434 /// NegotiationResponse.
437 : SbeMessage
438 {
439  /// Used template schema.
441 
442  /// This type alias.
444 
445  /// Message template ID from SBE schema.
446  enum { TemplateId = 501 };
447 
448  /// Initializes a blank instance.
449  NegotiationResponse501() ONIXS_ILINK3_DEFAULT;
450 
451  /// Initializes an instance over the given memory block.
453  void* data,
454  EncodedLength length,
455  SchemaVersion version = Schema::Version)
456  : SbeMessage(data, length, version)
457  {
458  checkVersion<Schema>(version);
459  checkLength(length, version);
460  initHeader(TemplateId, blockLength(version), Schema::Id);
461  reset();
462  }
463 
464  /// Initializes an instance over the given memory block
465  /// With no variable-length fields initialization
466  /// It is assumed that the user does such an initialization manually.
468  void* data,
469  EncodedLength length,
470  NoFieldsInit,
471  SchemaVersion version = Schema::Version)
472  : SbeMessage(data, length, version)
473  {
474  checkVersion<Schema>(version);
475  checkLength(length, version);
476  initHeader(TemplateId, blockLength(version), Schema::Id);
477  resetVariableFields();
478  }
479 
480  /// Initializes an instance over the existing memory block.
482  void* data,
483  EncodedLength length,
484  NoInit)
485  : SbeMessage(data, length)
486  {
487  assert(TemplateId == templateId());
488 
489  checkSchema<Schema>(schemaId(), version());
490  checkLength(length, version());
491  checkVarLenFields();
492  }
493 
494  /// Initializes an instance over the existing memory block.
495  /// Performs no checks.
497  void* data,
498  EncodedLength length,
499  NoInit,
500  NoCheck)
502  : SbeMessage(data, length, NoCheck())
503  {
504  assert(schemaId() == Schema::Id);
505  assert(version() >= Schema::MinimalVersion);
506  assert(TemplateId == templateId());
507  }
508 
509  /// Constant value representing type of flow from CME to
510  /// customer.
516  {
517  return constructStrRef("RECOVERABLE");
518  }
519 
520  /// Constant value representing type of flow from CME to
521  /// customer.
522 
523  /// Matches Negotiate.UUID.
525  UInt64 uuId() const
527  {
529 
530  return ordinary<UInt64>(offset);
531  }
532 
533  /// Matches Negotiate.UUID.
534  ThisType& setUuId(UInt64 value)
536  {
538 
539  setOrdinary(offset, value);
540  return *this;
541  }
542 
543  /// Matches Negotiate.RequestTimestamp.
547  {
549 
550  return ordinary<UInt64>(offset);
551  }
552 
553  /// Matches Negotiate.RequestTimestamp.
554  ThisType& setRequestTimestamp(UInt64 value)
556  {
558 
559  setOrdinary(offset, value);
560  return *this;
561  }
562 
563  /// This indicates in how many days the HMAC secret key will
564  /// expire.
568  {
570 
571  return ordinary(value, offset, NullUInt16());
572  }
573 
574  /// This indicates in how many days the HMAC secret key will
575  /// expire.
578  {
580 
581  setOrdinary(offset, value);
582  return *this;
583  }
584 
587  {
589 
590  setOrdinary(offset, NullUInt16());
591  return *this;
592  }
593 
594  /// Indicates whether the connection is primary or backup.
598  {
600 
601  return enumeration<FTI>(value, offset, NullUInt8());
602  }
603 
604  /// Indicates whether the connection is primary or backup.
607  {
609 
610  setEnumeration<FTI>(offset, value);
611  return *this;
612  }
613 
616  {
618 
619  setOrdinary(offset, NullUInt8());
620  return *this;
621  }
622 
623  /// Indicates whether a message was delayed as a result of
624  /// being split among multiple packets (0) or if a message was
625  /// delayed as a result of TCP re-transmission (1) or if a
626  /// complete message was delayed due to a previously submitted
627  /// split or out of order message (2). If absent then the
628  /// message was not delayed and was neither split nor received
629  /// out of order.
631  bool splitMsg(SplitMsg::Enum& value) const
633  {
635 
636  return enumeration<SplitMsg>(value, offset, NullUInt8());
637  }
638 
639  /// Indicates whether a message was delayed as a result of
640  /// being split among multiple packets (0) or if a message was
641  /// delayed as a result of TCP re-transmission (1) or if a
642  /// complete message was delayed due to a previously submitted
643  /// split or out of order message (2). If absent then the
644  /// message was not delayed and was neither split nor received
645  /// out of order.
646  ThisType& setSplitMsg(SplitMsg::Enum value)
648  {
650 
651  setEnumeration<SplitMsg>(offset, value);
652  return *this;
653  }
654 
655  ThisType& setSplitMsgToNull()
657  {
659 
660  setOrdinary(offset, NullUInt8());
661  return *this;
662  }
663 
664  /// Refers to the SeqNum sent in the previous message before
665  /// this one from CME.
669  {
671 
672  return ordinary<UInt32>(offset);
673  }
674 
675  /// Refers to the SeqNum sent in the previous message before
676  /// this one from CME.
677  ThisType& setPreviousSeqNo(UInt32 value)
679  {
681 
682  setOrdinary(offset, value);
683  return *this;
684  }
685 
686  /// Refers to the UUID sent in the previous message before
687  /// this one from CME.
691  {
693 
694  return ordinary<UInt64>(offset);
695  }
696 
697  /// Refers to the UUID sent in the previous message before
698  /// this one from CME.
699  ThisType& setPreviousUUId(UInt64 value)
701  {
703 
704  setOrdinary(offset, value);
705  return *this;
706  }
707 
708  /// Not used and will be set to 0.
712  {
713  return getVariableLengthField(
714  CredentialsAccess(),
715  *this);
716  }
717 
718  /// Not used and will be set to 0.
719  ThisType& setCredentials(StrRef value)
720  {
721  setVariableLengthField(
722  CredentialsAccess(),
723  value,
724  *this);
725 
726  return *this;
727  }
728 
729  /// Size of message body in bytes.
732  static
735  ONIXS_ILINK3_UNUSED SchemaVersion version)
737  {
738  return
739  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
740  32;
741  }
742 
743  /// Minimal variable fields size (when variable-length fields are empty).
747  static
750  ONIXS_ILINK3_UNUSED SchemaVersion version)
751  {
752  return
753  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
754  DATA::Size;
755  }
756 
757  /// Maximal message size.
763  {
764  return
765  MessageHeaderBuilder::Size +
766  blockLength(Schema::Version) +
767  DATA::Size + (std::numeric_limits<DATA::Length>::max)();
768  }
769 
770  /// Reset all variable-length fields if any.
773  {
774  setCredentialsToNull();
775  return *this;
776  }
777 
778  /// Reset all variable-length and optional fields if any.
779  ThisType& reset()
781  {
782  setSecretKeySecureIdExpirationToNull();
783  setFaultToleranceIndicatorToNull();
784  setSplitMsgToNull();
785 
786  resetVariableFields();
787  return *this;
788  }
789 
790  /// \return class name.
794  static const Char* className()
795  {
796  return "NegotiationResponse501";
797  }
798 
799  /// FIX message type.
803  static StrRef fixType()
805  {
806  return constructStrRef("NegotiationResponse");
807  }
808 
809  /// \return a human-readable presentation.
811  std::string toString() const;
812 
813  /// \return the end of the message.
815  const void* tail() const
817  {
818  return
819  toOpaquePtr(
820  (credentials().end()));
821  }
822 
823  /// \return the size occupied by the message.
827  {
828  return
829  SbeMessage::calculateBinarySize(tail());
830  }
831 
832 private:
833  void checkLength(
834  EncodedLength length, SchemaVersion version) const
835  {
836  const EncodedLength minimalRequiredLength =
837  blockLength(version) +
838  MessageHeader::Size +
839  getMinimalVariableFieldsSize(version);
840 
841  checkBinaryLength(
842  *this, length, minimalRequiredLength);
843  }
844 
845  /// Checks variable fields consistency.
846  void checkVarLenFields() const
847  {
848  variableLengthFields().
849  checkTail<DATA>();
850  }
851 
852  /// Access helper.
853  struct CredentialsAccess
854  {
855  DATA& operator()(
856  const NegotiationResponse501& obj) const
857  {
858  return obj.
859  variableLengthFields().
860  head<DATA>();
861  }
862  };
863 
864  /// Reset the field.
865  /// All the following data will be invalidated.
866  ThisType& setCredentialsToNull()
868  {
869  setVariableLengthFieldToNull(
870  CredentialsAccess(),
871  *this);
872 
873  return *this;
874  }
875 };
876 
877 /// NegotiationReject.
880 : SbeMessage
881 {
882  /// Used template schema.
884 
885  /// This type alias.
887 
888  /// Message template ID from SBE schema.
889  enum { TemplateId = 502 };
890 
891  /// Initializes a blank instance.
892  NegotiationReject502() ONIXS_ILINK3_DEFAULT;
893 
894  /// Initializes an instance over the given memory block.
896  void* data,
897  EncodedLength length,
898  SchemaVersion version = Schema::Version)
899  : SbeMessage(data, length, version)
900  {
901  checkVersion<Schema>(version);
902  checkLength(length, version);
903  initHeader(TemplateId, blockLength(version), Schema::Id);
904  reset();
905  }
906 
907  /// Initializes an instance over the given memory block
908  /// With no variable-length fields initialization
909  /// It is assumed that the user does such an initialization manually.
911  void* data,
912  EncodedLength length,
913  NoFieldsInit,
914  SchemaVersion version = Schema::Version)
915  : SbeMessage(data, length, version)
916  {
917  checkVersion<Schema>(version);
918  checkLength(length, version);
919  initHeader(TemplateId, blockLength(version), Schema::Id);
920  resetVariableFields();
921  }
922 
923  /// Initializes an instance over the existing memory block.
925  void* data,
926  EncodedLength length,
927  NoInit)
928  : SbeMessage(data, length)
929  {
930  assert(TemplateId == templateId());
931 
932  checkSchema<Schema>(schemaId(), version());
933  checkLength(length, version());
934  checkVarLenFields();
935  }
936 
937  /// Initializes an instance over the existing memory block.
938  /// Performs no checks.
940  void* data,
941  EncodedLength length,
942  NoInit,
943  NoCheck)
945  : SbeMessage(data, length, NoCheck())
946  {
947  assert(schemaId() == Schema::Id);
948  assert(version() >= Schema::MinimalVersion);
949  assert(TemplateId == templateId());
950  }
951 
952  /// Reject reason details.
954  bool reason(StrRef& value) const
956  {
959 
960  return fixedStr<length>(value, offset);
961  }
962 
963  /// Reject reason details.
964  ThisType& setReason(StrRef value)
966  {
969 
970  setFixedStr<length>(offset, value);
971  return *this;
972  }
973 
974  ThisType& setReasonToNull()
976  {
979 
980  setFixedStr<length>(offset, makeEmptyStrRef());
981  return *this;
982  }
983 
984  /// Matches Negotiate.UUID.
986  UInt64 uuId() const
988  {
990 
991  return ordinary<UInt64>(offset);
992  }
993 
994  /// Matches Negotiate.UUID.
995  ThisType& setUuId(UInt64 value)
997  {
999 
1000  setOrdinary(offset, value);
1001  return *this;
1002  }
1003 
1004  /// Matches Negotiate.RequestTimestamp.
1008  {
1010 
1011  return ordinary<UInt64>(offset);
1012  }
1013 
1014  /// Matches Negotiate.RequestTimestamp.
1015  ThisType& setRequestTimestamp(UInt64 value)
1017  {
1019 
1020  setOrdinary(offset, value);
1021  return *this;
1022  }
1023 
1024  /// Error code for reject reason.
1028  {
1030 
1031  return ordinary<UInt16>(offset);
1032  }
1033 
1034  /// Error code for reject reason.
1035  ThisType& setErrorCodes(UInt16 value)
1037  {
1039 
1040  setOrdinary(offset, value);
1041  return *this;
1042  }
1043 
1044  /// Indicates whether the connection is primary or backup.
1048  {
1050 
1051  return enumeration<FTI>(value, offset, NullUInt8());
1052  }
1053 
1054  /// Indicates whether the connection is primary or backup.
1057  {
1059 
1060  setEnumeration<FTI>(offset, value);
1061  return *this;
1062  }
1063 
1066  {
1068 
1069  setOrdinary(offset, NullUInt8());
1070  return *this;
1071  }
1072 
1073  /// Indicates whether a message was delayed as a result of
1074  /// being split among multiple packets (0) or if a message was
1075  /// delayed as a result of TCP re-transmission (1) or if a
1076  /// complete message was delayed due to a previously submitted
1077  /// split or out of order message (2). If absent then the
1078  /// message was not delayed and was neither split nor received
1079  /// out of order.
1081  bool splitMsg(SplitMsg::Enum& value) const
1083  {
1085 
1086  return enumeration<SplitMsg>(value, offset, NullUInt8());
1087  }
1088 
1089  /// Indicates whether a message was delayed as a result of
1090  /// being split among multiple packets (0) or if a message was
1091  /// delayed as a result of TCP re-transmission (1) or if a
1092  /// complete message was delayed due to a previously submitted
1093  /// split or out of order message (2). If absent then the
1094  /// message was not delayed and was neither split nor received
1095  /// out of order.
1096  ThisType& setSplitMsg(SplitMsg::Enum value)
1098  {
1100 
1101  setEnumeration<SplitMsg>(offset, value);
1102  return *this;
1103  }
1104 
1105  ThisType& setSplitMsgToNull()
1107  {
1109 
1110  setOrdinary(offset, NullUInt8());
1111  return *this;
1112  }
1113 
1114  /// Size of message body in bytes.
1117  static
1118  BlockLength
1120  ONIXS_ILINK3_UNUSED SchemaVersion version)
1122  {
1123  return
1124  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
1125  68;
1126  }
1127 
1128  /// Minimal variable fields size (when variable-length fields are empty).
1132  static
1133  MessageSize
1135  ONIXS_ILINK3_UNUSED SchemaVersion version)
1136  {
1137  return
1138  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
1139  0;
1140  }
1141 
1142  /// Maximal message size.
1148  {
1149  return
1150  MessageHeaderBuilder::Size +
1151  blockLength(Schema::Version);
1152  }
1153 
1154  /// Reset all variable-length fields if any.
1157  {
1158  return *this;
1159  }
1160 
1161  /// Reset all variable-length and optional fields if any.
1162  ThisType& reset()
1164  {
1165  setReasonToNull();
1166  setFaultToleranceIndicatorToNull();
1167  setSplitMsgToNull();
1168 
1169  resetVariableFields();
1170  return *this;
1171  }
1172 
1173  /// \return class name.
1177  static const Char* className()
1178  {
1179  return "NegotiationReject502";
1180  }
1181 
1182  /// FIX message type.
1186  static StrRef fixType()
1188  {
1189  return constructStrRef("NegotiationReject");
1190  }
1191 
1192  /// \return a human-readable presentation.
1194  std::string toString() const;
1195 
1196  /// \return the end of the message.
1198  const void* tail() const
1200  {
1201  return
1202  toOpaquePtr(
1203  advanceByBytes(
1204  binary(),
1205  SbeMessage::blockLength() +
1206  MessageHeader::Size));
1207  }
1208 
1209  /// \return the size occupied by the message.
1213  {
1214  return
1215  SbeMessage::calculateBinarySize(tail());
1216  }
1217 
1218 private:
1219  void checkLength(
1220  EncodedLength length, SchemaVersion version) const
1221  {
1222  const EncodedLength minimalRequiredLength =
1223  blockLength(version) +
1224  MessageHeader::Size +
1225  getMinimalVariableFieldsSize(version);
1226 
1227  checkBinaryLength(
1228  *this, length, minimalRequiredLength);
1229  }
1230 
1231  /// Checks variable fields consistency.
1232  void checkVarLenFields() const
1233  {
1234  }
1235 };
1236 
1237 /// Establish.
1240 : SbeMessage
1241 {
1242  /// Used template schema.
1244 
1245  /// This type alias.
1247 
1248  /// Message template ID from SBE schema.
1249  enum { TemplateId = 503 };
1250 
1251  /// Initializes a blank instance.
1252  Establish503() ONIXS_ILINK3_DEFAULT;
1253 
1254  /// Initializes an instance over the given memory block.
1256  void* data,
1257  EncodedLength length,
1258  SchemaVersion version = Schema::Version)
1259  : SbeMessage(data, length, version)
1260  {
1261  checkVersion<Schema>(version);
1262  checkLength(length, version);
1263  initHeader(TemplateId, blockLength(version), Schema::Id);
1264  reset();
1265  }
1266 
1267  /// Initializes an instance over the given memory block
1268  /// With no variable-length fields initialization
1269  /// It is assumed that the user does such an initialization manually.
1271  void* data,
1272  EncodedLength length,
1273  NoFieldsInit,
1274  SchemaVersion version = Schema::Version)
1275  : SbeMessage(data, length, version)
1276  {
1277  checkVersion<Schema>(version);
1278  checkLength(length, version);
1279  initHeader(TemplateId, blockLength(version), Schema::Id);
1280  resetVariableFields();
1281  }
1282 
1283  /// Initializes an instance over the existing memory block.
1285  void* data,
1286  EncodedLength length,
1287  NoInit)
1288  : SbeMessage(data, length)
1289  {
1290  assert(TemplateId == templateId());
1291 
1292  checkSchema<Schema>(schemaId(), version());
1293  checkLength(length, version());
1294  checkVarLenFields();
1295  }
1296 
1297  /// Initializes an instance over the existing memory block.
1298  /// Performs no checks.
1300  void* data,
1301  EncodedLength length,
1302  NoInit,
1303  NoCheck)
1305  : SbeMessage(data, length, NoCheck())
1306  {
1307  assert(schemaId() == Schema::Id);
1308  assert(version() >= Schema::MinimalVersion);
1309  assert(TemplateId == templateId());
1310  }
1311 
1312  /// Constant value representing CME HMAC version.
1318  {
1319  return constructStrRef("CME-1-SHA-256");
1320  }
1321 
1322  /// Constant value representing CME HMAC version.
1323 
1324  /// Contains the HMAC signature.
1328  {
1331 
1332  return fixedStr<length>(offset);
1333  }
1334 
1335  /// Contains the HMAC signature.
1336  ThisType& setHmacSignature(StrRef value)
1338  {
1341 
1342  setFixedStr<length>(offset, value);
1343  return *this;
1344  }
1345 
1346  /// Contains the AccessKeyID assigned to this session on this
1347  /// port.
1351  {
1354 
1355  return fixedStr<length>(offset);
1356  }
1357 
1358  /// Contains the AccessKeyID assigned to this session on this
1359  /// port.
1360  ThisType& setAccessKeyId(StrRef value)
1362  {
1365 
1366  setFixedStr<length>(offset, value);
1367  return *this;
1368  }
1369 
1370  /// Provides the name of the application system being used to
1371  /// generate FIX application messages.
1375  {
1378 
1379  return fixedStr<length>(offset);
1380  }
1381 
1382  /// Provides the name of the application system being used to
1383  /// generate FIX application messages.
1384  ThisType& setTradingSystemName(StrRef value)
1386  {
1389 
1390  setFixedStr<length>(offset, value);
1391  return *this;
1392  }
1393 
1394  /// Provides the version of the application system being used
1395  /// to initiate FIX application messages.
1399  {
1402 
1403  return fixedStr<length>(offset);
1404  }
1405 
1406  /// Provides the version of the application system being used
1407  /// to initiate FIX application messages.
1410  {
1413 
1414  setFixedStr<length>(offset, value);
1415  return *this;
1416  }
1417 
1418  /// Provides the vendor of the application system.
1422  {
1425 
1426  return fixedStr<length>(offset);
1427  }
1428 
1429  /// Provides the vendor of the application system.
1432  {
1435 
1436  setFixedStr<length>(offset, value);
1437  return *this;
1438  }
1439 
1440  /// Session Identifier defined as type long (uInt64);
1441  /// recommended to use timestamp as number of microseconds
1442  /// since epoch (Jan 1, 1970).
1444  UInt64 uuId() const
1446  {
1448 
1449  return ordinary<UInt64>(offset);
1450  }
1451 
1452  /// Session Identifier defined as type long (uInt64);
1453  /// recommended to use timestamp as number of microseconds
1454  /// since epoch (Jan 1, 1970).
1455  ThisType& setUuId(UInt64 value)
1457  {
1459 
1460  setOrdinary(offset, value);
1461  return *this;
1462  }
1463 
1464  /// Time of request; recommended to use timestamp as number of
1465  /// nanoseconds since epoch (Jan 1, 1970).
1469  {
1471 
1472  return ordinary<UInt64>(offset);
1473  }
1474 
1475  /// Time of request; recommended to use timestamp as number of
1476  /// nanoseconds since epoch (Jan 1, 1970).
1477  ThisType& setRequestTimestamp(UInt64 value)
1479  {
1481 
1482  setOrdinary(offset, value);
1483  return *this;
1484  }
1485 
1486  /// Next expected message sequence number.
1490  {
1492 
1493  return ordinary<UInt32>(offset);
1494  }
1495 
1496  /// Next expected message sequence number.
1497  ThisType& setNextSeqNo(UInt32 value)
1499  {
1501 
1502  setOrdinary(offset, value);
1503  return *this;
1504  }
1505 
1506  /// Session ID.
1508  StrRef session() const
1510  {
1513 
1514  return fixedStr<length>(offset);
1515  }
1516 
1517  /// Session ID.
1518  ThisType& setSession(StrRef value)
1520  {
1523 
1524  setFixedStr<length>(offset, value);
1525  return *this;
1526  }
1527 
1528  /// Firm ID.
1530  StrRef firm() const
1532  {
1535 
1536  return fixedStr<length>(offset);
1537  }
1538 
1539  /// Firm ID.
1540  ThisType& setFirm(StrRef value)
1542  {
1545 
1546  setFixedStr<length>(offset, value);
1547  return *this;
1548  }
1549 
1550  /// The longest time in milliseconds the customer or CME could
1551  /// remain silent before sending a keep alive message.
1555  {
1557 
1558  return ordinary<UInt16>(offset);
1559  }
1560 
1561  /// The longest time in milliseconds the customer or CME could
1562  /// remain silent before sending a keep alive message.
1563  ThisType& setKeepAliveInterval(UInt16 value)
1565  {
1567 
1568  setOrdinary(offset, value);
1569  return *this;
1570  }
1571 
1572  /// Not used and will be set to 0.
1576  {
1577  return getVariableLengthField(
1578  CredentialsAccess(),
1579  *this);
1580  }
1581 
1582  /// Not used and will be set to 0.
1583  ThisType& setCredentials(StrRef value)
1584  {
1585  setVariableLengthField(
1586  CredentialsAccess(),
1587  value,
1588  *this);
1589 
1590  return *this;
1591  }
1592 
1593  /// Size of message body in bytes.
1596  static
1597  BlockLength
1599  ONIXS_ILINK3_UNUSED SchemaVersion version)
1601  {
1602  return
1603  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
1604  132;
1605  }
1606 
1607  /// Minimal variable fields size (when variable-length fields are empty).
1611  static
1612  MessageSize
1614  ONIXS_ILINK3_UNUSED SchemaVersion version)
1615  {
1616  return
1617  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
1618  DATA::Size;
1619  }
1620 
1621  /// Maximal message size.
1627  {
1628  return
1629  MessageHeaderBuilder::Size +
1630  blockLength(Schema::Version) +
1631  DATA::Size + (std::numeric_limits<DATA::Length>::max)();
1632  }
1633 
1634  /// Reset all variable-length fields if any.
1637  {
1638  setCredentialsToNull();
1639  return *this;
1640  }
1641 
1642  /// Reset all variable-length and optional fields if any.
1643  ThisType& reset()
1645  {
1646  resetVariableFields();
1647  return *this;
1648  }
1649 
1650  /// \return class name.
1654  static const Char* className()
1655  {
1656  return "Establish503";
1657  }
1658 
1659  /// FIX message type.
1663  static StrRef fixType()
1665  {
1666  return constructStrRef("Establish");
1667  }
1668 
1669  /// \return a human-readable presentation.
1671  std::string toString() const;
1672 
1673  /// \return the end of the message.
1675  const void* tail() const
1677  {
1678  return
1679  toOpaquePtr(
1680  (credentials().end()));
1681  }
1682 
1683  /// \return the size occupied by the message.
1687  {
1688  return
1689  SbeMessage::calculateBinarySize(tail());
1690  }
1691 
1692 private:
1693  void checkLength(
1694  EncodedLength length, SchemaVersion version) const
1695  {
1696  const EncodedLength minimalRequiredLength =
1697  blockLength(version) +
1698  MessageHeader::Size +
1699  getMinimalVariableFieldsSize(version);
1700 
1701  checkBinaryLength(
1702  *this, length, minimalRequiredLength);
1703  }
1704 
1705  /// Checks variable fields consistency.
1706  void checkVarLenFields() const
1707  {
1708  variableLengthFields().
1709  checkTail<DATA>();
1710  }
1711 
1712  /// Access helper.
1713  struct CredentialsAccess
1714  {
1715  DATA& operator()(
1716  const Establish503& obj) const
1717  {
1718  return obj.
1719  variableLengthFields().
1720  head<DATA>();
1721  }
1722  };
1723 
1724  /// Reset the field.
1725  /// All the following data will be invalidated.
1726  ThisType& setCredentialsToNull()
1728  {
1729  setVariableLengthFieldToNull(
1730  CredentialsAccess(),
1731  *this);
1732 
1733  return *this;
1734  }
1735 };
1736 
1737 /// EstablishmentAck.
1740 : SbeMessage
1741 {
1742  /// Used template schema.
1744 
1745  /// This type alias.
1747 
1748  /// Message template ID from SBE schema.
1749  enum { TemplateId = 504 };
1750 
1751  /// Initializes a blank instance.
1752  EstablishmentAck504() ONIXS_ILINK3_DEFAULT;
1753 
1754  /// Initializes an instance over the given memory block.
1756  void* data,
1757  EncodedLength length,
1758  SchemaVersion version = Schema::Version)
1759  : SbeMessage(data, length, version)
1760  {
1761  checkVersion<Schema>(version);
1762  checkLength(length, version);
1763  initHeader(TemplateId, blockLength(version), Schema::Id);
1764  reset();
1765  }
1766 
1767  /// Initializes an instance over the given memory block
1768  /// With no variable-length fields initialization
1769  /// It is assumed that the user does such an initialization manually.
1771  void* data,
1772  EncodedLength length,
1773  NoFieldsInit,
1774  SchemaVersion version = Schema::Version)
1775  : SbeMessage(data, length, version)
1776  {
1777  checkVersion<Schema>(version);
1778  checkLength(length, version);
1779  initHeader(TemplateId, blockLength(version), Schema::Id);
1780  resetVariableFields();
1781  }
1782 
1783  /// Initializes an instance over the existing memory block.
1785  void* data,
1786  EncodedLength length,
1787  NoInit)
1788  : SbeMessage(data, length)
1789  {
1790  assert(TemplateId == templateId());
1791 
1792  checkSchema<Schema>(schemaId(), version());
1793  checkLength(length, version());
1794  checkVarLenFields();
1795  }
1796 
1797  /// Initializes an instance over the existing memory block.
1798  /// Performs no checks.
1800  void* data,
1801  EncodedLength length,
1802  NoInit,
1803  NoCheck)
1805  : SbeMessage(data, length, NoCheck())
1806  {
1807  assert(schemaId() == Schema::Id);
1808  assert(version() >= Schema::MinimalVersion);
1809  assert(TemplateId == templateId());
1810  }
1811 
1812  /// Matches Establish.UUID.
1814  UInt64 uuId() const
1816  {
1818 
1819  return ordinary<UInt64>(offset);
1820  }
1821 
1822  /// Matches Establish.UUID.
1823  ThisType& setUuId(UInt64 value)
1825  {
1827 
1828  setOrdinary(offset, value);
1829  return *this;
1830  }
1831 
1832  /// Matches Establish.RequestTimestamp.
1836  {
1838 
1839  return ordinary<UInt64>(offset);
1840  }
1841 
1842  /// Matches Establish.RequestTimestamp.
1843  ThisType& setRequestTimestamp(UInt64 value)
1845  {
1847 
1848  setOrdinary(offset, value);
1849  return *this;
1850  }
1851 
1852  /// Next expected message sequence number.
1856  {
1858 
1859  return ordinary<UInt32>(offset);
1860  }
1861 
1862  /// Next expected message sequence number.
1863  ThisType& setNextSeqNo(UInt32 value)
1865  {
1867 
1868  setOrdinary(offset, value);
1869  return *this;
1870  }
1871 
1872  /// Refers to the SeqNum sent in the previous message before
1873  /// this one from CME.
1877  {
1879 
1880  return ordinary<UInt32>(offset);
1881  }
1882 
1883  /// Refers to the SeqNum sent in the previous message before
1884  /// this one from CME.
1885  ThisType& setPreviousSeqNo(UInt32 value)
1887  {
1889 
1890  setOrdinary(offset, value);
1891  return *this;
1892  }
1893 
1894  /// Refers to the UUID sent in the previous message before
1895  /// this one from CME.
1899  {
1901 
1902  return ordinary<UInt64>(offset);
1903  }
1904 
1905  /// Refers to the UUID sent in the previous message before
1906  /// this one from CME.
1907  ThisType& setPreviousUUId(UInt64 value)
1909  {
1911 
1912  setOrdinary(offset, value);
1913  return *this;
1914  }
1915 
1916  /// The longest time in milliseconds the customer or CME could
1917  /// remain silent before sending a keep alive message.
1921  {
1923 
1924  return ordinary<UInt16>(offset);
1925  }
1926 
1927  /// The longest time in milliseconds the customer or CME could
1928  /// remain silent before sending a keep alive message.
1929  ThisType& setKeepAliveInterval(UInt16 value)
1931  {
1933 
1934  setOrdinary(offset, value);
1935  return *this;
1936  }
1937 
1938  /// This indicates in how many days the HMAC secret key will
1939  /// expire.
1943  {
1945 
1946  return ordinary(value, offset, NullUInt16());
1947  }
1948 
1949  /// This indicates in how many days the HMAC secret key will
1950  /// expire.
1953  {
1955 
1956  setOrdinary(offset, value);
1957  return *this;
1958  }
1959 
1962  {
1964 
1965  setOrdinary(offset, NullUInt16());
1966  return *this;
1967  }
1968 
1969  /// Indicates whether the connection is primary or backup.
1973  {
1975 
1976  return enumeration<FTI>(value, offset, NullUInt8());
1977  }
1978 
1979  /// Indicates whether the connection is primary or backup.
1982  {
1984 
1985  setEnumeration<FTI>(offset, value);
1986  return *this;
1987  }
1988 
1991  {
1993 
1994  setOrdinary(offset, NullUInt8());
1995  return *this;
1996  }
1997 
1998  /// Indicates whether a message was delayed as a result of
1999  /// being split among multiple packets (0) or if a message was
2000  /// delayed as a result of TCP re-transmission (1) or if a
2001  /// complete message was delayed due to a previously submitted
2002  /// split or out of order message (2). If absent then the
2003  /// message was not delayed and was neither split nor received
2004  /// out of order.
2006  bool splitMsg(SplitMsg::Enum& value) const
2008  {
2010 
2011  return enumeration<SplitMsg>(value, offset, NullUInt8());
2012  }
2013 
2014  /// Indicates whether a message was delayed as a result of
2015  /// being split among multiple packets (0) or if a message was
2016  /// delayed as a result of TCP re-transmission (1) or if a
2017  /// complete message was delayed due to a previously submitted
2018  /// split or out of order message (2). If absent then the
2019  /// message was not delayed and was neither split nor received
2020  /// out of order.
2021  ThisType& setSplitMsg(SplitMsg::Enum value)
2023  {
2025 
2026  setEnumeration<SplitMsg>(offset, value);
2027  return *this;
2028  }
2029 
2030  ThisType& setSplitMsgToNull()
2032  {
2034 
2035  setOrdinary(offset, NullUInt8());
2036  return *this;
2037  }
2038 
2039  /// Size of message body in bytes.
2042  static
2043  BlockLength
2045  ONIXS_ILINK3_UNUSED SchemaVersion version)
2047  {
2048  return
2049  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
2050  38;
2051  }
2052 
2053  /// Minimal variable fields size (when variable-length fields are empty).
2057  static
2058  MessageSize
2060  ONIXS_ILINK3_UNUSED SchemaVersion version)
2061  {
2062  return
2063  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
2064  0;
2065  }
2066 
2067  /// Maximal message size.
2073  {
2074  return
2075  MessageHeaderBuilder::Size +
2076  blockLength(Schema::Version);
2077  }
2078 
2079  /// Reset all variable-length fields if any.
2082  {
2083  return *this;
2084  }
2085 
2086  /// Reset all variable-length and optional fields if any.
2087  ThisType& reset()
2089  {
2090  setSecretKeySecureIdExpirationToNull();
2091  setFaultToleranceIndicatorToNull();
2092  setSplitMsgToNull();
2093 
2094  resetVariableFields();
2095  return *this;
2096  }
2097 
2098  /// \return class name.
2102  static const Char* className()
2103  {
2104  return "EstablishmentAck504";
2105  }
2106 
2107  /// FIX message type.
2111  static StrRef fixType()
2113  {
2114  return constructStrRef("EstablishmentAck");
2115  }
2116 
2117  /// \return a human-readable presentation.
2119  std::string toString() const;
2120 
2121  /// \return the end of the message.
2123  const void* tail() const
2125  {
2126  return
2127  toOpaquePtr(
2128  advanceByBytes(
2129  binary(),
2130  SbeMessage::blockLength() +
2131  MessageHeader::Size));
2132  }
2133 
2134  /// \return the size occupied by the message.
2138  {
2139  return
2140  SbeMessage::calculateBinarySize(tail());
2141  }
2142 
2143 private:
2144  void checkLength(
2145  EncodedLength length, SchemaVersion version) const
2146  {
2147  const EncodedLength minimalRequiredLength =
2148  blockLength(version) +
2149  MessageHeader::Size +
2150  getMinimalVariableFieldsSize(version);
2151 
2152  checkBinaryLength(
2153  *this, length, minimalRequiredLength);
2154  }
2155 
2156  /// Checks variable fields consistency.
2157  void checkVarLenFields() const
2158  {
2159  }
2160 };
2161 
2162 /// EstablishmentReject.
2165 : SbeMessage
2166 {
2167  /// Used template schema.
2169 
2170  /// This type alias.
2172 
2173  /// Message template ID from SBE schema.
2174  enum { TemplateId = 505 };
2175 
2176  /// Initializes a blank instance.
2177  EstablishmentReject505() ONIXS_ILINK3_DEFAULT;
2178 
2179  /// Initializes an instance over the given memory block.
2181  void* data,
2182  EncodedLength length,
2183  SchemaVersion version = Schema::Version)
2184  : SbeMessage(data, length, version)
2185  {
2186  checkVersion<Schema>(version);
2187  checkLength(length, version);
2188  initHeader(TemplateId, blockLength(version), Schema::Id);
2189  reset();
2190  }
2191 
2192  /// Initializes an instance over the given memory block
2193  /// With no variable-length fields initialization
2194  /// It is assumed that the user does such an initialization manually.
2196  void* data,
2197  EncodedLength length,
2198  NoFieldsInit,
2199  SchemaVersion version = Schema::Version)
2200  : SbeMessage(data, length, version)
2201  {
2202  checkVersion<Schema>(version);
2203  checkLength(length, version);
2204  initHeader(TemplateId, blockLength(version), Schema::Id);
2205  resetVariableFields();
2206  }
2207 
2208  /// Initializes an instance over the existing memory block.
2210  void* data,
2211  EncodedLength length,
2212  NoInit)
2213  : SbeMessage(data, length)
2214  {
2215  assert(TemplateId == templateId());
2216 
2217  checkSchema<Schema>(schemaId(), version());
2218  checkLength(length, version());
2219  checkVarLenFields();
2220  }
2221 
2222  /// Initializes an instance over the existing memory block.
2223  /// Performs no checks.
2225  void* data,
2226  EncodedLength length,
2227  NoInit,
2228  NoCheck)
2230  : SbeMessage(data, length, NoCheck())
2231  {
2232  assert(schemaId() == Schema::Id);
2233  assert(version() >= Schema::MinimalVersion);
2234  assert(TemplateId == templateId());
2235  }
2236 
2237  /// Reject reason details.
2239  bool reason(StrRef& value) const
2241  {
2244 
2245  return fixedStr<length>(value, offset);
2246  }
2247 
2248  /// Reject reason details.
2249  ThisType& setReason(StrRef value)
2251  {
2254 
2255  setFixedStr<length>(offset, value);
2256  return *this;
2257  }
2258 
2259  ThisType& setReasonToNull()
2261  {
2264 
2265  setFixedStr<length>(offset, makeEmptyStrRef());
2266  return *this;
2267  }
2268 
2269  /// Matches Establish.UUID.
2271  UInt64 uuId() const
2273  {
2275 
2276  return ordinary<UInt64>(offset);
2277  }
2278 
2279  /// Matches Establish.UUID.
2280  ThisType& setUuId(UInt64 value)
2282  {
2284 
2285  setOrdinary(offset, value);
2286  return *this;
2287  }
2288 
2289  /// Matches Establish.RequestTimestamp.
2293  {
2295 
2296  return ordinary<UInt64>(offset);
2297  }
2298 
2299  /// Matches Establish.RequestTimestamp.
2300  ThisType& setRequestTimestamp(UInt64 value)
2302  {
2304 
2305  setOrdinary(offset, value);
2306  return *this;
2307  }
2308 
2309  /// Next expected message sequence number.
2313  {
2315 
2316  return ordinary<UInt32>(offset);
2317  }
2318 
2319  /// Next expected message sequence number.
2320  ThisType& setNextSeqNo(UInt32 value)
2322  {
2324 
2325  setOrdinary(offset, value);
2326  return *this;
2327  }
2328 
2329  /// Error code for reject reason.
2333  {
2335 
2336  return ordinary<UInt16>(offset);
2337  }
2338 
2339  /// Error code for reject reason.
2340  ThisType& setErrorCodes(UInt16 value)
2342  {
2344 
2345  setOrdinary(offset, value);
2346  return *this;
2347  }
2348 
2349  /// Indicates whether the connection is primary or backup.
2353  {
2355 
2356  return enumeration<FTI>(value, offset, NullUInt8());
2357  }
2358 
2359  /// Indicates whether the connection is primary or backup.
2362  {
2364 
2365  setEnumeration<FTI>(offset, value);
2366  return *this;
2367  }
2368 
2371  {
2373 
2374  setOrdinary(offset, NullUInt8());
2375  return *this;
2376  }
2377 
2378  /// Indicates whether a message was delayed as a result of
2379  /// being split among multiple packets (0) or if a message was
2380  /// delayed as a result of TCP re-transmission (1) or if a
2381  /// complete message was delayed due to a previously submitted
2382  /// split or out of order message (2). If absent then the
2383  /// message was not delayed and was neither split nor received
2384  /// out of order.
2386  bool splitMsg(SplitMsg::Enum& value) const
2388  {
2390 
2391  return enumeration<SplitMsg>(value, offset, NullUInt8());
2392  }
2393 
2394  /// Indicates whether a message was delayed as a result of
2395  /// being split among multiple packets (0) or if a message was
2396  /// delayed as a result of TCP re-transmission (1) or if a
2397  /// complete message was delayed due to a previously submitted
2398  /// split or out of order message (2). If absent then the
2399  /// message was not delayed and was neither split nor received
2400  /// out of order.
2401  ThisType& setSplitMsg(SplitMsg::Enum value)
2403  {
2405 
2406  setEnumeration<SplitMsg>(offset, value);
2407  return *this;
2408  }
2409 
2410  ThisType& setSplitMsgToNull()
2412  {
2414 
2415  setOrdinary(offset, NullUInt8());
2416  return *this;
2417  }
2418 
2419  /// Size of message body in bytes.
2422  static
2423  BlockLength
2425  ONIXS_ILINK3_UNUSED SchemaVersion version)
2427  {
2428  return
2429  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
2430  72;
2431  }
2432 
2433  /// Minimal variable fields size (when variable-length fields are empty).
2437  static
2438  MessageSize
2440  ONIXS_ILINK3_UNUSED SchemaVersion version)
2441  {
2442  return
2443  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
2444  0;
2445  }
2446 
2447  /// Maximal message size.
2453  {
2454  return
2455  MessageHeaderBuilder::Size +
2456  blockLength(Schema::Version);
2457  }
2458 
2459  /// Reset all variable-length fields if any.
2462  {
2463  return *this;
2464  }
2465 
2466  /// Reset all variable-length and optional fields if any.
2467  ThisType& reset()
2469  {
2470  setReasonToNull();
2471  setFaultToleranceIndicatorToNull();
2472  setSplitMsgToNull();
2473 
2474  resetVariableFields();
2475  return *this;
2476  }
2477 
2478  /// \return class name.
2482  static const Char* className()
2483  {
2484  return "EstablishmentReject505";
2485  }
2486 
2487  /// FIX message type.
2491  static StrRef fixType()
2493  {
2494  return constructStrRef("EstablishmentReject");
2495  }
2496 
2497  /// \return a human-readable presentation.
2499  std::string toString() const;
2500 
2501  /// \return the end of the message.
2503  const void* tail() const
2505  {
2506  return
2507  toOpaquePtr(
2508  advanceByBytes(
2509  binary(),
2510  SbeMessage::blockLength() +
2511  MessageHeader::Size));
2512  }
2513 
2514  /// \return the size occupied by the message.
2518  {
2519  return
2520  SbeMessage::calculateBinarySize(tail());
2521  }
2522 
2523 private:
2524  void checkLength(
2525  EncodedLength length, SchemaVersion version) const
2526  {
2527  const EncodedLength minimalRequiredLength =
2528  blockLength(version) +
2529  MessageHeader::Size +
2530  getMinimalVariableFieldsSize(version);
2531 
2532  checkBinaryLength(
2533  *this, length, minimalRequiredLength);
2534  }
2535 
2536  /// Checks variable fields consistency.
2537  void checkVarLenFields() const
2538  {
2539  }
2540 };
2541 
2542 /// Sequence.
2545 : SbeMessage
2546 {
2547  /// Used template schema.
2549 
2550  /// This type alias.
2552 
2553  /// Message template ID from SBE schema.
2554  enum { TemplateId = 506 };
2555 
2556  /// Initializes a blank instance.
2557  Sequence506() ONIXS_ILINK3_DEFAULT;
2558 
2559  /// Initializes an instance over the given memory block.
2561  void* data,
2562  EncodedLength length,
2563  SchemaVersion version = Schema::Version)
2564  : SbeMessage(data, length, version)
2565  {
2566  checkVersion<Schema>(version);
2567  checkLength(length, version);
2568  initHeader(TemplateId, blockLength(version), Schema::Id);
2569  reset();
2570  }
2571 
2572  /// Initializes an instance over the given memory block
2573  /// With no variable-length fields initialization
2574  /// It is assumed that the user does such an initialization manually.
2576  void* data,
2577  EncodedLength length,
2578  NoFieldsInit,
2579  SchemaVersion version = Schema::Version)
2580  : SbeMessage(data, length, version)
2581  {
2582  checkVersion<Schema>(version);
2583  checkLength(length, version);
2584  initHeader(TemplateId, blockLength(version), Schema::Id);
2585  resetVariableFields();
2586  }
2587 
2588  /// Initializes an instance over the existing memory block.
2590  void* data,
2591  EncodedLength length,
2592  NoInit)
2593  : SbeMessage(data, length)
2594  {
2595  assert(TemplateId == templateId());
2596 
2597  checkSchema<Schema>(schemaId(), version());
2598  checkLength(length, version());
2599  checkVarLenFields();
2600  }
2601 
2602  /// Initializes an instance over the existing memory block.
2603  /// Performs no checks.
2605  void* data,
2606  EncodedLength length,
2607  NoInit,
2608  NoCheck)
2610  : SbeMessage(data, length, NoCheck())
2611  {
2612  assert(schemaId() == Schema::Id);
2613  assert(version() >= Schema::MinimalVersion);
2614  assert(TemplateId == templateId());
2615  }
2616 
2617  /// Matches Establish.UUID used to establish the connection.
2619  UInt64 uuId() const
2621  {
2623 
2624  return ordinary<UInt64>(offset);
2625  }
2626 
2627  /// Matches Establish.UUID used to establish the connection.
2628  ThisType& setUuId(UInt64 value)
2630  {
2632 
2633  setOrdinary(offset, value);
2634  return *this;
2635  }
2636 
2637  /// Next expected message sequence number.
2641  {
2643 
2644  return ordinary<UInt32>(offset);
2645  }
2646 
2647  /// Next expected message sequence number.
2648  ThisType& setNextSeqNo(UInt32 value)
2650  {
2652 
2653  setOrdinary(offset, value);
2654  return *this;
2655  }
2656 
2657  /// Indicates whether the connection is primary or backup.
2661  {
2663 
2664  return enumeration<FTI>(value, offset, NullUInt8());
2665  }
2666 
2667  /// Indicates whether the connection is primary or backup.
2670  {
2672 
2673  setEnumeration<FTI>(offset, value);
2674  return *this;
2675  }
2676 
2679  {
2681 
2682  setOrdinary(offset, NullUInt8());
2683  return *this;
2684  }
2685 
2686  /// This indicates if the Sequence message being sent by CME
2687  /// is to warn that one keep alive interval has lapsed without
2688  /// any message received from customer (this can also be sent
2689  /// from customer to CME).
2693  {
2695 
2696  return enumeration<KeepAliveLapsed>(offset);
2697  }
2698 
2699  /// This indicates if the Sequence message being sent by CME
2700  /// is to warn that one keep alive interval has lapsed without
2701  /// any message received from customer (this can also be sent
2702  /// from customer to CME).
2703  ThisType&
2705  KeepAliveLapsed::Enum value)
2707  {
2709 
2710  setEnumeration<KeepAliveLapsed>(offset, value);
2711  return *this;
2712  }
2713 
2714  /// Size of message body in bytes.
2717  static
2718  BlockLength
2720  ONIXS_ILINK3_UNUSED SchemaVersion version)
2722  {
2723  return
2724  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
2725  14;
2726  }
2727 
2728  /// Minimal variable fields size (when variable-length fields are empty).
2732  static
2733  MessageSize
2735  ONIXS_ILINK3_UNUSED SchemaVersion version)
2736  {
2737  return
2738  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
2739  0;
2740  }
2741 
2742  /// Maximal message size.
2748  {
2749  return
2750  MessageHeaderBuilder::Size +
2751  blockLength(Schema::Version);
2752  }
2753 
2754  /// Reset all variable-length fields if any.
2757  {
2758  return *this;
2759  }
2760 
2761  /// Reset all variable-length and optional fields if any.
2762  ThisType& reset()
2764  {
2765  setFaultToleranceIndicatorToNull();
2766 
2767  resetVariableFields();
2768  return *this;
2769  }
2770 
2771  /// \return class name.
2775  static const Char* className()
2776  {
2777  return "Sequence506";
2778  }
2779 
2780  /// FIX message type.
2784  static StrRef fixType()
2786  {
2787  return constructStrRef("Sequence");
2788  }
2789 
2790  /// \return a human-readable presentation.
2792  std::string toString() const;
2793 
2794  /// \return the end of the message.
2796  const void* tail() const
2798  {
2799  return
2800  toOpaquePtr(
2801  advanceByBytes(
2802  binary(),
2803  SbeMessage::blockLength() +
2804  MessageHeader::Size));
2805  }
2806 
2807  /// \return the size occupied by the message.
2811  {
2812  return
2813  SbeMessage::calculateBinarySize(tail());
2814  }
2815 
2816 private:
2817  void checkLength(
2818  EncodedLength length, SchemaVersion version) const
2819  {
2820  const EncodedLength minimalRequiredLength =
2821  blockLength(version) +
2822  MessageHeader::Size +
2823  getMinimalVariableFieldsSize(version);
2824 
2825  checkBinaryLength(
2826  *this, length, minimalRequiredLength);
2827  }
2828 
2829  /// Checks variable fields consistency.
2830  void checkVarLenFields() const
2831  {
2832  }
2833 };
2834 
2835 /// Terminate.
2838 : SbeMessage
2839 {
2840  /// Used template schema.
2842 
2843  /// This type alias.
2845 
2846  /// Message template ID from SBE schema.
2847  enum { TemplateId = 507 };
2848 
2849  /// Initializes a blank instance.
2850  Terminate507() ONIXS_ILINK3_DEFAULT;
2851 
2852  /// Initializes an instance over the given memory block.
2854  void* data,
2855  EncodedLength length,
2856  SchemaVersion version = Schema::Version)
2857  : SbeMessage(data, length, version)
2858  {
2859  checkVersion<Schema>(version);
2860  checkLength(length, version);
2861  initHeader(TemplateId, blockLength(version), Schema::Id);
2862  reset();
2863  }
2864 
2865  /// Initializes an instance over the given memory block
2866  /// With no variable-length fields initialization
2867  /// It is assumed that the user does such an initialization manually.
2869  void* data,
2870  EncodedLength length,
2871  NoFieldsInit,
2872  SchemaVersion version = Schema::Version)
2873  : SbeMessage(data, length, version)
2874  {
2875  checkVersion<Schema>(version);
2876  checkLength(length, version);
2877  initHeader(TemplateId, blockLength(version), Schema::Id);
2878  resetVariableFields();
2879  }
2880 
2881  /// Initializes an instance over the existing memory block.
2883  void* data,
2884  EncodedLength length,
2885  NoInit)
2886  : SbeMessage(data, length)
2887  {
2888  assert(TemplateId == templateId());
2889 
2890  checkSchema<Schema>(schemaId(), version());
2891  checkLength(length, version());
2892  checkVarLenFields();
2893  }
2894 
2895  /// Initializes an instance over the existing memory block.
2896  /// Performs no checks.
2898  void* data,
2899  EncodedLength length,
2900  NoInit,
2901  NoCheck)
2903  : SbeMessage(data, length, NoCheck())
2904  {
2905  assert(schemaId() == Schema::Id);
2906  assert(version() >= Schema::MinimalVersion);
2907  assert(TemplateId == templateId());
2908  }
2909 
2910  /// Reject reason details.
2912  bool reason(StrRef& value) const
2914  {
2917 
2918  return fixedStr<length>(value, offset);
2919  }
2920 
2921  /// Reject reason details.
2922  ThisType& setReason(StrRef value)
2924  {
2927 
2928  setFixedStr<length>(offset, value);
2929  return *this;
2930  }
2931 
2932  ThisType& setReasonToNull()
2934  {
2937 
2938  setFixedStr<length>(offset, makeEmptyStrRef());
2939  return *this;
2940  }
2941 
2942  /// Matches Establish.UUID used to establish the connection.
2944  UInt64 uuId() const
2946  {
2948 
2949  return ordinary<UInt64>(offset);
2950  }
2951 
2952  /// Matches Establish.UUID used to establish the connection.
2953  ThisType& setUuId(UInt64 value)
2955  {
2957 
2958  setOrdinary(offset, value);
2959  return *this;
2960  }
2961 
2962  /// Time of request; recommended to use timestamp as number of
2963  /// nanoseconds since epoch (Jan 1, 1970).
2967  {
2969 
2970  return ordinary<UInt64>(offset);
2971  }
2972 
2973  /// Time of request; recommended to use timestamp as number of
2974  /// nanoseconds since epoch (Jan 1, 1970).
2975  ThisType& setRequestTimestamp(UInt64 value)
2977  {
2979 
2980  setOrdinary(offset, value);
2981  return *this;
2982  }
2983 
2984  /// Error code for reject reason.
2988  {
2990 
2991  return ordinary<UInt16>(offset);
2992  }
2993 
2994  /// Error code for reject reason.
2995  ThisType& setErrorCodes(UInt16 value)
2997  {
2999 
3000  setOrdinary(offset, value);
3001  return *this;
3002  }
3003 
3004  /// Indicates whether a message was delayed as a result of
3005  /// being split among multiple packets (0) or if a message was
3006  /// delayed as a result of TCP re-transmission (1) or if a
3007  /// complete message was delayed due to a previously submitted
3008  /// split or out of order message (2). If absent then the
3009  /// message was not delayed and was neither split nor received
3010  /// out of order.
3012  bool splitMsg(SplitMsg::Enum& value) const
3014  {
3016 
3017  return enumeration<SplitMsg>(value, offset, NullUInt8());
3018  }
3019 
3020  /// Indicates whether a message was delayed as a result of
3021  /// being split among multiple packets (0) or if a message was
3022  /// delayed as a result of TCP re-transmission (1) or if a
3023  /// complete message was delayed due to a previously submitted
3024  /// split or out of order message (2). If absent then the
3025  /// message was not delayed and was neither split nor received
3026  /// out of order.
3027  ThisType& setSplitMsg(SplitMsg::Enum value)
3029  {
3031 
3032  setEnumeration<SplitMsg>(offset, value);
3033  return *this;
3034  }
3035 
3036  ThisType& setSplitMsgToNull()
3038  {
3040 
3041  setOrdinary(offset, NullUInt8());
3042  return *this;
3043  }
3044 
3045  /// Size of message body in bytes.
3048  static
3049  BlockLength
3051  ONIXS_ILINK3_UNUSED SchemaVersion version)
3053  {
3054  return
3055  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
3056  67;
3057  }
3058 
3059  /// Minimal variable fields size (when variable-length fields are empty).
3063  static
3064  MessageSize
3066  ONIXS_ILINK3_UNUSED SchemaVersion version)
3067  {
3068  return
3069  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
3070  0;
3071  }
3072 
3073  /// Maximal message size.
3079  {
3080  return
3081  MessageHeaderBuilder::Size +
3082  blockLength(Schema::Version);
3083  }
3084 
3085  /// Reset all variable-length fields if any.
3088  {
3089  return *this;
3090  }
3091 
3092  /// Reset all variable-length and optional fields if any.
3093  ThisType& reset()
3095  {
3096  setReasonToNull();
3097  setSplitMsgToNull();
3098 
3099  resetVariableFields();
3100  return *this;
3101  }
3102 
3103  /// \return class name.
3107  static const Char* className()
3108  {
3109  return "Terminate507";
3110  }
3111 
3112  /// FIX message type.
3116  static StrRef fixType()
3118  {
3119  return constructStrRef("Terminate");
3120  }
3121 
3122  /// \return a human-readable presentation.
3124  std::string toString() const;
3125 
3126  /// \return the end of the message.
3128  const void* tail() const
3130  {
3131  return
3132  toOpaquePtr(
3133  advanceByBytes(
3134  binary(),
3135  SbeMessage::blockLength() +
3136  MessageHeader::Size));
3137  }
3138 
3139  /// \return the size occupied by the message.
3143  {
3144  return
3145  SbeMessage::calculateBinarySize(tail());
3146  }
3147 
3148 private:
3149  void checkLength(
3150  EncodedLength length, SchemaVersion version) const
3151  {
3152  const EncodedLength minimalRequiredLength =
3153  blockLength(version) +
3154  MessageHeader::Size +
3155  getMinimalVariableFieldsSize(version);
3156 
3157  checkBinaryLength(
3158  *this, length, minimalRequiredLength);
3159  }
3160 
3161  /// Checks variable fields consistency.
3162  void checkVarLenFields() const
3163  {
3164  }
3165 };
3166 
3167 /// RetransmitRequest.
3170 : SbeMessage
3171 {
3172  /// Used template schema.
3174 
3175  /// This type alias.
3177 
3178  /// Message template ID from SBE schema.
3179  enum { TemplateId = 508 };
3180 
3181  /// Initializes a blank instance.
3182  RetransmitRequest508() ONIXS_ILINK3_DEFAULT;
3183 
3184  /// Initializes an instance over the given memory block.
3186  void* data,
3187  EncodedLength length,
3188  SchemaVersion version = Schema::Version)
3189  : SbeMessage(data, length, version)
3190  {
3191  checkVersion<Schema>(version);
3192  checkLength(length, version);
3193  initHeader(TemplateId, blockLength(version), Schema::Id);
3194  reset();
3195  }
3196 
3197  /// Initializes an instance over the given memory block
3198  /// With no variable-length fields initialization
3199  /// It is assumed that the user does such an initialization manually.
3201  void* data,
3202  EncodedLength length,
3203  NoFieldsInit,
3204  SchemaVersion version = Schema::Version)
3205  : SbeMessage(data, length, version)
3206  {
3207  checkVersion<Schema>(version);
3208  checkLength(length, version);
3209  initHeader(TemplateId, blockLength(version), Schema::Id);
3210  resetVariableFields();
3211  }
3212 
3213  /// Initializes an instance over the existing memory block.
3215  void* data,
3216  EncodedLength length,
3217  NoInit)
3218  : SbeMessage(data, length)
3219  {
3220  assert(TemplateId == templateId());
3221 
3222  checkSchema<Schema>(schemaId(), version());
3223  checkLength(length, version());
3224  checkVarLenFields();
3225  }
3226 
3227  /// Initializes an instance over the existing memory block.
3228  /// Performs no checks.
3230  void* data,
3231  EncodedLength length,
3232  NoInit,
3233  NoCheck)
3235  : SbeMessage(data, length, NoCheck())
3236  {
3237  assert(schemaId() == Schema::Id);
3238  assert(version() >= Schema::MinimalVersion);
3239  assert(TemplateId == templateId());
3240  }
3241 
3242  /// Matches Establish.UUID.
3244  UInt64 uuId() const
3246  {
3248 
3249  return ordinary<UInt64>(offset);
3250  }
3251 
3252  /// Matches Establish.UUID.
3253  ThisType& setUuId(UInt64 value)
3255  {
3257 
3258  setOrdinary(offset, value);
3259  return *this;
3260  }
3261 
3262  /// If RetransmitRequest is for a previous UUID then put that
3263  /// here otherwise put default null value.
3265  bool lastUUId(UInt64& value) const
3267  {
3269 
3270  return ordinary(value, offset, NullUInt64());
3271  }
3272 
3273  /// If RetransmitRequest is for a previous UUID then put that
3274  /// here otherwise put default null value.
3275  ThisType& setLastUUId(UInt64 value)
3277  {
3279 
3280  setOrdinary(offset, value);
3281  return *this;
3282  }
3283 
3284  ThisType& setLastUUIdToNull()
3286  {
3288 
3289  setOrdinary(offset, NullUInt64());
3290  return *this;
3291  }
3292 
3293  /// Time of request; recommended to use timestamp as number of
3294  /// nanoseconds since epoch (Jan 1, 1970).
3298  {
3300 
3301  return ordinary<UInt64>(offset);
3302  }
3303 
3304  /// Time of request; recommended to use timestamp as number of
3305  /// nanoseconds since epoch (Jan 1, 1970).
3306  ThisType& setRequestTimestamp(UInt64 value)
3308  {
3310 
3311  setOrdinary(offset, value);
3312  return *this;
3313  }
3314 
3315  /// Sequence number of the first business message requested.
3316  /// This should not be greater than the latest sequence number
3317  /// from CME.
3321  {
3323 
3324  return ordinary<UInt32>(offset);
3325  }
3326 
3327  /// Sequence number of the first business message requested.
3328  /// This should not be greater than the latest sequence number
3329  /// from CME.
3330  ThisType& setFromSeqNo(UInt32 value)
3332  {
3334 
3335  setOrdinary(offset, value);
3336  return *this;
3337  }
3338 
3339  /// Count of business messages requested.
3343  {
3345 
3346  return ordinary<UInt16>(offset);
3347  }
3348 
3349  /// Count of business messages requested.
3350  ThisType& setMsgCount(UInt16 value)
3352  {
3354 
3355  setOrdinary(offset, value);
3356  return *this;
3357  }
3358 
3359  /// Size of message body in bytes.
3362  static
3363  BlockLength
3365  ONIXS_ILINK3_UNUSED SchemaVersion version)
3367  {
3368  return
3369  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
3370  30;
3371  }
3372 
3373  /// Minimal variable fields size (when variable-length fields are empty).
3377  static
3378  MessageSize
3380  ONIXS_ILINK3_UNUSED SchemaVersion version)
3381  {
3382  return
3383  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
3384  0;
3385  }
3386 
3387  /// Maximal message size.
3393  {
3394  return
3395  MessageHeaderBuilder::Size +
3396  blockLength(Schema::Version);
3397  }
3398 
3399  /// Reset all variable-length fields if any.
3402  {
3403  return *this;
3404  }
3405 
3406  /// Reset all variable-length and optional fields if any.
3407  ThisType& reset()
3409  {
3410  setLastUUIdToNull();
3411 
3412  resetVariableFields();
3413  return *this;
3414  }
3415 
3416  /// \return class name.
3420  static const Char* className()
3421  {
3422  return "RetransmitRequest508";
3423  }
3424 
3425  /// FIX message type.
3429  static StrRef fixType()
3431  {
3432  return constructStrRef("RetransmitRequest");
3433  }
3434 
3435  /// \return a human-readable presentation.
3437  std::string toString() const;
3438 
3439  /// \return the end of the message.
3441  const void* tail() const
3443  {
3444  return
3445  toOpaquePtr(
3446  advanceByBytes(
3447  binary(),
3448  SbeMessage::blockLength() +
3449  MessageHeader::Size));
3450  }
3451 
3452  /// \return the size occupied by the message.
3456  {
3457  return
3458  SbeMessage::calculateBinarySize(tail());
3459  }
3460 
3461 private:
3462  void checkLength(
3463  EncodedLength length, SchemaVersion version) const
3464  {
3465  const EncodedLength minimalRequiredLength =
3466  blockLength(version) +
3467  MessageHeader::Size +
3468  getMinimalVariableFieldsSize(version);
3469 
3470  checkBinaryLength(
3471  *this, length, minimalRequiredLength);
3472  }
3473 
3474  /// Checks variable fields consistency.
3475  void checkVarLenFields() const
3476  {
3477  }
3478 };
3479 
3480 /// Retransmission.
3483 : SbeMessage
3484 {
3485  /// Used template schema.
3487 
3488  /// This type alias.
3490 
3491  /// Message template ID from SBE schema.
3492  enum { TemplateId = 509 };
3493 
3494  /// Initializes a blank instance.
3495  Retransmission509() ONIXS_ILINK3_DEFAULT;
3496 
3497  /// Initializes an instance over the given memory block.
3499  void* data,
3500  EncodedLength length,
3501  SchemaVersion version = Schema::Version)
3502  : SbeMessage(data, length, version)
3503  {
3504  checkVersion<Schema>(version);
3505  checkLength(length, version);
3506  initHeader(TemplateId, blockLength(version), Schema::Id);
3507  reset();
3508  }
3509 
3510  /// Initializes an instance over the given memory block
3511  /// With no variable-length fields initialization
3512  /// It is assumed that the user does such an initialization manually.
3514  void* data,
3515  EncodedLength length,
3516  NoFieldsInit,
3517  SchemaVersion version = Schema::Version)
3518  : SbeMessage(data, length, version)
3519  {
3520  checkVersion<Schema>(version);
3521  checkLength(length, version);
3522  initHeader(TemplateId, blockLength(version), Schema::Id);
3523  resetVariableFields();
3524  }
3525 
3526  /// Initializes an instance over the existing memory block.
3528  void* data,
3529  EncodedLength length,
3530  NoInit)
3531  : SbeMessage(data, length)
3532  {
3533  assert(TemplateId == templateId());
3534 
3535  checkSchema<Schema>(schemaId(), version());
3536  checkLength(length, version());
3537  checkVarLenFields();
3538  }
3539 
3540  /// Initializes an instance over the existing memory block.
3541  /// Performs no checks.
3543  void* data,
3544  EncodedLength length,
3545  NoInit,
3546  NoCheck)
3548  : SbeMessage(data, length, NoCheck())
3549  {
3550  assert(schemaId() == Schema::Id);
3551  assert(version() >= Schema::MinimalVersion);
3552  assert(TemplateId == templateId());
3553  }
3554 
3555  /// Matches RetransmitRequest.UUID.
3557  UInt64 uuId() const
3559  {
3561 
3562  return ordinary<UInt64>(offset);
3563  }
3564 
3565  /// Matches RetransmitRequest.UUID.
3566  ThisType& setUuId(UInt64 value)
3568  {
3570 
3571  setOrdinary(offset, value);
3572  return *this;
3573  }
3574 
3575  /// Matches RetransmitRequest.LastUUID.
3577  bool lastUUId(UInt64& value) const
3579  {
3581 
3582  return ordinary(value, offset, NullUInt64());
3583  }
3584 
3585  /// Matches RetransmitRequest.LastUUID.
3586  ThisType& setLastUUId(UInt64 value)
3588  {
3590 
3591  setOrdinary(offset, value);
3592  return *this;
3593  }
3594 
3595  ThisType& setLastUUIdToNull()
3597  {
3599 
3600  setOrdinary(offset, NullUInt64());
3601  return *this;
3602  }
3603 
3604  /// Matches RetransmitRequest.RequestTimestamp.
3608  {
3610 
3611  return ordinary<UInt64>(offset);
3612  }
3613 
3614  /// Matches RetransmitRequest.RequestTimestamp.
3615  ThisType& setRequestTimestamp(UInt64 value)
3617  {
3619 
3620  setOrdinary(offset, value);
3621  return *this;
3622  }
3623 
3624  /// Matches RetransmitRequest.FromSeqNo.
3628  {
3630 
3631  return ordinary<UInt32>(offset);
3632  }
3633 
3634  /// Matches RetransmitRequest.FromSeqNo.
3635  ThisType& setFromSeqNo(UInt32 value)
3637  {
3639 
3640  setOrdinary(offset, value);
3641  return *this;
3642  }
3643 
3644  /// Matches RetransmitRequest.MsgCount.
3648  {
3650 
3651  return ordinary<UInt16>(offset);
3652  }
3653 
3654  /// Matches RetransmitRequest.MsgCount.
3655  ThisType& setMsgCount(UInt16 value)
3657  {
3659 
3660  setOrdinary(offset, value);
3661  return *this;
3662  }
3663 
3664  /// Indicates whether a message was delayed as a result of
3665  /// being split among multiple packets (0) or if a message was
3666  /// delayed as a result of TCP re-transmission (1) or if a
3667  /// complete message was delayed due to a previously submitted
3668  /// split or out of order message (2). If absent then the
3669  /// message was not delayed and was neither split nor received
3670  /// out of order.
3672  bool splitMsg(SplitMsg::Enum& value) const
3674  {
3676 
3677  return enumeration<SplitMsg>(value, offset, NullUInt8());
3678  }
3679 
3680  /// Indicates whether a message was delayed as a result of
3681  /// being split among multiple packets (0) or if a message was
3682  /// delayed as a result of TCP re-transmission (1) or if a
3683  /// complete message was delayed due to a previously submitted
3684  /// split or out of order message (2). If absent then the
3685  /// message was not delayed and was neither split nor received
3686  /// out of order.
3687  ThisType& setSplitMsg(SplitMsg::Enum value)
3689  {
3691 
3692  setEnumeration<SplitMsg>(offset, value);
3693  return *this;
3694  }
3695 
3696  ThisType& setSplitMsgToNull()
3698  {
3700 
3701  setOrdinary(offset, NullUInt8());
3702  return *this;
3703  }
3704 
3705  /// Size of message body in bytes.
3708  static
3709  BlockLength
3711  ONIXS_ILINK3_UNUSED SchemaVersion version)
3713  {
3714  return
3715  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
3716  31;
3717  }
3718 
3719  /// Minimal variable fields size (when variable-length fields are empty).
3723  static
3724  MessageSize
3726  ONIXS_ILINK3_UNUSED SchemaVersion version)
3727  {
3728  return
3729  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
3730  0;
3731  }
3732 
3733  /// Maximal message size.
3739  {
3740  return
3741  MessageHeaderBuilder::Size +
3742  blockLength(Schema::Version);
3743  }
3744 
3745  /// Reset all variable-length fields if any.
3748  {
3749  return *this;
3750  }
3751 
3752  /// Reset all variable-length and optional fields if any.
3753  ThisType& reset()
3755  {
3756  setLastUUIdToNull();
3757  setSplitMsgToNull();
3758 
3759  resetVariableFields();
3760  return *this;
3761  }
3762 
3763  /// \return class name.
3767  static const Char* className()
3768  {
3769  return "Retransmission509";
3770  }
3771 
3772  /// FIX message type.
3776  static StrRef fixType()
3778  {
3779  return constructStrRef("Retransmission");
3780  }
3781 
3782  /// \return a human-readable presentation.
3784  std::string toString() const;
3785 
3786  /// \return the end of the message.
3788  const void* tail() const
3790  {
3791  return
3792  toOpaquePtr(
3793  advanceByBytes(
3794  binary(),
3795  SbeMessage::blockLength() +
3796  MessageHeader::Size));
3797  }
3798 
3799  /// \return the size occupied by the message.
3803  {
3804  return
3805  SbeMessage::calculateBinarySize(tail());
3806  }
3807 
3808 private:
3809  void checkLength(
3810  EncodedLength length, SchemaVersion version) const
3811  {
3812  const EncodedLength minimalRequiredLength =
3813  blockLength(version) +
3814  MessageHeader::Size +
3815  getMinimalVariableFieldsSize(version);
3816 
3817  checkBinaryLength(
3818  *this, length, minimalRequiredLength);
3819  }
3820 
3821  /// Checks variable fields consistency.
3822  void checkVarLenFields() const
3823  {
3824  }
3825 };
3826 
3827 /// RetransmitReject.
3830 : SbeMessage
3831 {
3832  /// Used template schema.
3834 
3835  /// This type alias.
3837 
3838  /// Message template ID from SBE schema.
3839  enum { TemplateId = 510 };
3840 
3841  /// Initializes a blank instance.
3842  RetransmitReject510() ONIXS_ILINK3_DEFAULT;
3843 
3844  /// Initializes an instance over the given memory block.
3846  void* data,
3847  EncodedLength length,
3848  SchemaVersion version = Schema::Version)
3849  : SbeMessage(data, length, version)
3850  {
3851  checkVersion<Schema>(version);
3852  checkLength(length, version);
3853  initHeader(TemplateId, blockLength(version), Schema::Id);
3854  reset();
3855  }
3856 
3857  /// Initializes an instance over the given memory block
3858  /// With no variable-length fields initialization
3859  /// It is assumed that the user does such an initialization manually.
3861  void* data,
3862  EncodedLength length,
3863  NoFieldsInit,
3864  SchemaVersion version = Schema::Version)
3865  : SbeMessage(data, length, version)
3866  {
3867  checkVersion<Schema>(version);
3868  checkLength(length, version);
3869  initHeader(TemplateId, blockLength(version), Schema::Id);
3870  resetVariableFields();
3871  }
3872 
3873  /// Initializes an instance over the existing memory block.
3875  void* data,
3876  EncodedLength length,
3877  NoInit)
3878  : SbeMessage(data, length)
3879  {
3880  assert(TemplateId == templateId());
3881 
3882  checkSchema<Schema>(schemaId(), version());
3883  checkLength(length, version());
3884  checkVarLenFields();
3885  }
3886 
3887  /// Initializes an instance over the existing memory block.
3888  /// Performs no checks.
3890  void* data,
3891  EncodedLength length,
3892  NoInit,
3893  NoCheck)
3895  : SbeMessage(data, length, NoCheck())
3896  {
3897  assert(schemaId() == Schema::Id);
3898  assert(version() >= Schema::MinimalVersion);
3899  assert(TemplateId == templateId());
3900  }
3901 
3902  /// Reject reason details.
3904  bool reason(StrRef& value) const
3906  {
3909 
3910  return fixedStr<length>(value, offset);
3911  }
3912 
3913  /// Reject reason details.
3914  ThisType& setReason(StrRef value)
3916  {
3919 
3920  setFixedStr<length>(offset, value);
3921  return *this;
3922  }
3923 
3924  ThisType& setReasonToNull()
3926  {
3929 
3930  setFixedStr<length>(offset, makeEmptyStrRef());
3931  return *this;
3932  }
3933 
3934  /// Matches RetransmitRequest.UUID.
3936  UInt64 uuId() const
3938  {
3940 
3941  return ordinary<UInt64>(offset);
3942  }
3943 
3944  /// Matches RetransmitRequest.UUID.
3945  ThisType& setUuId(UInt64 value)
3947  {
3949 
3950  setOrdinary(offset, value);
3951  return *this;
3952  }
3953 
3954  /// Matches RetransmitRequest.LastUUID.
3956  bool lastUUId(UInt64& value) const
3958  {
3960 
3961  return ordinary(value, offset, NullUInt64());
3962  }
3963 
3964  /// Matches RetransmitRequest.LastUUID.
3965  ThisType& setLastUUId(UInt64 value)
3967  {
3969 
3970  setOrdinary(offset, value);
3971  return *this;
3972  }
3973 
3974  ThisType& setLastUUIdToNull()
3976  {
3978 
3979  setOrdinary(offset, NullUInt64());
3980  return *this;
3981  }
3982 
3983  /// Matches RetransmitRequest.RequestTimestamp.
3987  {
3989 
3990  return ordinary<UInt64>(offset);
3991  }
3992 
3993  /// Matches RetransmitRequest.RequestTimestamp.
3994  ThisType& setRequestTimestamp(UInt64 value)
3996  {
3998 
3999  setOrdinary(offset, value);
4000  return *this;
4001  }
4002 
4003  /// Error code for reject reason.
4007  {
4009 
4010  return ordinary<UInt16>(offset);
4011  }
4012 
4013  /// Error code for reject reason.
4014  ThisType& setErrorCodes(UInt16 value)
4016  {
4018 
4019  setOrdinary(offset, value);
4020  return *this;
4021  }
4022 
4023  /// Indicates whether a message was delayed as a result of
4024  /// being split among multiple packets (0) or if a message was
4025  /// delayed as a result of TCP re-transmission (1) or if a
4026  /// complete message was delayed due to a previously submitted
4027  /// split or out of order message (2). If absent then the
4028  /// message was not delayed and was neither split nor received
4029  /// out of order.
4031  bool splitMsg(SplitMsg::Enum& value) const
4033  {
4035 
4036  return enumeration<SplitMsg>(value, offset, NullUInt8());
4037  }
4038 
4039  /// Indicates whether a message was delayed as a result of
4040  /// being split among multiple packets (0) or if a message was
4041  /// delayed as a result of TCP re-transmission (1) or if a
4042  /// complete message was delayed due to a previously submitted
4043  /// split or out of order message (2). If absent then the
4044  /// message was not delayed and was neither split nor received
4045  /// out of order.
4046  ThisType& setSplitMsg(SplitMsg::Enum value)
4048  {
4050 
4051  setEnumeration<SplitMsg>(offset, value);
4052  return *this;
4053  }
4054 
4055  ThisType& setSplitMsgToNull()
4057  {
4059 
4060  setOrdinary(offset, NullUInt8());
4061  return *this;
4062  }
4063 
4064  /// Size of message body in bytes.
4067  static
4068  BlockLength
4070  ONIXS_ILINK3_UNUSED SchemaVersion version)
4072  {
4073  return
4074  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
4075  75;
4076  }
4077 
4078  /// Minimal variable fields size (when variable-length fields are empty).
4082  static
4083  MessageSize
4085  ONIXS_ILINK3_UNUSED SchemaVersion version)
4086  {
4087  return
4088  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
4089  0;
4090  }
4091 
4092  /// Maximal message size.
4098  {
4099  return
4100  MessageHeaderBuilder::Size +
4101  blockLength(Schema::Version);
4102  }
4103 
4104  /// Reset all variable-length fields if any.
4107  {
4108  return *this;
4109  }
4110 
4111  /// Reset all variable-length and optional fields if any.
4112  ThisType& reset()
4114  {
4115  setReasonToNull();
4116  setLastUUIdToNull();
4117  setSplitMsgToNull();
4118 
4119  resetVariableFields();
4120  return *this;
4121  }
4122 
4123  /// \return class name.
4127  static const Char* className()
4128  {
4129  return "RetransmitReject510";
4130  }
4131 
4132  /// FIX message type.
4136  static StrRef fixType()
4138  {
4139  return constructStrRef("RetransmitReject");
4140  }
4141 
4142  /// \return a human-readable presentation.
4144  std::string toString() const;
4145 
4146  /// \return the end of the message.
4148  const void* tail() const
4150  {
4151  return
4152  toOpaquePtr(
4153  advanceByBytes(
4154  binary(),
4155  SbeMessage::blockLength() +
4156  MessageHeader::Size));
4157  }
4158 
4159  /// \return the size occupied by the message.
4163  {
4164  return
4165  SbeMessage::calculateBinarySize(tail());
4166  }
4167 
4168 private:
4169  void checkLength(
4170  EncodedLength length, SchemaVersion version) const
4171  {
4172  const EncodedLength minimalRequiredLength =
4173  blockLength(version) +
4174  MessageHeader::Size +
4175  getMinimalVariableFieldsSize(version);
4176 
4177  checkBinaryLength(
4178  *this, length, minimalRequiredLength);
4179  }
4180 
4181  /// Checks variable fields consistency.
4182  void checkVarLenFields() const
4183  {
4184  }
4185 };
4186 
4187 /// NotApplied.
4190 : SbeMessage
4191 {
4192  /// Used template schema.
4194 
4195  /// This type alias.
4197 
4198  /// Message template ID from SBE schema.
4199  enum { TemplateId = 513 };
4200 
4201  /// Initializes a blank instance.
4202  NotApplied513() ONIXS_ILINK3_DEFAULT;
4203 
4204  /// Initializes an instance over the given memory block.
4206  void* data,
4207  EncodedLength length,
4208  SchemaVersion version = Schema::Version)
4209  : SbeMessage(data, length, version)
4210  {
4211  checkVersion<Schema>(version);
4212  checkLength(length, version);
4213  initHeader(TemplateId, blockLength(version), Schema::Id);
4214  reset();
4215  }
4216 
4217  /// Initializes an instance over the given memory block
4218  /// With no variable-length fields initialization
4219  /// It is assumed that the user does such an initialization manually.
4221  void* data,
4222  EncodedLength length,
4223  NoFieldsInit,
4224  SchemaVersion version = Schema::Version)
4225  : SbeMessage(data, length, version)
4226  {
4227  checkVersion<Schema>(version);
4228  checkLength(length, version);
4229  initHeader(TemplateId, blockLength(version), Schema::Id);
4230  resetVariableFields();
4231  }
4232 
4233  /// Initializes an instance over the existing memory block.
4235  void* data,
4236  EncodedLength length,
4237  NoInit)
4238  : SbeMessage(data, length)
4239  {
4240  assert(TemplateId == templateId());
4241 
4242  checkSchema<Schema>(schemaId(), version());
4243  checkLength(length, version());
4244  checkVarLenFields();
4245  }
4246 
4247  /// Initializes an instance over the existing memory block.
4248  /// Performs no checks.
4250  void* data,
4251  EncodedLength length,
4252  NoInit,
4253  NoCheck)
4255  : SbeMessage(data, length, NoCheck())
4256  {
4257  assert(schemaId() == Schema::Id);
4258  assert(version() >= Schema::MinimalVersion);
4259  assert(TemplateId == templateId());
4260  }
4261 
4262  /// Matches Establish.UUID.
4264  UInt64 uuId() const
4266  {
4268 
4269  return ordinary<UInt64>(offset);
4270  }
4271 
4272  /// Matches Establish.UUID.
4273  ThisType& setUuId(UInt64 value)
4275  {
4277 
4278  setOrdinary(offset, value);
4279  return *this;
4280  }
4281 
4282  /// First not applied sequence number.
4286  {
4288 
4289  return ordinary<UInt32>(offset);
4290  }
4291 
4292  /// First not applied sequence number.
4293  ThisType& setFromSeqNo(UInt32 value)
4295  {
4297 
4298  setOrdinary(offset, value);
4299  return *this;
4300  }
4301 
4302  /// Count of how many messages have not been applied.
4306  {
4308 
4309  return ordinary<UInt32>(offset);
4310  }
4311 
4312  /// Count of how many messages have not been applied.
4313  ThisType& setMsgCount(UInt32 value)
4315  {
4317 
4318  setOrdinary(offset, value);
4319  return *this;
4320  }
4321 
4322  /// Indicates whether a message was delayed as a result of
4323  /// being split among multiple packets (0) or if a message was
4324  /// delayed as a result of TCP re-transmission (1) or if a
4325  /// complete message was delayed due to a previously submitted
4326  /// split or out of order message (2). If absent then the
4327  /// message was not delayed and was neither split nor received
4328  /// out of order. This is applicable only to the incoming
4329  /// message which triggers the gap detection and is not
4330  /// reflective of whether any message sent earlier as part of
4331  /// that sequence gap and not received by CME was delayed or
4332  /// not.
4334  bool splitMsg(SplitMsg::Enum& value) const
4336  {
4338 
4339  return enumeration<SplitMsg>(value, offset, NullUInt8());
4340  }
4341 
4342  /// Indicates whether a message was delayed as a result of
4343  /// being split among multiple packets (0) or if a message was
4344  /// delayed as a result of TCP re-transmission (1) or if a
4345  /// complete message was delayed due to a previously submitted
4346  /// split or out of order message (2). If absent then the
4347  /// message was not delayed and was neither split nor received
4348  /// out of order. This is applicable only to the incoming
4349  /// message which triggers the gap detection and is not
4350  /// reflective of whether any message sent earlier as part of
4351  /// that sequence gap and not received by CME was delayed or
4352  /// not.
4353  ThisType& setSplitMsg(SplitMsg::Enum value)
4355  {
4357 
4358  setEnumeration<SplitMsg>(offset, value);
4359  return *this;
4360  }
4361 
4362  ThisType& setSplitMsgToNull()
4364  {
4366 
4367  setOrdinary(offset, NullUInt8());
4368  return *this;
4369  }
4370 
4371  /// Size of message body in bytes.
4374  static
4375  BlockLength
4377  ONIXS_ILINK3_UNUSED SchemaVersion version)
4379  {
4380  return
4381  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
4382  17;
4383  }
4384 
4385  /// Minimal variable fields size (when variable-length fields are empty).
4389  static
4390  MessageSize
4392  ONIXS_ILINK3_UNUSED SchemaVersion version)
4393  {
4394  return
4395  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
4396  0;
4397  }
4398 
4399  /// Maximal message size.
4405  {
4406  return
4407  MessageHeaderBuilder::Size +
4408  blockLength(Schema::Version);
4409  }
4410 
4411  /// Reset all variable-length fields if any.
4414  {
4415  return *this;
4416  }
4417 
4418  /// Reset all variable-length and optional fields if any.
4419  ThisType& reset()
4421  {
4422  setSplitMsgToNull();
4423 
4424  resetVariableFields();
4425  return *this;
4426  }
4427 
4428  /// \return class name.
4432  static const Char* className()
4433  {
4434  return "NotApplied513";
4435  }
4436 
4437  /// FIX message type.
4441  static StrRef fixType()
4443  {
4444  return constructStrRef("NotApplied");
4445  }
4446 
4447  /// \return a human-readable presentation.
4449  std::string toString() const;
4450 
4451  /// \return the end of the message.
4453  const void* tail() const
4455  {
4456  return
4457  toOpaquePtr(
4458  advanceByBytes(
4459  binary(),
4460  SbeMessage::blockLength() +
4461  MessageHeader::Size));
4462  }
4463 
4464  /// \return the size occupied by the message.
4468  {
4469  return
4470  SbeMessage::calculateBinarySize(tail());
4471  }
4472 
4473 private:
4474  void checkLength(
4475  EncodedLength length, SchemaVersion version) const
4476  {
4477  const EncodedLength minimalRequiredLength =
4478  blockLength(version) +
4479  MessageHeader::Size +
4480  getMinimalVariableFieldsSize(version);
4481 
4482  checkBinaryLength(
4483  *this, length, minimalRequiredLength);
4484  }
4485 
4486  /// Checks variable fields consistency.
4487  void checkVarLenFields() const
4488  {
4489  }
4490 };
4491 
4492 /// NewOrderSingle.
4495 : SbeMessage
4496 {
4497  /// Used template schema.
4499 
4500  /// This type alias.
4502 
4503  /// Message template ID from SBE schema.
4504  enum { TemplateId = 514 };
4505 
4506  /// Initializes a blank instance.
4507  NewOrderSingle514() ONIXS_ILINK3_DEFAULT;
4508 
4509  /// Initializes an instance over the given memory block.
4511  void* data,
4512  EncodedLength length,
4513  SchemaVersion version = Schema::Version)
4514  : SbeMessage(data, length, version)
4515  {
4516  checkVersion<Schema>(version);
4517  checkLength(length, version);
4518  initHeader(TemplateId, blockLength(version), Schema::Id);
4519  reset();
4520  }
4521 
4522  /// Initializes an instance over the given memory block
4523  /// With no variable-length fields initialization
4524  /// It is assumed that the user does such an initialization manually.
4526  void* data,
4527  EncodedLength length,
4528  NoFieldsInit,
4529  SchemaVersion version = Schema::Version)
4530  : SbeMessage(data, length, version)
4531  {
4532  checkVersion<Schema>(version);
4533  checkLength(length, version);
4534  initHeader(TemplateId, blockLength(version), Schema::Id);
4535  resetVariableFields();
4536  }
4537 
4538  /// Initializes an instance over the existing memory block.
4540  void* data,
4541  EncodedLength length,
4542  NoInit)
4543  : SbeMessage(data, length)
4544  {
4545  assert(TemplateId == templateId());
4546 
4547  checkSchema<Schema>(schemaId(), version());
4548  checkLength(length, version());
4549  checkVarLenFields();
4550  }
4551 
4552  /// Initializes an instance over the existing memory block.
4553  /// Performs no checks.
4555  void* data,
4556  EncodedLength length,
4557  NoInit,
4558  NoCheck)
4560  : SbeMessage(data, length, NoCheck())
4561  {
4562  assert(schemaId() == Schema::Id);
4563  assert(version() >= Schema::MinimalVersion);
4564  assert(TemplateId == templateId());
4565  }
4566 
4567  /// Price per share or contract. Conditionally required if the
4568  /// order type requires a price (not market orders).
4570  bool price(PRICE9& value) const
4572  {
4574 
4575  return decimal(value, offset, NullPRICE9());
4576  }
4577 
4578  /// Price per share or contract. Conditionally required if the
4579  /// order type requires a price (not market orders).
4580  ThisType& setPrice(PRICE9 value)
4582  {
4584 
4585  setOrdinary(offset, value);
4586  return *this;
4587  }
4588 
4589  ThisType& setPriceToNull()
4591  {
4593 
4594  setOrdinary(offset, NullPRICE9());
4595  return *this;
4596  }
4597 
4598  /// Number of shares or contracts ordered.
4602  {
4604 
4605  return ordinary<UInt32>(offset);
4606  }
4607 
4608  /// Number of shares or contracts ordered.
4609  ThisType& setOrderQty(UInt32 value)
4611  {
4613 
4614  setOrdinary(offset, value);
4615  return *this;
4616  }
4617 
4618  /// Security ID as defined by CME. For the security ID list,
4619  /// see the security definition messages.
4623  {
4625 
4626  return ordinary<Int32>(offset);
4627  }
4628 
4629  /// Security ID as defined by CME. For the security ID list,
4630  /// see the security definition messages.
4631  ThisType& setSecurityId(Int32 value)
4633  {
4635 
4636  setOrdinary(offset, value);
4637  return *this;
4638  }
4639 
4640  /// Side of order.
4644  {
4646 
4647  return enumeration<SideReq>(offset);
4648  }
4649 
4650  /// Side of order.
4651  ThisType& setSide(SideReq::Enum value)
4653  {
4655 
4656  setEnumeration<SideReq>(offset, value);
4657  return *this;
4658  }
4659 
4660  /// Sequence number as assigned to message.
4662  UInt32 seqNum() const
4664  {
4666 
4667  return ordinary<UInt32>(offset);
4668  }
4669 
4670  /// Sequence number as assigned to message.
4671  ThisType& setSeqNum(UInt32 value)
4673  {
4675 
4676  setOrdinary(offset, value);
4677  return *this;
4678  }
4679 
4680  /// Operator ID. Should be unique per Firm ID. Assigned value
4681  /// used to identify specific message originator. Represents
4682  /// last individual or team in charge of the system which
4683  /// modifies the order before submission to the Globex
4684  /// platform, or if not modified from initiator (party
4685  /// role=118), last individual or team in charge of the
4686  /// system, which submit the order to the Globex platform.
4690  {
4693 
4694  return fixedStr<length>(offset);
4695  }
4696 
4697  /// Operator ID. Should be unique per Firm ID. Assigned value
4698  /// used to identify specific message originator. Represents
4699  /// last individual or team in charge of the system which
4700  /// modifies the order before submission to the Globex
4701  /// platform, or if not modified from initiator (party
4702  /// role=118), last individual or team in charge of the
4703  /// system, which submit the order to the Globex platform.
4704  ThisType& setSenderId(StrRef value)
4706  {
4709 
4710  setFixedStr<length>(offset, value);
4711  return *this;
4712  }
4713 
4714  /// Unique identifier for Order as assigned by the buy-side
4715  /// (institution, broker, intermediary etc.). Uniqueness must
4716  /// be guaranteed within a single trading day. Firms,
4717  /// particularly those which electronically submit multi-day
4718  /// orders, trade globally or throughout market close periods,
4719  /// should ensure uniqueness across days, for example by
4720  /// embedding a date within the ClOrdID field.
4722  StrRef clOrdId() const
4724  {
4727 
4728  return fixedStr<length>(offset);
4729  }
4730 
4731  /// Unique identifier for Order as assigned by the buy-side
4732  /// (institution, broker, intermediary etc.). Uniqueness must
4733  /// be guaranteed within a single trading day. Firms,
4734  /// particularly those which electronically submit multi-day
4735  /// orders, trade globally or throughout market close periods,
4736  /// should ensure uniqueness across days, for example by
4737  /// embedding a date within the ClOrdID field.
4738  ThisType& setClOrdId(StrRef value)
4740  {
4743 
4744  setFixedStr<length>(offset, value);
4745  return *this;
4746  }
4747 
4748  /// Refers to the ID of the related
4749  /// PartyDetailsDefinitionRequest message which will logically
4750  /// be tied to this message.
4754  {
4756 
4757  return ordinary<UInt64>(offset);
4758  }
4759 
4760  /// Refers to the ID of the related
4761  /// PartyDetailsDefinitionRequest message which will logically
4762  /// be tied to this message.
4765  {
4767 
4768  setOrdinary(offset, value);
4769  return *this;
4770  }
4771 
4772  /// Use OrderRequestID to identify a request to enter, modify
4773  /// or delete an order and echo the value on the
4774  /// ExecutionReport representing the response.
4778  {
4780 
4781  return ordinary<UInt64>(offset);
4782  }
4783 
4784  /// Use OrderRequestID to identify a request to enter, modify
4785  /// or delete an order and echo the value on the
4786  /// ExecutionReport representing the response.
4787  ThisType& setOrderRequestId(UInt64 value)
4789  {
4791 
4792  setOrdinary(offset, value);
4793  return *this;
4794  }
4795 
4796  /// Time when the message is sent. 64-bit integer expressing
4797  /// the number of nano seconds since midnight January 1, 1970.
4801  {
4803 
4804  return ordinary<UInt64>(offset);
4805  }
4806 
4807  /// Time when the message is sent. 64-bit integer expressing
4808  /// the number of nano seconds since midnight January 1, 1970.
4809  ThisType& setSendingTimeEpoch(UInt64 value)
4811  {
4813 
4814  setOrdinary(offset, value);
4815  return *this;
4816  }
4817 
4818  /// The stop price of a stop protect or stop limit order.
4819  /// (Conditionally required if OrdType = 3 or 4).
4821  bool stopPx(PRICE9& value) const
4823  {
4825 
4826  return decimal(value, offset, NullPRICE9());
4827  }
4828 
4829  /// The stop price of a stop protect or stop limit order.
4830  /// (Conditionally required if OrdType = 3 or 4).
4831  ThisType& setStopPx(PRICE9 value)
4833  {
4835 
4836  setOrdinary(offset, value);
4837  return *this;
4838  }
4839 
4840  ThisType& setStopPxToNull()
4842  {
4844 
4845  setOrdinary(offset, NullPRICE9());
4846  return *this;
4847  }
4848 
4849  /// Text describing sender's location (i.e. geopraphic
4850  /// location and/or desk).
4854  {
4857 
4858  return fixedStr<length>(offset);
4859  }
4860 
4861  /// Text describing sender's location (i.e. geopraphic
4862  /// location and/or desk).
4863  ThisType& setLocation(StrRef value)
4865  {
4868 
4869  setFixedStr<length>(offset, value);
4870  return *this;
4871  }
4872 
4873  /// Minimum quantity of an order to be executed.
4875  bool minQty(UInt32& value) const
4877  {
4879 
4880  return ordinary(value, offset, NullUInt32());
4881  }
4882 
4883  /// Minimum quantity of an order to be executed.
4884  ThisType& setMinQty(UInt32 value)
4886  {
4888 
4889  setOrdinary(offset, value);
4890  return *this;
4891  }
4892 
4893  ThisType& setMinQtyToNull()
4895  {
4897 
4898  setOrdinary(offset, NullUInt32());
4899  return *this;
4900  }
4901 
4902  /// The quantity to be displayed . Required for iceberg
4903  /// orders. On orders specifies the qty to be displayed, on
4904  /// execution reports the currently displayed quantity.
4906  bool displayQty(UInt32& value) const
4908  {
4910 
4911  return ordinary(value, offset, NullUInt32());
4912  }
4913 
4914  /// The quantity to be displayed . Required for iceberg
4915  /// orders. On orders specifies the qty to be displayed, on
4916  /// execution reports the currently displayed quantity.
4917  ThisType& setDisplayQty(UInt32 value)
4919  {
4921 
4922  setOrdinary(offset, value);
4923  return *this;
4924  }
4925 
4928  {
4930 
4931  setOrdinary(offset, NullUInt32());
4932  return *this;
4933  }
4934 
4935  /// Date of order expiration (last day the order can trade),
4936  /// always expressed in terms of the local market date.
4937  /// Applicable only to GTD orders which expire at the end of
4938  /// the trading session specified. This has to be a future or
4939  /// current session date and cannot be in the past.
4941  bool expireDate(Timestamp& value) const
4943  {
4944  typedef LocalMktDate FieldValue;
4945 
4947 
4948  FieldValue fieldValue;
4949 
4950  if (ordinary(fieldValue, offset, NullLocalMktDate()))
4951  {
4952  value = localMktDateToTimestamp(fieldValue);
4953  return true;
4954  }
4955  return false;
4956  }
4957 
4958  /// Date of order expiration (last day the order can trade),
4959  /// always expressed in terms of the local market date.
4960  /// Applicable only to GTD orders which expire at the end of
4961  /// the trading session specified. This has to be a future or
4962  /// current session date and cannot be in the past.
4963  ThisType& setExpireDate(Timestamp value)
4965  {
4967 
4968  setOrdinary(offset, timestampToLocalMktDate(value));
4969  return *this;
4970  }
4971 
4974  {
4976 
4977  setOrdinary(offset, NullLocalMktDate());
4978  return *this;
4979  }
4980 
4981  /// Order type.
4985  {
4987 
4988  return enumeration<OrderTypeReq>(offset);
4989  }
4990 
4991  /// Order type.
4994  {
4996 
4997  setEnumeration<OrderTypeReq>(offset, value);
4998  return *this;
4999  }
5000 
5001  /// Specifies how long the order remains in effect.
5005  {
5007 
5008  return enumeration<TimeInForce>(offset);
5009  }
5010 
5011  /// Specifies how long the order remains in effect.
5014  {
5016 
5017  setEnumeration<TimeInForce>(offset, value);
5018  return *this;
5019  }
5020 
5021  /// Indicates if the order was initially received manually (as
5022  /// opposed to electronically).
5026  {
5028 
5029  return enumeration<ManualOrdIndReq>(offset);
5030  }
5031 
5032  /// Indicates if the order was initially received manually (as
5033  /// opposed to electronically).
5034  ThisType&
5036  ManualOrdIndReq::Enum value)
5038  {
5040 
5041  setEnumeration<ManualOrdIndReq>(offset, value);
5042  return *this;
5043  }
5044 
5045  /// Instructions for order handling on exchange. Since more
5046  /// than one instruction is applicable to an order, this field
5047  /// can represent those using a bitset.
5051  {
5053 
5054  return ordinary<ExecInst>(offset);
5055  }
5056 
5057  /// Instructions for order handling on exchange. Since more
5058  /// than one instruction is applicable to an order, this field
5059  /// can represent those using a bitset.
5060  ThisType& setExecInst(ExecInst value)
5062  {
5064 
5065  setOrdinary(offset, value);
5066  return *this;
5067  }
5068 
5069  /// Identifies whether the order should be treated as passive
5070  /// (will not match when entered) or aggressive (could match
5071  /// when entered); default behavior when absent is aggressive.
5073  bool executionMode(ExecMode::Enum& value) const
5075  {
5077 
5078  return enumeration<ExecMode>(value, offset, NullCharNULL());
5079  }
5080 
5081  /// Identifies whether the order should be treated as passive
5082  /// (will not match when entered) or aggressive (could match
5083  /// when entered); default behavior when absent is aggressive.
5086  {
5088 
5089  setEnumeration<ExecMode>(offset, value);
5090  return *this;
5091  }
5092 
5095  {
5097 
5098  setOrdinary(offset, NullCharNULL());
5099  return *this;
5100  }
5101 
5102  /// New field added to capture if an order was submitted for
5103  /// market making obligation or not. Applicable only for EU
5104  /// fixed income markets.
5108  {
5110 
5111  return enumeration<BooleanNULL>(value, offset, NullUInt8());
5112  }
5113 
5114  /// New field added to capture if an order was submitted for
5115  /// market making obligation or not. Applicable only for EU
5116  /// fixed income markets.
5119  {
5121 
5122  setEnumeration<BooleanNULL>(offset, value);
5123  return *this;
5124  }
5125 
5128  {
5130 
5131  setOrdinary(offset, NullUInt8());
5132  return *this;
5133  }
5134 
5135  /// Boolean: flags a managed order.
5137  bool managedOrder(BooleanNULL::Enum& value) const
5139  {
5141 
5142  return enumeration<BooleanNULL>(value, offset, NullUInt8());
5143  }
5144 
5145  /// Boolean: flags a managed order.
5148  {
5150 
5151  setEnumeration<BooleanNULL>(offset, value);
5152  return *this;
5153  }
5154 
5157  {
5159 
5160  setOrdinary(offset, NullUInt8());
5161  return *this;
5162  }
5163 
5164  /// Indicates the type of short sale. Will not be used for Buy
5165  /// orders but Sell orders should have this tag populated for
5166  /// MiFID.
5168  bool
5170  ShortSaleType::Enum& value) const
5172  {
5174 
5175  return enumeration<ShortSaleType>(value, offset, NullEnumNULL());
5176  }
5177 
5178  /// Indicates the type of short sale. Will not be used for Buy
5179  /// orders but Sell orders should have this tag populated for
5180  /// MiFID.
5181  ThisType&
5183  ShortSaleType::Enum value)
5185  {
5187 
5188  setEnumeration<ShortSaleType>(offset, value);
5189  return *this;
5190  }
5191 
5194  {
5196 
5197  setOrdinary(offset, NullEnumNULL());
5198  return *this;
5199  }
5200 
5201  /// Size of message body in bytes.
5204  static
5205  BlockLength
5207  ONIXS_ILINK3_UNUSED SchemaVersion version)
5209  {
5210  return
5211  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
5212  116;
5213  }
5214 
5215  /// Minimal variable fields size (when variable-length fields are empty).
5219  static
5220  MessageSize
5222  ONIXS_ILINK3_UNUSED SchemaVersion version)
5223  {
5224  return
5225  ONIXS_ILINK3_ASSERT(version >= Schema::MinimalVersion),
5226  0;
5227  }
5228 
5229  /// Maximal message size.
5235  {
5236  return
5237  MessageHeaderBuilder::Size +
5238  blockLength(Schema::Version);
5239  }
5240 
5241  /// Reset all variable-length fields if any.
5244  {
5245  return *this;
5246  }
5247 
5248  /// Reset all variable-length and optional fields if any.
5249  ThisType& reset()
5251  {
5252  setPriceToNull();
5253  setStopPxToNull();
5254  setMinQtyToNull();
5255  setDisplayQtyToNull();
5256  setExpireDateToNull();
5257  setExecutionModeToNull();
5258  setLiquidityFlagToNull();
5259  setManagedOrderToNull();
5260  setShortSaleTypeToNull();
5261 
5262  resetVariableFields();
5263  return *this;
5264  }
5265 
5266  /// \return class name.
5270  static const Char* className()
5271  {
5272  return "NewOrderSingle514";
5273  }
5274 
5275  /// FIX message type.
5279  static StrRef fixType()
5281  {
5282  return constructStrRef("D");
5283  }
5284 
5285  /// \return a human-readable presentation.
5287  std::string toString() const;
5288 
5289  /// \return the end of the message.
5291  const void* tail() const
5293  {
5294  return
5295  toOpaquePtr(
5296  advanceByBytes(
5297  binary(),
5298  SbeMessage::blockLength() +
5299  MessageHeader::Size));
5300  }
5301 
5302  /// \return the size occupied by the message.
5306  {
5307  return
5308  SbeMessage::calculateBinarySize(tail());
5309  }
5310 
5311 private:
5312  void checkLength(
5313  EncodedLength length, SchemaVersion version) const
5314  {
5315  const EncodedLength minimalRequiredLength =
5316  blockLength(version) +
5317  MessageHeader::Size +
5318  getMinimalVariableFieldsSize(version);
5319 
5320  checkBinaryLength(
5321  *this, length, minimalRequiredLength);
5322  }
5323 
5324  /// Checks variable fields consistency.
5325  void checkVarLenFields() const
5326  {
5327  }
5328 };
5329 
5330 /// OrderCancelReplaceRequest.
5333 : SbeMessage
5334 {
5335  /// Used template schema.
5337 
5338  /// This type alias.
5340 
5341  /// Message template ID from SBE schema.
5342  enum { TemplateId = 515 };
5343 
5344  /// Initializes a blank instance.
5345  OrderCancelReplaceRequest515() ONIXS_ILINK3_DEFAULT;
5346 
5347  /// Initializes an instance over the given memory block.
5349  void* data,
5350  EncodedLength length,
5351  SchemaVersion version = Schema::Version)
5352  : SbeMessage(data, length, version)
5353  {
5354  checkVersion<Schema>(version);
5355  checkLength(length, version);
5356  initHeader(TemplateId, blockLength(version), Schema::Id);
5357  reset();
5358  }
5359 
5360  /// Initializes an instance over the given memory block
5361  /// With no variable-length fields initialization
5362  /// It is assumed that the user does such an initialization manually.
5364  void* data,
5365  EncodedLength length,
5366  NoFieldsInit,
5367  SchemaVersion version = Schema::Version)
5368  : SbeMessage(data, length, version)
5369  {
5370  checkVersion<Schema>(version);
5371  checkLength(length, version);
5372  initHeader(TemplateId, blockLength(version), Schema::Id);
5373  resetVariableFields();
5374  }
5375 
5376  /// Initializes an instance over the existing memory block.
5378  void* data,
5379  EncodedLength length,
5380  NoInit)
5381  : SbeMessage(data, length)
5382  {
5383  assert(TemplateId == templateId());
5384 
5385  checkSchema<Schema>(schemaId(), version());
5386  checkLength(length, version());
5387  checkVarLenFields();
5388  }
5389 
5390  /// Initializes an instance over the existing memory block.
5391  /// Performs no checks.
5393  void* data,
5394  EncodedLength length,
5395  NoInit,
5396  NoCheck)
5398  : SbeMessage(data, length, NoCheck())
5399  {
5400  assert(schemaId() == Schema::Id);
5401  assert(version() >= Schema::MinimalVersion);
5402  assert(TemplateId == templateId());
5403  }
5404 
5405  /// Price per share or contract. Conditionally required if the
5406  /// order type requires a price (not market orders).
5408  bool price(PRICE9& value) const
5410  {
5412 
5413  return decimal(value, offset, NullPRICE9());
5414  }
5415 
5416  /// Price per share or contract. Conditionally required if the
5417  /// order type requires a price (not market orders).
5418  ThisType& setPrice(PRICE9 value)
5420  {
5422 
5423  setOrdinary(offset, value);
5424  return *this;
5425  }
5426 
5427  ThisType& setPriceToNull()
5429  {
5431 
5432  setOrdinary(offset, NullPRICE9());
5433  return *this;
5434  }
5435 
5436  /// Number of shares or contracts ordered.
5440  {
5442 
5443  return ordinary<UInt32>(offset);
5444  }
5445 
5446  /// Number of shares or contracts ordered.
5447  ThisType& setOrderQty(UInt32 value)
5449  {
5451 
5452  setOrdinary(offset, value);
5453  return *this;
5454  }
5455 
5456  /// Security ID as defined by CME. For the security ID list,
5457  /// see the security definition messages.
5461  {
5463 
5464  return ordinary<Int32>(offset);
5465  }
5466 
5467  /// Security ID as defined by CME. For the security ID list,
5468  /// see the security definition messages.
5469  ThisType& setSecurityId(Int32 value)
5471  {
5473 
5474  setOrdinary(offset, value);
5475  return *this;
5476  }
5477 
5478  /// Side of order.
5482  {
5484 
5485  return enumeration<SideReq>(offset);
5486  }
5487 
5488  /// Side of order.
5489  ThisType& setSide(SideReq::Enum value)
5491  {
5493 
5494  setEnumeration<SideReq>(offset, value);
5495  return *this;
5496  }
5497 
5498  /// Sequence number as assigned to message.
5500  UInt32 seqNum() const
5502  {
5504 
5505  return ordinary<UInt32>(offset);
5506  }
5507 
5508  /// Sequence number as assigned to message.
5509  ThisType& setSeqNum(UInt32 value)
5511  {
5513 
5514  setOrdinary(offset, value);
5515  return *this;
5516  }
5517 
5518  /// Operator ID. Should be unique per Firm ID. Assigned value
5519  /// used to identify specific message originator. Represents
5520  /// last individual or team in charge of the system which
5521  /// modifies the order before submission to the Globex
5522  /// platform, or if not modified from initiator (party
5523  /// role=118), last individual or team in charge of the
5524  /// system, which submit the order to the Globex platform.
5528  {
5531 
5532  return fixedStr<length>(offset);
5533  }
5534 
5535  /// Operator ID. Should be unique per Firm ID. Assigned value
5536  /// used to identify specific message originator. Represents
5537  /// last individual or team in charge of the system which
5538  /// modifies the order before submission to the Globex
5539  /// platform, or if not modified from initiator (party
5540  /// role=118), last individual or team in charge of the
5541  /// system, which submit the order to the Globex platform.
5542  ThisType& setSenderId(StrRef value)
5544  {
5547 
5548  setFixedStr<length>(offset, value);
5549  return *this;
5550  }
5551 
5552  /// Unique identifier for Order as assigned by the buy-side
5553  /// (institution, broker, intermediary etc.). Uniqueness must
5554  /// be guaranteed within a single trading day. Firms,
5555  /// particularly those which electronically submit multi-day
5556  /// orders, trade globally or throughout market close periods,
5557  /// should ensure uniqueness across days, for example by
5558  /// embedding a date within the ClOrdID field.
5560  StrRef clOrdId() const
5562  {
5565 
5566  return fixedStr<length>(offset);
5567  }
5568 
5569  /// Unique identifier for Order as assigned by the buy-side
5570  /// (institution, broker, intermediary etc.). Uniqueness must
5571  /// be guaranteed within a single trading day. Firms,
5572  /// particularly those which electronically submit multi-day
5573  /// orders, trade globally or throughout market close periods,
5574  /// should ensure uniqueness across days, for example by
5575  /// embedding a date within the ClOrdID field.
5576  ThisType& setClOrdId(StrRef value)
5578  {
5581 
5582  setFixedStr<length>(offset, value);
5583  return *this;
5584  }
5585 
5586  /// Refers to the ID of the related
5587  /// PartyDetailsDefinitionRequest message which will logically
5588  /// be tied to this message.
5592  {
5594 
5595  return ordinary<UInt64>(offset);
5596  }
5597 
5598  /// Refers to the ID of the related
5599  /// PartyDetailsDefinitionRequest message which will logically
5600  /// be tied to this message.
5603  {
5605 
5606  setOrdinary(offset, value);
5607  return *this;
5608  }
5609 
5610  /// Unique identifier for order as assigned by the exchange.
5611  /// Uniqueness is guaranteed within a single trading day
5612  /// across all instruments.
5614  UInt64 orderId() const
5616  {
5618 
5619  return ordinary<UInt64>(offset);
5620  }
5621 
5622  /// Unique identifier for order as assigned by the exchange.
5623  /// Uniqueness is guaranteed within a single trading day
5624  /// across all instruments.
5625  ThisType& setOrderId(UInt64 value)
5627  {
5629 
5630  setOrdinary(offset, value);
5631  return *this;
5632  }
5633 
5634  /// The stop price of a stop protect or stop limit order.
5635  /// (Conditionally required if OrdType = 3 or 4).
5637  bool stopPx(PRICE9& value) const
5639  {
5641 
5642  return decimal(value, offset, NullPRICE9());
5643  }
5644 
5645  /// The stop price of a stop protect or stop limit order.
5646  /// (Conditionally required if OrdType = 3 or 4).
5647  ThisType& setStopPx(PRICE9 value)
5649  {
5651 
5652  setOrdinary(offset, value);
5653  return *this;
5654  }
5655 
5656  ThisType& setStopPxToNull()
5658  {
5660 
5661  setOrdinary(offset, NullPRICE9());
5662  return *this;
5663  }
5664 
5665  /// Use OrderRequestID to identify a request to enter, modify
5666  /// or delete an order and echo the value on the
5667  /// ExecutionReport representing the response.
5671  {
5673 
5674  return ordinary<UInt64>(offset);
5675  }
5676 
5677  /// Use OrderRequestID to identify a request to enter, modify
5678  /// or delete an order and echo the value on the
5679  /// ExecutionReport representing the response.
5680  ThisType& setOrderRequestId(UInt64 value)
5682  {
5684 
5685  setOrdinary(offset, value);
5686  return *this;
5687  }
5688 
5689  /// Time when the message is sent. 64-bit integer expressing
5690  /// the number of nano seconds since midnight January 1, 1970.
5694  {
5696 
5697  return ordinary<UInt64>(offset);
5698  }
5699 
5700  /// Time when the message is sent. 64-bit integer expressing
5701  /// the number of nano seconds since midnight January 1, 1970.
5702  ThisType& setSendingTimeEpoch(UInt64 value)
5704  {
5706 
5707  setOrdinary(offset, value);
5708  return *this;
5709  }
5710 
5711  /// Text describing sender's location (i.e. geopraphic
5712  /// location and/or desk).
5716  {
5719