OnixS C++ CME MDP Conflated UDP Handler 1.1.2
API documentation
Loading...
Searching...
No Matches
SessionSettings.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 <string>
24
27
29
58
60ONIXS_CONFLATEDUDP_EXPORTED
61void
63 std::string&,
65
67inline
68std::string
71{
72 std::string str;
73
74 toStr(str, recovery);
75
76 return str;
77}
78
102
104ONIXS_CONFLATEDUDP_EXPORTED
105void
107 std::string&,
109
111inline
112std::string
115{
116 std::string str;
117
118 toStr(str, handling);
119
120 return str;
121}
122
159
161ONIXS_CONFLATEDUDP_EXPORTED
162void
164 std::string&,
166
168inline
169std::string
172{
173 std::string str;
174
175 toStr(str, option);
176
177 return str;
178}
179
181(
182 TcpRecoveryService
183);
184
188{
190 friend
192 (
194 );
195
196 //
197
198 const SettingGroup& group_;
199
200 TcpRecoveryService* service_;
201
202 UInt32 attempts_;
203 UInt32 servingTimeLimit_;
204
205 // Re-initializes the instance as a copy of the
206 // other one and bypassing assignment control.
207 void
208 assignNoControl(
209 const
211 {
212 service_ =
213 other.service_;
214
215 attempts_ =
216 other.attempts_;
217
218 servingTimeLimit_ =
219 other.servingTimeLimit_;
220 }
221
222public:
228 const SettingGroup* group = NULL)
229 : group_(
230 group
231 ? *group
232 : SettingGroup::null())
233 , service_(NULL)
234 , attempts_(1)
235 , servingTimeLimit_(10)
236 {
237 }
238
244 const TcpRecoverySessionSettings& other)
245 : group_(SettingGroup::null())
246 , service_(other.service_)
247 , attempts_(other.attempts_)
248 , servingTimeLimit_(
249 other.servingTimeLimit_)
250 {
251 }
252
257
265 service() const
266 {
267 return service_;
268 }
269
273 void
276 {
277 group_.
278 controlAssignment
279 (
280 "TCP Recovery Service Instance",
281 service_,
282 service
283 );
284 }
285
291 UInt32
292 attempts() const
293 {
294 return attempts_;
295 }
296
302 void
304 UInt32 qty)
305 {
306 group_.
307 controlAssignment
308 (
309 "TCP Recovery Attempt Quantity",
310 attempts_,
311 qty
312 );
313 }
314
323 UInt32
325 {
326 return servingTimeLimit_;
327 }
328
335 void
338 {
339 group_.
340 controlAssignment
341 (
342 "TCP Recovery Serving Time Limit",
343 servingTimeLimit_,
345 );
346 }
347
351 operator =(
352 const
354 {
355 group_.
356 controlAssignment
357 (
358 "TCP Recovery Session Settings",
359 &TcpRecoverySessionSettings::assignNoControl,
360 *this,
361 other
362 );
363
364 return *this;
365 }
366};
367
369ONIXS_CONFLATEDUDP_EXPORTED
370void
372 std::string&,
373 const
375
377inline
378std::string
380 const
382{
383 std::string str;
384
385 toStr(str, settings);
386
387 return str;
388}
389
396{
397 JoinRecoveryOptions::Enum joinRecovery_;
398 GapAndErrorHandlingOptions::Enum gapAndErrorHandling_;
399
400 InstrumentRecoveryOptions::Enum instrumentRecovery_;
401
402protected:
405 const
406 SettingGroup&
407 group() const
408 {
409 return *this;
410 }
411
414 void
416 const SessionSettings& other)
417 {
418 joinRecovery_ =
419 other.joinRecovery_;
420
421 gapAndErrorHandling_ =
422 other.gapAndErrorHandling_;
423
424 instrumentRecovery_ =
425 other.instrumentRecovery_;
426 }
427
428public:
432 controller = NULL)
433 : SettingGroup(controller)
434 , joinRecovery_(
436 InstrumentsAndMarketState)
437 , gapAndErrorHandling_(
439 RecoverMarketState)
440 , instrumentRecovery_(
442 Accurate)
443 {
444 }
445
449 const SessionSettings& other)
450 : SettingGroup()
451 , joinRecovery_(
452 other.joinRecovery_)
453 , gapAndErrorHandling_(
454 other.gapAndErrorHandling_)
455 , instrumentRecovery_(
456 other.instrumentRecovery_)
457 {
458 }
459
462 {
463 }
464
472 {
473 return joinRecovery_;
474 }
475
478 void
481 {
482 group().
484 (
485 "Join Recovery Strategy",
486 joinRecovery_,
487 recovery
488 );
489 }
490
498 {
499 return gapAndErrorHandling_;
500 }
501
504 void
507 {
508 group().
510 (
511 "Gap And Error Handling Strategy",
512 gapAndErrorHandling_,
513 handling
514 );
515 }
516
522 {
523 return instrumentRecovery_;
524 }
525
527 void
530 {
531 group().
533 (
534 "Instrument Recovery Strategy",
535 instrumentRecovery_,
536 recovery
537 );
538 }
539
545 operator =(
546 const SessionSettings& other)
547 {
548 group().
550 (
551 "Session Settings",
553 *this,
554 other
555 );
556
557 return *this;
558 }
559};
560
562ONIXS_CONFLATEDUDP_EXPORTED
563void
565 std::string&,
566 const SessionSettings&);
567
569inline
570std::string
572 const SessionSettings& settings)
573{
574 std::string str;
575
576 toStr(str, settings);
577
578 return str;
579}
580
585 : public SessionSettings
586{
587 // Lets grouping and value assignment control functioning.
589
590 TcpRecoverySessionSettings tcpRecovery_;
591
592 // Re-initializes the instance as a copy of the
593 // other one and bypassing assignment control.
594 void
595 assignNoControl(
596 const AdvancedSessionSettings& other)
597 {
599
600 tcpRecovery_.assignNoControl(other.tcpRecovery_);
601 }
602
603public:
607 controller = NULL)
608 : SessionSettings(controller)
609 , tcpRecovery_(&group())
610 {
611 }
612
616 const AdvancedSessionSettings& other)
618 static_cast
619 <const SessionSettings&>
620 (other))
621 , tcpRecovery_(
622 other.tcpRecovery_)
623 {
624 }
625
630
632 const
635 {
636 return tcpRecovery_;
637 }
638
642 {
643 return tcpRecovery_;
644 }
645
651 operator =(
652 const AdvancedSessionSettings& other)
653 {
654 group().
656 (
657 "Advanced Session Settings",
658 &AdvancedSessionSettings::assignNoControl,
659 *this,
660 other
661 );
662
663 return *this;
664 }
665};
666
668ONIXS_CONFLATEDUDP_EXPORTED
669void
671 std::string&,
673
675inline
676std::string
678 const
679 AdvancedSessionSettings& settings)
680{
681 std::string str;
682
683 toStr(str, settings);
684
685 return str;
686}
687
688// Various functions helping in configuring session in the desired way.
689
693inline
694void
696(
697 SessionSettings& settings
698)
699{
700 settings.
701 instrumentRecovery(
703 Accurate);
704}
705
709inline
710void
712(
713 SessionSettings& settings
714)
715{
716 settings.
717 instrumentRecovery(
719 Fast);
720}
721
725inline
726void
728(
729 SessionSettings& settings
730)
731{
732 settings.
733 joinRecovery(
735 Disabled);
736}
737
741inline
742void
744 SessionSettings& settings)
745{
746 settings.
747 joinRecovery(
749 InstrumentsAndMarketState);
750}
751
755inline
756void
758(
759 SessionSettings& settings
760)
761{
762 settings.
763 gapAndErrorHandling(
765 RecoverInstrumentsAndMarketState);
766}
767
771inline
772void
774(
775 SessionSettings& settings
776)
777{
778 settings.
779 gapAndErrorHandling(
781 RecoverMarketState);
782}
783
787inline
788void
790(
791 SessionSettings& settings
792)
793{
794 settings.
795 gapAndErrorHandling(
797 ContinueProcessing);
798}
799
800// Complex (one-call) setup.
801
807inline
808void
810(
811 SessionSettings& settings
812)
813{
815 (
816 settings
817 );
819 (
820 settings
821 );
823 (
824 settings
825 );
826}
827
832inline
833void
835(
836 SessionSettings& settings
837)
838{
840 (
841 settings
842 );
844 (
845 settings
846 );
848 (
849 settings
850 );
851}
852
857inline
858void
860 SessionSettings& settings)
861{
863 (
864 settings
865 );
867 (
868 settings
869 );
870}
871
872// Deprecated way of session setup.
873
874#if !defined (ONIXS_CONFLATEDUDP_NO_DEPRECATED)
875
891
908
925
926#endif // ONIXS_CONFLATEDUDP_NO_DEPRECATED
927
#define ONIXS_CONFLATEDUDP_LTWT_STRUCT
Definition Bootstrap.h:99
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition Bootstrap.h:95
#define ONIXS_CONFLATEDUDP_EXPORTED_CLASS_DECL(typeName)
Definition Bootstrap.h:47
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_LTWT_CLASS_DECL(name)
Definition Bootstrap.h:107
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
const TcpRecoverySessionSettings & tcpRecovery() const
Set of TCP recovery settings.
TcpRecoverySessionSettings & tcpRecovery()
Editable set of TCP recovery settings.
AdvancedSessionSettings(SettingAssignController *controller=NULL)
Initializes parameters with default values.
AdvancedSessionSettings(const AdvancedSessionSettings &other)
void joinRecovery(JoinRecoveryOptions::Enum recovery)
InstrumentRecoveryOptions::Enum instrumentRecovery() const
SessionSettings(const SessionSettings &other)
JoinRecoveryOptions::Enum joinRecovery() const
void assignNoControl(const SessionSettings &other)
GapAndErrorHandlingOptions::Enum gapAndErrorHandling() const
void gapAndErrorHandling(GapAndErrorHandlingOptions::Enum handling)
void instrumentRecovery(InstrumentRecoveryOptions::Enum recovery)
Defines how instrument definitions are recovered.
SessionSettings(SettingAssignController *controller=NULL)
Initializes parameters with default values.
Base services for settings grouped by a certain criteria.
void controlAssignment(const Char *description, Assignee &assignee, Value value) const
Collection of session settings related to TCP recovery.
TcpRecoverySessionSettings(const SettingGroup *group=NULL)
friend class AdvancedSessionSettings
Lets grouping and value assignment control functioning.
TcpRecoverySessionSettings(const TcpRecoverySessionSettings &other)
void setSessionToRecoverInstrumentsFast(SessionSettings &settings)
void setSessionToJoinInPreopening(SessionSettings &settings)
void setSessionToNaturalRefresh(SessionSettings &settings)
void setSessionToFullRecoverUponRealtimeIssues(SessionSettings &settings)
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
void setSessionToRecoverInstrumentsAccurately(SessionSettings &settings)
UInt32 UInt32
uInt32.
Definition Fields.h:261
void setSessionToContinueRealtimeProcessingUponIssues(SessionSettings &settings)
void setSessionToLateJoin(SessionSettings &settings)
void setSessionToRecoverBooksUponRealtimeIssues(SessionSettings &settings)
void setSessionToAccurateLateJoin(SessionSettings &settings)
void setSessionToAccuratePreopening(SessionSettings &settings)
@ ContinueProcessing
Handler continues processing of real-time market data.
@ RecoverMarketState
Handler recovers market state from snapshots.
@ RecoverInstrumentsAndMarketState
Handler recovers instruments and market state afterwards.
Defines different ways of instrument definition recovery.