47 virtual void endChange() = 0;
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);
179 template <
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)
218 operator const Items&()
const 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_);
281 group_.controlChange(
"Assign List", &ListSetting::assignNoControl, *
this, other);
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)
324 template <
class Type>
335 if (++item == endOfList)
Represents a setting which is a list of values.
#define ONIXS_CMEMDH_OVERRIDE
ListSetting & assign(InputIterator first, InputIterator last)
Re-initialize the list as a copy of the given range.
ListSetting & operator=(const ListSetting &other)
Re-initialize the list as a copy of the other one.
void clear()
Removes all items from the list.
#define ONIXS_CMEMDH_NULLPTR
void initialize(Initializer initializer)
Performs managed initialization of the list using the given functional object.
bool operator!=(const SettingGroup &left, const SettingGroup &right)
Checks the two groups for inequality.
~SettingChangeGuard()
Accomplishes setting update.
#define ONIXS_CMEMDH_LTWT
Container Items
Internal container used to store items.
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...
Scope guard to update setting in the safe way.
void controlAssignment(const Char *description, Assignee &assignee, Value value) const
Guarded assignment of the given value to the given variable.
ListSetting(const ListSetting &other)
Initializes as a copy the other instance.
void toStr(std::string &str, const ListSetting< Type > &list, Char delimiter= ',')
Serializes the given list setting into a string/text presentation.
char Char
Character type alias.
bool value(Number &number, const MultiContainer &container, Tag tag)
Finds a tag-value entry in the given collection by the given tag and returns its value component tran...
SettingChangeGuard(SettingChangeController &controller, const SettingGroup &group, const Char *details)
Initializes the guard for the given setting update.
Iterator begin() const
Returns iterator pointing to the beginning of the list.
const Item & operator[](Size index) const
Provides access to the items by its index.
void push_back(const Item &item)
Appends the given item to the tail of the list.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
ListSetting(InputIterator first, InputIterator last)
Initializes as copy of the given range of items.
void endChange() override
Implements base class interface.
Base services for settings grouped by a certain criteria.
Items::size_type Size
Type in which items are counted.
bool operator==(const SettingGroup &left, const SettingGroup &right)
Checks the two groups for equality.
ListSetting(const SettingGroup *group=nullptr)
Initializes the instance belonging to the given group of settings.
Items::const_iterator Iterator
Constant iterator over the items.
#define ONIXS_CMEMDH_LTWT_CLASS_DECL(name)
SettingGroup(SettingChangeController *controller=nullptr)
Initializes the group of settings with the given validation services.
#define ONIXS_CMEMDH_LTWT_EXPORTED
ListSetting & assignNoControl(const ListSetting &other)
Unmanaged assignment of the list.
Size size() const
Returns number of items in the given list.
Represents a service controlling change/update operations for the collections of settings.
void beginChange(const SettingGroup &, const Char *) override
Implements base class interface.
Iterator end() const
Returns iterator pointing to the item beyond the last one.
bool empty() const
Indicates whether the list is an empty one.
Type Item
Alias for the type representing the list item.
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...
~SettingGroup()
Does actually nothing.
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...
#define ONIXS_CMEMDH_NAMESPACE_END