OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
SettingGroup Class Reference

#include <OnixS/CME/MDH/SettingGroup.h>

Public Member Functions

 SettingGroup (SettingChangeController *controller=nullptr)
 ~SettingGroup ()=default
template<class Assignee, class Value>
void controlAssignment (const Messaging::Char *description, Assignee &assignee, Value value) const
template<class Changeable>
void controlChange (const Messaging::Char *description, void(Changeable::*change)(), Changeable &changeable) const
template<class Change, class Changeable, class Arg>
void controlChange (const Messaging::Char *description, Change change, Changeable &changeable, const Arg &arg) const
template<class Change, class Changeable, class Arg1, class Arg2>
void controlChange (const Messaging::Char *description, Change change, Changeable &changeable, const Arg1 &arg1, const Arg2 &arg2) const

Static Public Member Functions

static const SettingGroup & null () noexcept

Detailed Description

The group does not own its controller. A supplied controller must outlive the group and every setting that refers to the group. Groups are non-copyable.

Definition at line 111 of file SettingGroup.h.

Constructor & Destructor Documentation

◆ SettingGroup()

SettingGroup ( SettingChangeController * controller = nullptr)
inline

Creates a setting group that uses the specified controller.

Parameters
controllerController for guarded changes, or null to use the shared controller that accepts every change.
Note
A non-null controller must outlive this group.

Definition at line 118 of file SettingGroup.h.

◆ ~SettingGroup()

~SettingGroup ( )
default

Destroys the group without destroying its controller.

Member Function Documentation

◆ controlAssignment()

template<class Assignee, class Value>
void controlAssignment ( const Messaging::Char * description,
Assignee & assignee,
Value value ) const
inline

Assigns a value while coordinating the change with the controller.

Template Parameters
AssigneeType of the destination object.
ValueType copied into the function and assigned to the destination.
Parameters
descriptionHuman-readable change description forwarded to the controller; may be null.
assigneeDestination object to update.
valueSource value copied or moved before the controller is invoked.
Exceptions
Anyexception thrown while copying the source, starting the change, or assigning the value.
Note
A successfully started change is completed even if assignment throws.

Definition at line 136 of file SettingGroup.h.

◆ controlChange() [1/3]

template<class Change, class Changeable, class Arg>
void controlChange ( const Messaging::Char * description,
Change change,
Changeable & changeable,
const Arg & arg ) const
inline

Invokes a one-argument member function as a guarded change.

Template Parameters
ChangeType of the member-function pointer.
ChangeableType of the object being changed.
ArgType of the argument passed to the member function.
Parameters
descriptionHuman-readable change description forwarded to the controller; may be null.
changeMember function to invoke.
changeableObject on which to invoke the member function.
argArgument passed to the member function.
Exceptions
Anyexception thrown while starting the change or invoking the member function.
Note
A successfully started change is completed even if the member function throws.

Definition at line 167 of file SettingGroup.h.

◆ controlChange() [2/3]

template<class Change, class Changeable, class Arg1, class Arg2>
void controlChange ( const Messaging::Char * description,
Change change,
Changeable & changeable,
const Arg1 & arg1,
const Arg2 & arg2 ) const
inline

Invokes a two-argument member function as a guarded change.

Template Parameters
ChangeType of the member-function pointer.
ChangeableType of the object being changed.
Arg1Type of the first argument passed to the member function.
Arg2Type of the second argument passed to the member function.
Parameters
descriptionHuman-readable change description forwarded to the controller; may be null.
changeMember function to invoke.
changeableObject on which to invoke the member function.
arg1First argument passed to the member function.
arg2Second argument passed to the member function.
Exceptions
Anyexception thrown while starting the change or invoking the member function.
Note
A successfully started change is completed even if the member function throws.

Definition at line 186 of file SettingGroup.h.

◆ controlChange() [3/3]

template<class Changeable>
void controlChange ( const Messaging::Char * description,
void(Changeable::* change )(),
Changeable & changeable ) const
inline

Invokes a zero-argument member function as a guarded change.

Template Parameters
ChangeableType of the object being changed.
Parameters
descriptionHuman-readable change description forwarded to the controller; may be null.
changeMember function to invoke.
changeableObject on which to invoke the member function.
Exceptions
Anyexception thrown while starting the change or invoking the member function.
Note
A successfully started change is completed even if the member function throws.

Definition at line 150 of file SettingGroup.h.

◆ null()

const SettingGroup & null ( )
staticnoexcept

Obtains the shared group that accepts every change.

Returns
Reference to the process-wide group backed by the trivial controller.
Note
The caller does not own the returned instance and must not delete it.