71 : controller_(controller)
73 controller_.beginChange(group, details);
79 controller_.endChange();
106 template <
class Assignee,
class Value>
117 template <
class Changeable>
118 void controlChange(
const Char* description,
void (Changeable::*change)(), Changeable& changeable)
const
122 (changeable.*change)();
128 template <
class Change,
class Changeable,
class Arg>
129 void controlChange(
const Char* description, Change change, Changeable& changeable,
const Arg& arg)
const
133 (changeable.*change)(arg);
139 template <
class Change,
class Changeable,
class Arg1,
class Arg2>
141 controlChange(
const Char* description, Change change, Changeable& changeable,
const Arg1& arg1,
const Arg2& arg2)
146 (changeable.*change)(arg1, arg2);
167 return (&left == &right);
173 return (&left != &right);
179template <
class Type,
class Container = std::vector<Type> >
190 typedef typename Items::size_type
Size;
205 , items_(other.items_)
210 template <
class InputIterator>
213 , items_(first, last)
226 return items_.empty();
232 return items_.size();
238 return items_.begin();
250 return items_[index];
255 template <
class Initializer>
258 group_.controlChange(
"Initialize List", &ListSetting::initNoControl<Initializer>, *
this, initializer);
264 group_.controlChange(
265 "Append an Item",
static_cast<void (
Items::*)(
const Item&)
>(&Items::push_back), items_, item
275 group_.controlChange(
"Clear the List", &Items::clear, items_);
287 template <
class InputIterator>
290 group_.controlChange(
"Assign List", &Items::assign, items_, first, last);
303 items_ = other.items_;
313 template <
class Initializer>
314 void initNoControl(Initializer initializer)
335 if (++item == endOfList)
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
#define ONIXS_CMEMDH_LTWT
#define ONIXS_CMEMDH_LTWT_CLASS_DECL(name)
#define ONIXS_CMEMDH_LTWT_EXPORTED
#define ONIXS_CMEMDH_NAMESPACE_END
#define ONIXS_CMEMDH_NULLPTR
#define ONIXS_CMEMDH_OVERRIDE
Represents a setting which is a list of values.
Iterator begin() const
Returns iterator pointing to the beginning of the list.
ListSetting & assign(InputIterator first, InputIterator last)
Re-initialize the list as a copy of the given range.
const Item & operator[](Size index) const
Provides access to the items by its index.
ListSetting & operator=(const ListSetting &other)
Re-initialize the list as a copy of the other one.
void initialize(Initializer initializer)
Performs managed initialization of the list using the given functional object.
ListSetting & assignNoControl(const ListSetting &other)
Unmanaged assignment of the list.
Iterator end() const
Returns iterator pointing to the item beyond the last one.
bool empty() const
Indicates whether the list is an empty one.
ListSetting(InputIterator first, InputIterator last)
Initializes as copy of the given range of items.
Items::const_iterator Iterator
ListSetting(const ListSetting &other)
Initializes as a copy the other instance.
void push_back(const Item &item)
Appends the given item to the tail of the list.
std::vector< std::string > Items
void clear()
Removes all items from the list.
Size size() const
Returns number of items in the given list.
ListSetting(const SettingGroup *group=nullptr)
Initializes the instance belonging to the given group of settings.
Scope guard to update setting in the safe way.
~SettingChangeGuard()
Accomplishes setting update.
SettingChangeGuard(SettingChangeController &controller, const SettingGroup &group, const Char *details)
Initializes the guard for the given setting update.
Base services for settings grouped by a certain criteria.
void controlAssignment(const Char *description, Assignee &assignee, Value value) const
Guarded assignment of the given value to the given variable.
void controlChange(const Char *description, Change change, Changeable &changeable, const Arg1 &arg1, const Arg2 &arg2) const
Guarded invoke of the given routine which assumes complex change or update for the given object.
SettingGroup(SettingChangeController *controller=nullptr)
Initializes the group of settings with the given validation services.
void controlChange(const Char *description, void(Changeable::*change)(), Changeable &changeable) const
Guarded invoke of the given routine which assumes complex change or update for the given object.
void controlChange(const Char *description, Change change, Changeable &changeable, const Arg &arg) const
Guarded invoke of the given routine which assumes complex change or update for the given object.
static const SettingGroup & null()
Returns an instance representing a null group.
~SettingGroup()
Does actually nothing.
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
char Char
Character type alias.
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Represents a service controlling change/update operations for the collections of settings.
virtual void endChange()=0
Accomplishes the setting change operation.
virtual void beginChange(const SettingGroup &, const Char *)=0
Begins the setting change operation.
void endChange() override
Implements base class interface.
static SettingChangeController & self()
Returns instance of the trivial assignment controller.
void beginChange(const SettingGroup &, const Char *) override
Implements base class interface.