HomeWildfire Games

MOVABLE idiom, const CGUI struct maps, in place move construction instead of…

Description

MOVABLE idiom, const CGUI struct maps, in place move construction instead of copying temporaries during CGUI XML loading and GenerateText.

Introduce MOVABLE idiom indicating that a class can use move semantics.
Make values of CGUI struct maps holding XML data const to ensure at the root that the data is not modified.
Use NONCOPYABLE and MOVABLE for SGUIIcon and SGUIStyle to enforce the non-copy policy on the compiler level (until someone changes the GUI design to make modifications needed).

As indicated by that:

Replace copy operations by in place move operations for these CGUI struct maps in the CGUI Xeromyces XML loading functions.
Replace copy operations by const references for CSize and SGUIIcon in CGUIString::GenerateTextCall and CGUI::GenerateText.
This avoids copying of non primitive members, such as the strings and containers of strings.

Further related cleanup to be kept separated for auditability.

Differential Revision: https://code.wildfiregames.com/D2163
Few comments on IRC by: wraitii, Itms
Tested on: gcc 9, Jenkins, partially VS2015

Refs #1984,

NONCOPYABLE CGUISpriteInstances: rP22570, rP1518, rP1507
NONCOPYABLE Image, Sprite: rP14493
NONCOPYABLE GUI page: rP13419
NONCOPYABLE GUIManager: rP7259
NONCOPYABLE macro: rP6536