1
0
forked from 0ad/0ad
0ad/source
elexis 3028551b91 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: 0a7d0ecdde, 8f4f8e240f, c19f3608a5
  NONCOPYABLE Image, Sprite: fb8032043b
  NONCOPYABLE GUI page: 94c57085e9
  NONCOPYABLE GUIManager: 7c2e9027c2
  NONCOPYABLE macro: 16ccae10cd

This was SVN commit r22637.
2019-08-09 17:25:55 +00:00
..
collada Fix compiler warnings on VS 2015, refs #3439, refs #5069. 2018-03-10 09:58:53 +00:00
graphics Refactor renderer options. 2019-08-04 08:28:30 +00:00
gui MOVABLE idiom, const CGUI struct maps, in place move construction instead of copying temporaries during CGUI XML loading and GenerateText. 2019-08-09 17:25:55 +00:00
i18n Simple refactoring of Singleton. Make it non-copyable. 2019-01-13 15:11:40 +00:00
lib MOVABLE idiom, const CGUI struct maps, in place move construction instead of copying temporaries during CGUI XML loading and GenerateText. 2019-08-09 17:25:55 +00:00
lobby Provide ScriptInterface CreateObject and CreateArray functions to replace Eval calls following 7c2e9027c2, 1c0536bf08 and later. 2019-07-22 19:35:14 +00:00
maths Cleanups BoundingBoxAxisAligned and fixes coding styles a bit. 2019-06-12 20:23:14 +00:00
mocks More FreeBSD build fixes. 2012-01-30 06:21:11 +00:00
network Provide ScriptInterface CreateObject and CreateArray functions to replace Eval calls following 7c2e9027c2, 1c0536bf08 and later. 2019-07-22 19:35:14 +00:00
pch Update precompiled headers to improve build times. 2019-05-26 07:21:12 +00:00
ps Upgrade SpiderMonkey to version 45.0.2, refs #4893. 2019-08-07 22:37:43 +00:00
renderer Fix no-pch build following renderer options refactoring 5c4d124d2a 2019-08-04 20:08:06 +00:00
scriptinterface Revert use of the isRunOnce flag after removal in 64b477625d of compile'n go, refs #4893. 2019-08-08 09:05:42 +00:00
simulation2 Upgrade SpiderMonkey to version 45.0.2, refs #4893. 2019-08-07 22:37:43 +00:00
soundmanager Fix lineendings. 2019-07-12 17:40:40 +00:00
third_party Removes deprecated 'register' storage class from mongoose. Refs #3068 2019-07-18 06:28:51 +00:00
tools Refactor renderer options. 2019-08-04 08:28:30 +00:00
main.cpp Alt+tab fix for ca9109be75 - call sound IdleTask in Atlas and swap buffers only once in Atlas. 2019-07-24 16:40:34 +00:00
test_setup.cpp Fix string format of the JS test assertion failure following 7c2e9027c2 (cxxtest expects a char* instead of a std::wstring, so newlines were printed as \n characters). 2017-10-13 21:56:45 +00:00