OnixS C++ CME iLink 3 Binary Order Entry Handler  1.18.9
API Documentation
Message.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 
26 
27 #include <cstdlib>
28 
30 
31 /// Provides a tag-based access to fields
32 /// stored in an SBE-encoded block.
35 {
36  /// \return the Field that corresponds to the given tag.
37  virtual Field field(const BinaryBlockBase&, Tag) const ONIXS_ILINK3_NOTHROW = 0;
38 
39  /// Sets a field value by its tag.
40  virtual void setField(BinaryBlockBase&, Tag, const Field&) const = 0;
41 
42  /// Resets a field value by its tag.
43  virtual void resetField(BinaryBlockBase&, Tag) const = 0;
44 
45  /// Resets all variable-length and optional fields.
46  virtual void reset(BinaryBlockBase&) const ONIXS_ILINK3_NOTHROW = 0;
47 
48 protected:
50 };
51 
52 /// Collection of Fields.
54 {
55  /// \return `true` if the instance refers to a valid repeating group entry, otherwise - `false`.
57  {
58  return (ONIXS_ILINK3_NULLPTR != accessor_);
59  }
60 
61  /// Resets all variable-length and optional fields.
62  ///
63  /// \warning Does not check whether the instance refers
64  /// to a valid set of fields.
65  /// Use operator bool() to check whether
66  /// the instance is in a valid state.
68  {
69  accessor_->reset(binary_);
70 
71  return *this;
72  }
73 
74  /// \return Field by its tag.
75  ///
76  /// \warning Does not check whether the instance refers
77  /// to a valid set of fields.
78  /// Use operator bool() to check whether
79  /// the instance is in a valid state.
81  {
82  assert(accessor_);
83 
84  return accessor_->field(binary_, tag);
85  }
86 
87  /// Assigns the field by its tag.
88  ///
89  /// \throw std::runtime_error if conversion is impossible
90  /// or the value is not allowed.
92  Tag tag, const Field& field)
93  {
94  assert(accessor_);
95  assert(field);
96 
97  accessor_->setField(binary_, tag, field);
98 
99  return *this;
100  }
101 
102  /// Resets the field by its tag.
103  ///
104  /// \throw std::runtime_error if or the value is not
105  /// optional or the value is not allowed.
106  ///
107  /// \warning Does not check whether the instance refers
108  /// to a valid set of fields.
109  /// Use operator bool() to check whether
110  /// the instance is in a valid state.
112  {
113  assert(accessor_);
114 
115  accessor_->resetField(binary_, tag);
116 
117  return *this;
118  }
119 
120  /// \return field by its tag.
121  ///
122  /// If the source does not contain any
123  /// field with the given tag, the returned
124  /// instance represents a null field.
125  ///
126  /// \warning Does not check whether the instance refers
127  /// to a valid set of fields.
128  /// Use operator bool() to check whether
129  /// the instance is in a valid state.
131  {
132  return this->field(tag);
133  }
134 
135  /// \return `true` if the field-set contains the
136  /// field with the given tag, otherwise - `false`.
137  ///
138  /// \warning Does not check whether the instance refers
139  /// to a valid set of fields.
140  /// Use operator bool() to check whether
141  /// the instance is in a valid state.
142  ONIXS_ILINK3_NODISCARD bool contain(Tag tag) const ONIXS_ILINK3_NOTHROW;
143 
144  /// \return field value as an `Char` value.
145  ///
146  /// \throw std::runtime_error if conversion is impossible
147  /// or the value does not exist.
148  ///
149  /// \warning Does not check whether the instance refers
150  /// to a valid set of fields.
151  /// Use operator bool() to check whether
152  /// the instance is in a valid state.
153  ONIXS_ILINK3_NODISCARD Char getChar(Tag tag) const;
154 
155  /// \return field value as an `Int64` value.
156  ///
157  /// \throw std::runtime_error if conversion is impossible
158  /// or the value does not exist.
159  ///
160  /// \warning Does not check whether the instance refers
161  /// to a valid set of fields.
162  /// Use operator bool() to check whether
163  /// the instance is in a valid state.
164  ONIXS_ILINK3_NODISCARD Int64 getInt64(Tag tag) const;
165 
166  /// \return field value as an `UInt64` value.
167  ///
168  /// \throw std::runtime_error if conversion is impossible
169  /// or the value does not exist.
170  ///
171  /// \warning Does not check whether the instance refers
172  /// to a valid set of fields.
173  /// Use operator bool() to check whether
174  /// the instance is in a valid state.
175  ONIXS_ILINK3_NODISCARD UInt64 getUInt64(Tag tag) const;
176 
177  /// \return field value as an `Int32` value.
178  ///
179  /// \throw std::runtime_error if conversion is impossible
180  /// or the value does not exist.
181  ///
182  /// \warning Does not check whether the instance refers
183  /// to a valid set of fields.
184  /// Use operator bool() to check whether
185  /// the instance is in a valid state.
186  ONIXS_ILINK3_NODISCARD Int32 getInt32(Tag tag) const;
187 
188  /// \return field value as an `UInt32` value.
189  ///
190  /// \throw std::runtime_error if conversion is impossible
191  /// or the value does not exist.
192  ///
193  /// \warning Does not check whether the instance refers
194  /// to a valid set of fields.
195  /// Use operator bool() to check whether
196  /// the instance is in a valid state.
197  ONIXS_ILINK3_NODISCARD UInt32 getUInt32(Tag tag) const;
198 
199  /// \return field value as an `Int16` value.
200  ///
201  /// \throw std::runtime_error if conversion is impossible
202  /// or the value does not exist.
203  ///
204  /// \warning Does not check whether the instance refers
205  /// to a valid set of fields.
206  /// Use operator bool() to check whether
207  /// the instance is in a valid state.
208  ONIXS_ILINK3_NODISCARD Int16 getInt16(Tag tag) const;
209 
210  /// \return field value as an `UInt16` value.
211  ///
212  /// \throw std::runtime_error if conversion is impossible
213  /// or the value does not exist.
214  ///
215  /// \warning Does not check whether the instance refers
216  /// to a valid set of fields.
217  /// Use operator bool() to check whether
218  /// the instance is in a valid state.
219  ONIXS_ILINK3_NODISCARD UInt16 getUInt16(Tag tag) const;
220 
221  /// \return field value as an `Int8` value.
222  ///
223  /// \throw std::runtime_error if conversion is impossible
224  /// or the value does not exist.
225  ///
226  /// \warning Does not check whether the instance refers
227  /// to a valid set of fields.
228  /// Use operator bool() to check whether
229  /// the instance is in a valid state.
230  ONIXS_ILINK3_NODISCARD Int8 getInt8(Tag tag) const;
231 
232  /// \return field value as an `UInt8` value.
233  ///
234  /// \throw std::runtime_error if conversion is impossible
235  /// or the value does not exist.
236  ///
237  /// \warning Does not check whether the instance refers
238  /// to a valid set of fields.
239  /// Use operator bool() to check whether
240  /// the instance is in a valid state.
241  ONIXS_ILINK3_NODISCARD UInt8 getUInt8(Tag tag) const;
242 
243  /// \return the field value as a Decimal number.
244  ///
245  /// \throw std::runtime_error if conversion is impossible
246  /// or the value does not exist.
247  ///
248  /// \warning Does not check whether the instance refers
249  /// to a valid set of fields.
250  /// Use operator bool() to check whether
251  /// the instance is in a valid state.
252  ONIXS_ILINK3_NODISCARD Decimal getDecimal(Tag tag) const;
253 
254  /// \return reference to a read-only text chain.
255  ///
256  /// \throw std::runtime_error if conversion is impossible
257  /// or the value does not exist.
258  ///
259  /// \warning Does not check whether the instance refers
260  /// to a valid set of fields.
261  /// Use operator bool() to check whether
262  /// the instance is in a valid state.
263  ONIXS_ILINK3_NODISCARD StrRef getStringRef(Tag tag) const;
264 
265  /// \return the field value as a timestamp
266  ///
267  /// \throw std::runtime_error if conversion is impossible
268  /// or the value does not exist.
269  ///
270  /// \warning Does not check whether the instance refers
271  /// to a valid set of fields.
272  /// Use operator bool() to check whether
273  /// the instance is in a valid state.
274  ONIXS_ILINK3_NODISCARD Timestamp getTimestamp(Tag tag) const;
275 
276  /// \return the field value as a MaturityMonthYear.
277  ///
278  /// \throw std::runtime_error if conversion is impossible
279  /// or the value does not exist.
280  ///
281  /// \warning Does not check whether the instance refers
282  /// to a valid set of fields.
283  /// Use operator bool() to check whether
284  /// the instance is in a valid state.
285  MaturityMonthYear getMaturityMonthYear(Tag tag) const;
286 
287  /// \return the field value as an enumeration.
288  ///
289  /// \throw std::runtime_error if conversion is impossible
290  /// or the value does not exist.
291  ///
292  /// \warning Does not check whether the instance refers
293  /// to a valid set of fields.
294  /// Use operator bool() to check whether
295  /// the instance is in a valid state.
296  template <typename Enumeration>
297  ONIXS_ILINK3_NODISCARD typename Enumeration::Enum getEnumeration(Tag tag) const
298  {
299  return field(tag).cast<Enumeration>();
300  }
301 
302  /// \return the field value as a set.
303  ///
304  /// \throw std::runtime_error if conversion is impossible
305  /// or the value does not exist.
306  ///
307  /// \warning Does not check whether the instance refers
308  /// to a valid set of fields.
309  /// Use operator bool() to check whether
310  /// the instance is in a valid state.
311  template <typename BitSet>
313  {
314  return BitSet(field(tag).cast<typename BitSet::Bits>());
315  }
316 
317  /// Assigns a given value.
318  ///
319  /// \throw std::runtime_error if conversion is impossible
320  /// or the value is not allowed.
321  FieldSet& set(Tag tag, const Field& field)
322  {
323  return setField(tag, field);
324  }
325 
326  /// Assigns a given value as a set.
327  ///
328  /// \throw std::runtime_error if conversion is impossible
329  /// or the value is not allowed.
330  template <typename BitSet>
331  FieldSet& set(Tag tag, BitSet value, typename BitSet::Bits* = ONIXS_ILINK3_NULLPTR)
332  {
333  return set(tag, value.bits());
334  }
335 
336  /// Assigns a given value.
337  ///
338  /// \throw std::runtime_error if conversion is impossible
339  /// or the value is not allowed.
340  FieldSet& set(Tag tag, Char value);
341 
342  /// Assigns a given value.
343  ///
344  /// \throw std::runtime_error if conversion is impossible
345  /// or the value is not allowed.
346  ///
347  /// \warning Does not check whether the instance refers
348  /// to a valid set of fields.
349  /// Use operator bool() to check whether
350  /// the instance is in a valid state.
351  FieldSet& set(Tag tag, UInt64 value);
352 
353  /// Assigns a given value.
354  ///
355  /// \throw std::runtime_error if conversion is impossible
356  /// or the value is not allowed.
357  ///
358  /// \warning Does not check whether the instance refers
359  /// to a valid set of fields.
360  /// Use operator bool() to check whether
361  /// the instance is in a valid state.
362  FieldSet& set(Tag tag, Int64 value);
363 
364  /// Assigns a given value.
365  ///
366  /// \throw std::runtime_error if conversion is impossible
367  /// or the value is not allowed.
368  ///
369  /// \warning Does not check whether the instance refers
370  /// to a valid set of fields.
371  /// Use operator bool() to check whether
372  /// the instance is in a valid state.
373  FieldSet& set(Tag tag, UInt32 value);
374 
375  /// Assigns a given value.
376  ///
377  /// \throw std::runtime_error if conversion is impossible
378  /// or the value is not allowed.
379  ///
380  /// \warning Does not check whether the instance refers
381  /// to a valid set of fields.
382  /// Use operator bool() to check whether
383  /// the instance is in a valid state.
384  FieldSet& set(Tag tag, Int32 value);
385 
386  /// Assigns a given value.
387  ///
388  /// \throw std::runtime_error if conversion is impossible
389  /// or the value is not allowed.
390  ///
391  /// \warning Does not check whether the instance refers
392  /// to a valid set of fields.
393  /// Use operator bool() to check whether
394  /// the instance is in a valid state.
395  FieldSet& set(Tag tag, UInt16 value);
396 
397  /// Assigns a given value.
398  ///
399  /// \throw std::runtime_error if conversion is impossible
400  /// or the value is not allowed.
401  ///
402  /// \warning Does not check whether the instance refers
403  /// to a valid set of fields.
404  /// Use operator bool() to check whether
405  /// the instance is in a valid state.
406  FieldSet& set(Tag tag, Int16 value);
407 
408  /// Assigns a given value.
409  ///
410  /// \throw std::runtime_error if conversion is impossible
411  /// or the value is not allowed.
412  ///
413  /// \warning Does not check whether the instance refers
414  /// to a valid set of fields.
415  /// Use operator bool() to check whether
416  /// the instance is in a valid state.
417  FieldSet& set(Tag tag, UInt8 value);
418 
419  /// Assigns a given value.
420  ///
421  /// \throw std::runtime_error if conversion is impossible
422  /// or the value is not allowed.
423  ///
424  /// \warning Does not check whether the instance refers
425  /// to a valid set of fields.
426  /// Use operator bool() to check whether
427  /// the instance is in a valid state.
428  FieldSet& set(Tag tag, Int8 value);
429 
430  /// Assigns a given value.
431  ///
432  /// \throw std::runtime_error if conversion is impossible
433  /// or the value is not allowed.
434  ///
435  /// \warning Does not check whether the instance refers
436  /// to a valid set of fields.
437  /// Use operator bool() to check whether
438  /// the instance is in a valid state.
439  FieldSet& set(Tag tag, const Decimal& value);
440 
441  /// Assigns a given value.
442  ///
443  /// \throw std::runtime_error if conversion is impossible
444  /// or the value is not allowed.
445  ///
446  /// \warning Does not check whether the instance refers
447  /// to a valid set of fields.
448  /// Use operator bool() to check whether
449  /// the instance is in a valid state.
450  FieldSet& set(Tag tag, StrRef value);
451 
452  /// Assigns a given value.
453  ///
454  /// \throw std::runtime_error if conversion is impossible
455  /// or the value is not allowed.
456  ///
457  /// \warning Does not check whether the instance refers
458  /// to a valid set of fields.
459  /// Use operator bool() to check whether
460  /// the instance is in a valid state.
461  FieldSet& set(Tag tag, Timestamp value);
462 
463  /// Assigns a given value.
464  ///
465  /// \throw std::runtime_error if conversion is impossible
466  /// or the value is not allowed.
467  ///
468  /// \warning Does not check whether the instance refers
469  /// to a valid set of fields.
470  /// Use operator bool() to check whether
471  /// the instance is in a valid state.
472  FieldSet& set(Tag tag, const MaturityMonthYear& value);
473 
474 protected:
476 
477  /// Initializes the instance over the binary data.
479  BinaryBlockBase& binary,
480  const FieldAccessor* accessor)
481  ONIXS_ILINK3_NOTHROW
482  : binary_(binary)
483  , accessor_(accessor)
484  {
485  }
486 
487  /// \return FieldAccessor.
488  const FieldAccessor* accessor() const ONIXS_ILINK3_NOTHROW
489  {
490  return accessor_;
491  }
492 
493  /// Sets the FieldAccessor.
494  void setAccessor(const FieldAccessor* obj) ONIXS_ILINK3_NOTHROW
495  {
496  accessor_ = obj;
497  }
498 
499 private:
500  BinaryBlockBase& binary_;
501  const FieldAccessor* accessor_;
502 };
503 
504 typedef
507 
508 /// Provides a tag-based access to fields
509 /// stored in an SBE-encoded repeating group.
512 {
513 protected:
515 };
516 
517 /// Provides a tag-based access to fields
518 /// stored in an SBE-encoded repeating group.
520 GroupEntry : public FieldSet
521 {
522 public:
523  /// Initializes the instance which refers to
524  /// nothing and thus represents a null instance.
526  : FieldSet(binary_, ONIXS_ILINK3_NULLPTR)
527  , binary_()
528  {
529  }
530 
531  /// Initializes the instance as
532  /// the copy of the given one.
534  : FieldSet(binary_, r.accessor())
535  , binary_(r.binary_)
536  {
537  }
538 
539  /// Re-initializes as the
540  /// copy of the given instance.
542  {
543  setAccessor(r.accessor());
544  this->binary_ = r.binary_;
545 
546  return *this;
547  }
548 
549 protected:
550  friend
552  (
553  Group
554  );
555 
556  /// Full-initialized instances are
557  /// constructed through descendants.
559  : FieldSet(binary_, &accessor)
560  , binary_(binary)
561  {
562  }
563 
564 private:
565  GroupEntrySource binary_;
566 };
567 
568 typedef
570 <
572  MessageSize,
573  MessageSize,
574  MessageSize
575 >
577 
578 /// Implements a tag-based repeating group
579 /// over an SBE-encoded binary data.
581 {
582 public:
583  /// Number of repeating group entries.
584  typedef
587 
588  /// Initializes the instance which refers to
589  /// nothing and thus represent a null instance.
591  : accessor_(ONIXS_ILINK3_NULLPTR)
592  {
593  }
594 
595  /// Indicates whether the instance
596  /// refers to a valid repeating group.
598  {
599  return (ONIXS_ILINK3_NULLPTR != accessor_);
600  }
601 
602  /// Number of entries in the repeating group
603  /// being referred by the given instance.
605  {
606  return binary_.size();
607  }
608 
609  /// Provides access to the group
610  /// entry by its index in the group.
611  GroupEntry operator [](Size index) const
612  {
613  assert(accessor_);
614  assert(binary_.valid());
615 
616  return GroupEntry(binary_[index], *accessor_);
617  }
618 
619 protected:
620  /// Initializes the instance over the binary data.
622  : binary_(binary)
623  , accessor_(&accessor)
624  {
625  }
626 
627 private:
628  GroupEntriesSource binary_;
629  const GroupEntryAccessor* accessor_;
630 };
631 
632 /// Implements tag-based services
633 /// for an SBE-encoded message.
636 {
637  /// \return Message type.
638  virtual StrRef type() const ONIXS_ILINK3_NOTHROW = 0;
639 
640  /// \return a repeating group by its tag.
641  virtual Group group(const SbeMessage&, Tag) const ONIXS_ILINK3_NOTHROW = 0;
642 
643  /// Sets a repeating group by its tag.
644  virtual Group group(SbeMessage&, Tag, MessageSize) const = 0;
645 
646  /// \return Message size.
647  virtual MessageSize calculateBinarySize(const SbeMessage&) const ONIXS_ILINK3_NOTHROW = 0;
648 
649  /// Serializes the given message into
650  /// the tag=value presentation.
651  virtual void toFix(std::string&, const SbeMessage&) const = 0;
652 
653  /// \return the tag=value presentation.
654  std::string toFix(const SbeMessage&, Char delimiter) const;
655 
656 protected:
658 };
659 
660 /// Implements a tag-based interface
661 /// over an SBE-encoded message.
663 Message : public FieldSet
664 {
665 public:
666  /// Initializes the message which refers
667  /// to nothing and thus being a null-instance.
669  : FieldSet(binary_, ONIXS_ILINK3_NULLPTR)
670  , binary_()
671  {
672  }
673 
674  /// Initializes the instance as the copy of the given one.
676  : FieldSet(binary_, r.accessor())
677  , binary_(r.binary_)
678  {
679  }
680 
681  /// Re-initializes as the copy of the given instance.
682  Message& operator = (const Message& r) ONIXS_ILINK3_NOTHROW
683  {
684  setAccessor(r.accessor());
685  this->binary_ = r.binary_;
686 
687  return *this;
688  }
689 
690  /// \return Message type.
692  {
693  return accessor()->type();
694  }
695 
696  /// \return a repeating group by its tag.
697  ///
698  /// \note a null instance is returned if the requested
699  /// group is not available in the message.
701  {
702  assert(binary_.valid());
703 
704  return accessor()->group(binary_, tag);
705  }
706 
707  //// Sets a repeating group with the given number of entries
708  //// by its tag.
709  ///
710  /// \return a null instance if the requested
711  /// group is not available in the given message.
712  Group group(Tag tag, MessageSize size)
713  {
714  assert(binary_.valid());
715 
716  return accessor()->group(binary_, tag, size);
717  }
718 
719  /// \return a variable-length field value.
720  ///
721  /// \throw std::runtime_error if conversion is impossible
722  /// or the value does not exist.
723  ///
724  /// \warning Does not check whether the instance refers
725  /// to a valid set of fields.
726  /// Use operator bool() to check whether
727  /// the instance is in a valid state.
729  {
730  return field(tag).cast<StrRef>();
731  }
732 
733  /// Sets a variable-length field value.
734  ///
735  /// \throw std::runtime_error if conversion is impossible
736  /// or the value does not exist.
737  ///
738  /// \warning Does not check whether the instance refers
739  /// to a valid set of fields.
740  /// Use operator bool() to check whether
741  /// the instance is in a valid state.
743  {
744  set(tag, value);
745 
746  return *this;
747  }
748 
749  /// \return Message size.
750  ///
751  /// \warning Does not check whether the instance refers
752  /// to a valid set of fields.
753  /// Use operator bool() to check whether
754  /// the instance is in a valid state.
756  {
757  assert(binary_.valid());
758 
759  return accessor()->calculateBinarySize(binary_);
760  }
761 
762  /// Builds a tag=value representation.
763  void toFix(std::string& str) const
764  {
765  accessor()->toFix(str, binary_);
766  }
767 
768  /// \return a tag=value representation.
769  ONIXS_ILINK3_NODISCARD std::string toFix(Char delimiter = '\x1') const
770  {
771  return accessor()->toFix(binary_, delimiter);
772  }
773 
774  /// Builds a human-readable tag=value representation.
775  ONIXS_ILINK3_NODISCARD std::string toString() const
776  {
777  return accessor()->toFix(binary_, '|');
778  }
779 
780  /// \return SBE Schema version.
781  ///
782  /// \warning Does not check whether the instance refers
783  /// to a valid set of fields.
784  /// Use operator bool() to check whether
785  /// the instance is in a valid state.
787  {
788  assert(accessor());
789  assert(binary_.valid());
790 
791  return binary_.version();
792  }
793 
794  /// \return Template Id.
795  ///
796  /// \warning Does not check whether the instance refers
797  /// to a valid set of fields.
798  /// Use operator bool() to check whether
799  /// the instance is in a valid state.
801  {
802  assert(accessor());
803  assert(binary_.valid());
804 
805  return binary_.templateId();
806  }
807 
808 protected:
809  /// Initializes the instance from an SBE-encoded message.
811  : FieldSet(binary_, &accessor)
812  , binary_(binary)
813  {
814  }
815 
817 
818 private:
819  const MessageAccessor* accessor() const ONIXS_ILINK3_NOTHROW
820  {
821  const FieldAccessor* const parentAccessor = FieldSet::accessor();
822 
823  assert(parentAccessor);
824  assert(dynamic_cast<const MessageAccessor*>(parentAccessor));
825 
826  return static_cast<const MessageAccessor*>(parentAccessor);
827  }
828 
829 private:
830  SbeMessage binary_;
831 };
832 
833 /// Serializes into a tag=value format.
834 inline void toStr(std::string& str, const Message& message)
835 {
836  message.toFix(str);
837 }
838 
839 /// Serializes into tag=value format.
840 inline std::string toStr(const Message& message)
841 {
842  std::string str;
843 
844  toStr(str, message);
845 
846  return str;
847 }
848 
849 /// Serializes into a stream.
850 inline std::ostream& operator<<(std::ostream& stream, const Message& msg)
851 {
852  return stream << msg.toString();
853 }
854 
#define ONIXS_ILINK3_NULLPTR
Definition: Compiler.h:182
MessageHeader::TemplateId MessageTemplateId
Message type (template) identification.
GroupEntriesSource::Size Size
Number of repeating group entries.
Definition: Message.h:586
Operations over SBE-encoded repeating group entries.
Definition: SbeMessage.h:378
Provides a tag-based access to fields stored in an SBE-encoded block.
Definition: Message.h:33
void setAccessor(const FieldAccessor *obj) noexcept
Sets the FieldAccessor.
Definition: Message.h:494
Message(SbeMessage binary, const MessageAccessor &accessor) noexcept
Initializes the instance from an SBE-encoded message.
Definition: Message.h:810
SbeGroupEntries< GroupEntrySource, MessageSize, MessageSize, MessageSize > GroupEntriesSource
Definition: Message.h:576
Size size() const noexcept
Number of entries in the repeating group being referred by the given instance.
Definition: Message.h:604
std::basic_string_view< Char > StrRef
Definition: StrRef.h:46
char Char
Character type alias.
Definition: String.h:30
void toFix(std::string &str, const Negotiate500 &obj)
Serializes the object into FIX presentation.
A real number with a floating exponent.
Definition: Decimal.h:32
MessageSize calculateBinarySize() const noexcept
Definition: Message.h:755
#define ONIXS_ILINK3_EXPLICIT
Definition: Compiler.h:177
MessageHeader::Version SchemaVersion
SBE-encoded data version type.
Definition: SchemaTraits.h:30
SbeGroupEntry< MessageSize > GroupEntrySource
Definition: Message.h:506
Group group(Tag tag) const noexcept
Definition: Message.h:700
Provides a tag-based access to fields stored in an SBE-encoded repeating group.
Definition: Message.h:519
GroupEntry() noexcept
Initializes the instance which refers to nothing and thus represents a null instance.
Definition: Message.h:525
#define ONIXS_ILINK3_MESSAGING_TAGBASED_NAMESPACE_END
Definition: ABI.h:153
FieldSet & resetField(Tag tag)
Resets the field by its tag.
Definition: Message.h:111
const FieldAccessor * accessor() const noexcept
Definition: Message.h:488
UInt16 UInt16
uInt16.
Definition: Fields.h:296
FieldSet & setField(Tag tag, const Field &field)
Assigns the field by its tag.
Definition: Message.h:91
FieldSet & reset() noexcept
Resets all variable-length and optional fields.
Definition: Message.h:67
Enumeration::Enum getEnumeration(Tag tag) const
Definition: Message.h:297
#define ONIXS_ILINK3_DEFAULT
Definition: Compiler.h:202
#define ONIXS_ILINK3_LTWT_CLASS
Definition: ABI.h:84
A field in a tag-based message.
Definition: Field.h:29
Message(const Message &r) noexcept
Initializes the instance as the copy of the given one.
Definition: Message.h:675
std::string toStr(const Message &message)
Serializes into tag=value format.
Definition: Message.h:840
Group group(Tag tag, MessageSize size)
by its tag.
Definition: Message.h:712
std::string toString() const
Builds a human-readable tag=value representation.
Definition: Message.h:775
Message() noexcept
Initializes the message which refers to nothing and thus being a null-instance.
Definition: Message.h:668
Field field(Tag tag) const noexcept
Definition: Message.h:80
UInt16 MessageSize
Message length type.
Definition: Aliases.h:29
#define ONIXS_ILINK3_LTWT_CLASS_DECL(name)
Definition: ABI.h:96
MessageTemplateId templateId() const
Definition: Message.h:800
UInt64 UInt64
uInt64.
Definition: Fields.h:308
Group(const GroupEntriesSource &binary, const GroupEntryAccessor &accessor) noexcept
Initializes the instance over the binary data.
Definition: Message.h:621
#define ONIXS_ILINK3_EXPORTED_STRUCT
Definition: ABI.h:48
void toFix(std::string &str) const
Builds a tag=value representation.
Definition: Message.h:763
Provides a tag-based access to fields stored in an SBE-encoded repeating group.
Definition: Message.h:510
FieldSet(BinaryBlockBase &binary, const FieldAccessor *accessor) noexcept
Initializes the instance over the binary data.
Definition: Message.h:478
UInt32 UInt32
uInt32.
Definition: Fields.h:302
Implements tag-based services for an SBE-encoded message.
Definition: Message.h:634
GroupEntry(const GroupEntry &r) noexcept
Initializes the instance as the copy of the given one.
Definition: Message.h:533
std::string toFix(Char delimiter= '\x1') const
Definition: Message.h:769
Implements a tag-based interface over an SBE-encoded message.
Definition: Message.h:662
Implements a tag-based repeating group over an SBE-encoded binary data.
Definition: Message.h:580
std::ostream & operator<<(std::ostream &stream, const Message &msg)
Serializes into a stream.
Definition: Message.h:850
The time point without the time-zone information.
Definition: Time.h:467
#define ONIXS_ILINK3_MESSAGING_TAGBASED_NAMESPACE_BEGIN
Definition: ABI.h:149
#define ONIXS_ILINK3_NODISCARD
Definition: Compiler.h:185
#define ONIXS_ILINK3_NOTHROW
Definition: Compiler.h:176
UInt32 Tag
The type whose values are used to locate fields in tag-based messages.
Definition: Tag.h:29
Message & setVarData(Tag tag, StrRef value)
Sets a variable-length field value.
Definition: Message.h:742
Group()
Initializes the instance which refers to nothing and thus represent a null instance.
Definition: Message.h:590