{"id":344179,"date":"2023-01-19T09:03:42","date_gmt":"2023-01-19T09:03:42","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=344179"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=344179","title":{"rendered":"<span>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 Waffle++ \u0434\u043b\u044f C++<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/072\/c49\/708\/072c49708bac3adaa4596d69156d446b.png\" alt=\"\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0441\u0445\u0430\u043b\u043e\u043a: https:\/\/clck.ru\/33J7ck\" title=\"\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0441\u0445\u0430\u043b\u043e\u043a: https:\/\/clck.ru\/33J7ck\" width=\"1135\" height=\"523\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/072\/c49\/708\/072c49708bac3adaa4596d69156d446b.png\"\/><figcaption>\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0441\u0445\u0430\u043b\u043e\u043a: https:\/\/clck.ru\/33J7ck<\/figcaption><\/figure>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Boilerplate_code\" rel=\"noopener noreferrer nofollow\">boilerplate<\/a>-\u043a\u043e\u0434 (\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442) \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>\u042f \u0434\u0435\u043b\u0430\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f C++, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439: \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 enum \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 JSON \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043b\u043e\u0442\u043e\u0432 \u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u0441\u0432\u043e\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c, \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432&#8230;<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 showcase, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0438 \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0432 \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b.<\/p>\n<h2>\u041f\u043e\u0447\u0435\u043c\u0443 Waffle++?<\/h2>\n<p>\u0412\u0430\u0444\u043b\u0438 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e <a href=\"https:\/\/www.google.com\/search?q=belgian+waffle&amp;tbm=isch\" rel=\"noopener noreferrer nofollow\">\u0431\u0435\u043b\u044c\u0433\u0438\u0439\u0441\u043a\u0438\u0435<\/a>) \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 boilerplate. \u0412\u0430\u0444\u0435\u043b\u044c\u043d\u0438\u0446\u0430 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0438\u0437\u0434\u0435\u043b\u0438\u044f \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u043a\u0430\u043a \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u0438\u0448\u0435\u0442 boilerplate-\u043a\u043e\u0434 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 <code>waffle++<\/code> \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0437\u0430\u043d\u044f\u0442\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0439 \u043a\u0443\u0447\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e <code>waffle<\/code> &#8212; <a href=\"https:\/\/github.com\/search?q=waffle&amp;type=repositories&amp;p=1\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0433\u0438\u0442\u0445\u0430\u0431\u0443<\/a>.<\/p>\n<h2>Enum \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/h2>\n<p>\u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u043d\u0435\u0438\u043c\u0435\u043d\u0438\u0435\u043c \u043b\u0443\u0447\u0448\u0438\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u044d\u0442\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0441 \u043e\u0431\u0437\u043e\u0440\u043e\u043c \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>Waffle++ \u0447\u0438\u0442\u0430\u0435\u0442 \u043e\u0441\u043e\u0431\u043e \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u0427\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Doxygen\" rel=\"noopener noreferrer nofollow\">Doxygen<\/a> &#8212; \u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u0442\u0443\u043b\u0437\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. Waffle++ \u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0432\u043e\u0438 &#171;\u043a\u043e\u043c\u0430\u043d\u0434\u044b&#187; \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 <a href=\"https:\/\/www.doxygen.nl\/manual\/commands.html\" rel=\"noopener noreferrer nofollow\">\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 &#171;\u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438&#187;<\/a> Doxygen.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 enum \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 header, \u0433\u0434\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">#pragma once  #include &lt;span> #include &lt;string_view>  namespace Waffle {  template&lt;typename EnumType> EnumType FromString(std::string_view value);  template&lt;typename EnumType> EnumType FromStringOrDefault(std::string_view value, EnumType defaultResult);  template&lt;typename EnumType> std::string_view ToString(EnumType value);  template&lt;typename EnumType> std::span&lt;const EnumType> GetAllEnumValues();  } \/\/ namespace Waffle<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>enum class Color<\/code>, \u0442\u043e \u0431\u0435\u0437 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u044d\u0442\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u0443\u043f\u0430\u0434\u0435\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c enum \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>serializable<\/code>, \u0447\u0442\u043e\u0431\u044b Waffle++ &#171;\u0443\u0432\u0438\u0434\u0435\u043b&#187; \u0435\u0433\u043e:<\/p>\n<pre><code class=\"cpp\">\/\/ @serializable enum class Color {     Red,     Green,     Blue,     Cyan,     Magenta,     Yellow,     Black };<\/code><\/pre>\n<p>\u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e\u0442 enum \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>foo.h<\/code>, \u0442\u043e\u0433\u0434\u0430 Waffle++ \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <code>foo.enum_serializer.cpp<\/code> \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0438 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u043a \u043e\u0434\u043d\u043e\u043c\u0443, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <code>Waffle::ToString(Color::Red)<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 <code>\"Red\"<\/code>.<\/p>\n<p>\u041d\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>stringvalue<\/code> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a (&#171;\u043a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u043e\u0439&#187; \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435):<\/p>\n<pre><code class=\"cpp\">\/*  * @brief Represents the color of a book  * @author Izaron  * @serializable  *\/ enum class BookColor {     kRed, \/\/\/&lt; @stringvalue red rot rouge     kGreen, \/\/\/&lt; @stringvalue green gr\u00fcn vert     kBlue, \/\/\/&lt; @stringvalue blue blau bleu };<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0438\u0442\u0430\u0435\u0442 Doxygen (<code>brief<\/code>, <code>author<\/code>) \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0430\u043d\u044b \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 Waffle++ (<code>serializable<\/code>, <code>stringvalue<\/code> ).<\/p>\n<p>\u0412\u044b\u0437\u043e\u0432<code>ToString(BookColor::kRed)<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code>\"red\"<\/code>. \u0412\u044b\u0437\u043e\u0432\u044b <code>FromString&lt;BookColor>(XXX)<\/code> \u0432\u0435\u0440\u043d\u0443\u0442 <code>BookColor::kRed<\/code> \u0434\u043b\u044f <code>XXX<\/code> \u0440\u0430\u0432\u043d\u043e\u043c\u0443 <code>\"red\"<\/code>, <code>\"rot\"<\/code> \u0438\u043b\u0438 <code>\"rouge\"<\/code>.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 enum: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/misc_enum_places\/misc_enum_places.h\" rel=\"noopener noreferrer nofollow\">misc_enum_places.h<\/a>, <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/custom_names\/custom_names.h\" rel=\"noopener noreferrer nofollow\">custom_names.h<\/a>.<\/p>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/misc_enum_places\/misc_enum_places.enum_serializer.cpp\" rel=\"noopener noreferrer nofollow\">misc_enum_places.enum_serializer.cpp<\/a>, <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/custom_names\/custom_names.enum_serializer.cpp\" rel=\"noopener noreferrer nofollow\">custom_names.enum_serializer.cpp<\/a>.<\/p>\n<p>\u0422\u0435\u0441\u0442 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/test.cpp\" rel=\"noopener noreferrer nofollow\">test.cpp<\/a>.<\/p>\n<h2>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 JSON \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/h2>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0442\u043e\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 header \u0441 \u0434\u0432\u0443\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">#pragma once  #include &lt;nlohmann\/json.hpp>  namespace Waffle {  template&lt;typename T> nlohmann::json ToJson(const T&amp; value);  template&lt;typename T> T FromJson(const nlohmann::json&amp; value);  } \/\/ namespace Waffle<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/nlohmann\/json\" rel=\"noopener noreferrer nofollow\">nlohmann\/json<\/a> \u044d\u0442\u043e header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Json \u0432 C++, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Json.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c <code>jsonable<\/code>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 Json-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0438\u043c\u0435\u043d\u0430 \u043f\u043e\u043b\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435, \u043a\u0430\u043a \u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043d\u043e \u044d\u0442\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>stringvalue<\/code>. \u0424\u0430\u0439\u043b <code>books_library.h<\/code>:<\/p>\n<pre><code class=\"cpp\">#include &lt;optional> #include &lt;string> #include &lt;vector>  namespace model {  struct Book {     std::string Name; \/\/ @stringvalue name     std::string Author; \/\/ @stringvalue author     int Year; \/\/ @stringvalue year };  struct LatLon {     double Lat; \/\/ @stringvalue lat     double Lon; \/\/ @stringvalue lon };  \/\/ @jsonable struct Library {     std::vector&lt;Book> Books; \/\/ @stringvalue books     std::optional&lt;std::string> Description; \/\/ @stringvalue description     LatLon Address; \/\/ @stringvalue address };  } \/\/ namespace model<\/code><\/pre>\n<p><code>std::vector<\/code> \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 Json-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 array. <code>std::optional<\/code> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432 <code>null<\/code>, \u0435\u0441\u043b\u0438 \u043e\u043d \u043f\u0443\u0441\u0442\u043e\u0439. \u041c\u0435\u0442\u043a\u0430 <code>jsonable<\/code> \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c (\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 <code>Book<\/code> \u0438 <code>LatLon<\/code> \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b <code>jsonable<\/code>).<\/p>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0430\u044f: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/json_dump\/test\/books_library\/books_library.json_dump.cpp\" rel=\"noopener noreferrer nofollow\">books_library.json_dump.cpp<\/a>.<\/p>\n<p>\u0412 \u0442\u0435\u0441\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a Json \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0432 \u0434\u0440\u0443\u0433\u0430: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/json_dump\/test\/test.cpp\" rel=\"noopener noreferrer nofollow\">test.cpp<\/a>.<\/p>\n<h2>\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/h2>\n<p>\u0418\u0434\u0435\u044f data-\u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0430 \u0438\u0437 Java-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/projectlombok.org\/features\/Data\" rel=\"noopener noreferrer nofollow\">Lombok<\/a>. \u0412 Java \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441 \u043a\u0443\u0447\u0435\u0439 \u0438\u0434\u0435\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0433\u0435\u0442\u0442\u0435\u0440\u044b, \u0441\u0435\u0442\u0442\u0435\u0440\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>\u0412 Waffle++ \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>dataclass<\/code>. \u0412 \u0444\u0430\u0439\u043b\u0435 <code>mountain.h<\/code>:<\/p>\n<pre><code class=\"cpp\">#include &lt;string> #include &lt;optional>  namespace model {  \/\/ @dataclass LatLon struct LatLonStub {     double latitude;     double longitude; };  \/\/ @dataclass Mountain struct MountainStub {     std::optional&lt;std::string> name;     std::string country; \/\/ @getteronly     LatLonStub position;     double peak; };  } \/\/ namespace model<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0432\u043e\u0434\u044f\u0442\u0441\u044f &#171;\u043c\u0443\u0441\u043e\u0440\u043d\u044b\u0435&#187; (\u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435) \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0430 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0435\u0442\u0442\u0435\u0440\u044b (\u0442\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u0438 \u043f\u043e\u043b\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c).<\/p>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f (\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0435 <code>.cpp<\/code>-\u0444\u0430\u0439\u043b, \u0430 <code>.h<\/code>-\u0444\u0430\u0439\u043b!): <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/data_class\/test\/mountains\/mountains.data_class.h\" rel=\"noopener noreferrer nofollow\">mountains.data_class.h<\/a>.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0434\u043b\u044f &#171;\u0431\u043e\u043b\u044c\u0448\u0438\u0445&#187; \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u0435\u0442\u0442\u0435\u0440\u0430 &#8212; \u043f\u043e const-\u0441\u0441\u044b\u043b\u043a\u0435 \u0438 rvalue-\u0441\u0441\u044b\u043b\u043a\u0435:<\/p>\n<pre><code class=\"cpp\">    void SetName(std::optional&lt;std::string>&amp;&amp; name) {         name_ = std::move(name);     }     void SetName(const std::optional&lt;std::string>&amp; name) {         name_ = name;     }     const std::optional&lt;std::string>&amp; GetName() const {         return name_;     }<\/code><\/pre>\n<p>\u0414\u043b\u044f &#171;\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445&#187; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">    void SetPeak(double peak) {         peak_ = peak;     }     double GetPeak() const {         return peak_;     }<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/data_class\/test\/test.cpp\" rel=\"noopener noreferrer nofollow\">test.cpp<\/a>.<\/p>\n<h2>\u041c\u043e\u043a-\u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f GoogleMock<\/h2>\n<p>GoogleMock \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c &#171;\u043c\u043e\u043a\u043e\u0432&#187; &#8212; \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u044e\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041b\u0443\u0447\u0448\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/google.github.io\/googletest\/gmock_for_dummies.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>, \u0442\u0430\u043c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430. \u0412 \u0441\u0438\u043b\u0443 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 C++, GoogleMock \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0438\u043d\u0430\u0447\u0435 \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430 \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u0440\u0430\u0432\u043a\u0443 \u043c\u043e\u043a\u043e\u0432 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <code>turtle.h<\/code> \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d \u043a\u043b\u0430\u0441\u0441 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 GoogleMock:<\/p>\n<pre><code class=\"cpp\">namespace model {  \/\/ @gmock class Turtle { public:     virtual ~Turtle() = default;     virtual void PenUp() = 0;     virtual void PenDown() = 0;     virtual void Forward(int distance) = 0;     virtual void Turn(int degrees) = 0;     virtual void GoTo(int x, int y) = 0;     virtual int GetX() const = 0;     virtual int GetY() const = 0; };  } \/\/ namespace model<\/code><\/pre>\n<p>Waffle++ \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b <code>turtle.gmock.h<\/code> \u0441 \u043c\u043e\u043a-\u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0438\u0448\u0443\u0442 \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<pre><code class=\"cpp\">\/\/ Generated by the Waffle++ code generator. DO NOT EDIT! \/\/ source: turtle.h  #include &lt;gmock\/gmock.h>  #include \"turtle.h\"  namespace Waffle {  class MockTurtle : public model::Turtle { public:     MOCK_METHOD(void, PenUp, (), (override));     MOCK_METHOD(void, PenDown, (), (override));     MOCK_METHOD(void, Forward, (int distance), (override));     MOCK_METHOD(void, Turn, (int degrees), (override));     MOCK_METHOD(void, GoTo, (int x, int y), (override));     MOCK_METHOD(int, GetX, (), (const, override));     MOCK_METHOD(int, GetY, (), (const, override)); };  } \/\/ namespace Waffle<\/code><\/pre>\n<p>Waffle++ \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u0442\u043e \u0435\u0441\u0442\u044c <code>turtle.h<\/code>) \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (\u0442\u043e \u0435\u0441\u0442\u044c <code>turtle.gmock.h<\/code>) \u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041f\u043e\u0437\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0444\u043e\u043a\u0443\u0441\u044b.<\/p>\n<h2>\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u0412 \u0434\u0432\u0438\u0436\u043a\u0435 <a href=\"https:\/\/spring.io\/\" rel=\"noopener noreferrer nofollow\">Java Spring<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>de facto<\/em> \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438, \u0435\u0441\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u043e\u043c \u043a\u043e\u0434\u0430. \u0412 &#171;\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445&#187; \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0441\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f Java, Spring Framework<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">@RestController class EmployeeController {    private final EmployeeRepository repository;    EmployeeController(EmployeeRepository repository) {     this.repository = repository;   }    @GetMapping(\"\/employees\")   List&lt;Employee> all() {     return repository.findAll();   }    @PostMapping(\"\/employees\")   Employee newEmployee(@RequestBody Employee newEmployee) {     return repository.save(newEmployee);   }    @GetMapping(\"\/employees\/{id}\")   Employee one(@PathVariable Long id) {     return repository.findById(id)       .orElseThrow(() -> new EmployeeNotFoundException(id));   }    @DeleteMapping(\"\/employees\/{id}\")   void deleteEmployee(@PathVariable Long id) {     repository.deleteById(id);   } }<\/code><\/pre>\n<p>\u041f\u0440\u0438 GET-\u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043d\u0430 <code>http:\/\/myserver.com\/employees\/123<\/code> \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>one(123)<\/code>, \u0438 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0435\u0440\u043d\u0443\u0442 json-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>Employee<\/code>.<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c <code>json_dump<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0441\u044f \u0440\u0430\u043d\u0435\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f C++, Waffle++<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0424\u0430\u0439\u043b <code>employee.h<\/code>:<\/p>\n<pre><code class=\"cpp\">#include &lt;memory> #include &lt;optional> #include &lt;vector>  namespace model {  \/\/ @jsonable struct Employee {     size_t Id; \/\/ @stringvalue id     std::string Name; \/\/ @stringvalue name     double Salary; \/\/ @stringvalue salary };  class IEmployeeRepository { public:     virtual void Add(Employee employee) = 0;     virtual std::optional&lt;Employee> FindById(size_t id) = 0;     virtual std::vector&lt;Employee> FindBySalaryRange(double lowerBound, double upperBound) = 0;     virtual std::vector&lt;Employee> FindAll() = 0;     virtual void DeleteById(size_t id) = 0; };  \/\/ @restcontroller class EmployeeController { public:     EmployeeController(std::shared_ptr&lt;IEmployeeRepository> repository)         : repository_{std::move(repository)}     {}      \/*      * @brief Add a new employee      * @postmapping \/employees      * @requestbody employee      *\/     void Add(Employee employee) {         repository_->Add(std::move(employee));     }      \/*      * @brief Get the employee with given ID      * @getmapping \/employees\/{id}      * @pathvariable id      *\/     std::optional&lt;Employee> FindById(size_t id) {         return repository_->FindById(id);     }      \/*      * @brief Get all employers with salary in given range      * @getmapping \/employees\/find?lowerBound={lowerBound}&amp;upperBound={upperBound}      * @pathvariable lowerBound      * @pathvariable upperBound      *\/     std::vector&lt;Employee> FindBySalaryRange(double lowerBound, double upperBound) {         return repository_->FindBySalaryRange(lowerBound, upperBound);     }      \/*      * @brief Get all employees      * @getmapping \/employees      *\/     std::vector&lt;Employee> FindAll() {         return repository_->FindAll();     }      \/*      * @brief Delete the employee with given ID      * @deletemapping \/employees\/{id}      * @pathvariable id      *\/     void DeleteById(size_t id) {         repository_->DeleteById(id);     }  private:     std::shared_ptr&lt;IEmployeeRepository> repository_; };  } \/\/ namespace model<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>restcontroller<\/code> (\u043a\u043b\u0430\u0441\u0441-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434) <code>getmapping\/postmapping\/deletemapping<\/code> (\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430), <code>pathvariable<\/code> (\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0443\u0441\u043e\u043a \u043f\u0443\u0442\u0438), <code>requestbody<\/code> (\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f body HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430).<\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 header \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0443\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">#pragma once  #include &lt;memory> #include &lt;string>  namespace Waffle {  struct HttpRequest {     std::string Method;     std::string Path;     std::string Body; };  struct HttpResponse {     int StatusCode;     std::string Body; };  template&lt;typename Handler> [[nodiscard]] HttpResponse ProcessRequest(Handler&amp; handler, const HttpRequest&amp; httpRequest);  } \/\/ namespace Waffle<\/code><\/pre>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/rest_controller\/test\/employee\/employee.json_dump.cpp\" rel=\"noopener noreferrer nofollow\">employee.json_dump.cpp<\/a> \u0438 <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/rest_controller\/test\/employee\/employee.rest_controller.cpp\" rel=\"noopener noreferrer nofollow\">employee.rest_controller.cpp<\/a>.<\/p>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/rest_controller\/test\/test.cpp\" rel=\"noopener noreferrer nofollow\">test.cpp<\/a>.<\/p>\n<h2>\u0421\u0432\u043e\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c<\/h2>\n<p>\u042f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c \u0432 C++ &#171;\u0432 \u0441\u0442\u0438\u043b\u0435 Go&#187;.<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/vk\/blog\/463063\/\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0432 Go<\/a> \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0432 \u0440\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043f\u043b\u0430\u043d\u0435 (\u0442.\u0435. \u043e\u043d\u0438 \u043d\u0435 &#171;\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430&#187; \u0438 \u0442.\u0434., \u0432 Go \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0442). \u0412 C++ \u0435\u0441\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043a\u043e\u0434\u0430, \u0430 \u043d\u0435 \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c \u0447\u0435\u043c-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/github.com\/kelbon\/AnyAny\" rel=\"noopener noreferrer nofollow\">kelbon\/AnyAny<\/a> &#8212; \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f C++ \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0442\u043e\u0439\u0442\u0438 \u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e\u0445\u043e\u0436\u0435\u0439 \u043d\u0430 \u044d\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<p>\u0421 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0433\u0438\u0431\u0447\u0435! \u041f\u0440\u0438\u043c\u0435\u0440 <code>structs.h<\/code> \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;string>  namespace model {  \/\/ @polymorphic struct Robot {     void Forward(double distance);     void Turn(double degrees);     void GoTo(double x, double y);     double GetX() const;     double GetY() const; };  \/\/ @polymorphic struct Stringer {     std::string String() const; };  } \/\/ namespace model<\/code><\/pre>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0430\u0439\u043b <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/poly_ptr\/test\/structs\/structs.poly_ptr.h\" rel=\"noopener noreferrer nofollow\">structs.poly_ptr.h<\/a> \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 (\u0434\u043b\u044f <code>T = Robot<\/code> \u0438 <code>T = Stringer<\/code>):<\/p>\n<ul>\n<li>\n<p><code>poly_obj&lt;T><\/code> &#8212; \u043e\u0431\u044a\u0435\u043a\u0442-\u0432\u0440\u0430\u043f\u043f\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <em>\u0447\u0442\u043e-\u0442\u043e<\/em>, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 type erasure, \u043a\u0430\u043a \u0432 <a href=\"https:\/\/t.me\/cxx95\/75\" rel=\"noopener noreferrer nofollow\">std::function<\/a>. \u041e\u0431\u044a\u0435\u043a\u0442-\u0432\u0440\u0430\u043f\u043f\u0435\u0440 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 \u043a\u0443\u0447\u0435 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0436\u0438\u0437\u043d\u044c\u044e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><code>poly_ref&lt;T><\/code> &#8212; \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <em>\u0447\u0442\u043e-\u0442\u043e<\/em>, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0411\u044b\u0441\u0442\u0440 \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u043a <code>void*<\/code>, \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0436\u0438\u0437\u043d\u044c\u044e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><code>poly_ptr&lt;T><\/code> &#8212; \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e <code>poly_ref&lt;T><\/code>, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c (\u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442).<\/p>\n<\/li>\n<li>\n<p><code>const_poly_ref&lt;T><\/code> \u0438 <code>const_poly_ptr&lt;T><\/code> &#8212; \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u044b\u0448\u0435, \u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0442\u0435\u0441\u0442\u0430\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u043e\u0431\u043e\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c:<\/p>\n<pre><code class=\"cpp\">class TestRobot { public:     void Forward(double distance) { \/* ... *\/ }     void Turn(double degrees) { \/* ... *\/ }     void GoTo(double x, double y) { \/* ... *\/ }     double GetX() const { \/* ... *\/ };     double GetY() const { \/* ... *\/ };     std::string String() const { \/* ... *\/ }      \/* ... *\/ };<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442\u044b: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/poly_ptr\/test\/poly_obj_test.cpp\" rel=\"noopener noreferrer nofollow\">poly_obj_test.cpp<\/a>, <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/poly_ptr\/test\/poly_ref_test.cpp\" rel=\"noopener noreferrer nofollow\">poly_ref_test.cpp<\/a>, <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/poly_ptr\/test\/poly_ptr_test.cpp\" rel=\"noopener noreferrer nofollow\">poly_ptr_test.cpp<\/a>.<\/p>\n<h2>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0438 \u0441\u043b\u043e\u0442\u043e\u0432<\/h2>\n<p>\u0421\u0438\u0433\u043d\u0430\u043b\u044b \u0438 \u0441\u043b\u043e\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 Qt (<a href=\"https:\/\/doc.qt.io\/qt-6\/signalsandslots.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438).<\/p>\n<p>\u0423 Qt \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438, \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0441\u043a\u0430\u0437:<\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f &#171;\u0441\u0438\u0433\u043d\u0430\u043b\u0430\u043c\u0438&#187;, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 &#171;\u0441\u043b\u043e\u0442\u0430\u043c\u0438&#187;. &#171;\u0421\u0438\u0433\u043d\u0430\u043b\u044b&#187; \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0430 &#171;\u0441\u043b\u043e\u0442\u044b&#187; \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u041d\u0430 \u043e\u0434\u0438\u043d &#171;\u0441\u0438\u0433\u043d\u0430\u043b&#187; \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e &#171;\u0441\u043b\u043e\u0442\u043e\u0432&#187;, \u043b\u0438\u0448\u044c \u0431\u044b \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0438. \u0412\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430-&#171;\u0441\u0438\u0433\u043d\u0430\u043b\u0430&#187; \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0432\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 &#171;\u0441\u043b\u043e\u0442\u044b&#187; \u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#171;\u0440\u0430\u043d\u0442\u0430\u0439\u043c&#187; \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u0441\u0435\u0439 \u0441\u0445\u0435\u043c\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432-&#171;\u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432&#187;.<\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 header:<\/p>\n<pre><code class=\"cpp\">#pragma once  namespace Waffle {  class SignalBase { public:     virtual ~SignalBase(); };  namespace Impl {     \/* ... *\/ } \/\/ namespace Impl  template&lt;typename SenderType, typename ReceiverType, typename... Args> void Connect(const SignalBase* sender, void(SenderType::*signal)(Args...),              const SignalBase* receiver, void(ReceiverType::*slot)(Args...)) {     \/* ... *\/ }  } \/\/ namespace Waffle<\/code><\/pre>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434-&#171;\u0441\u0438\u0433\u043d\u0430\u043b&#187; \u0438\u043b\u0438 &#171;\u0441\u043b\u043e\u0442&#187;, \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 <code>SignalBase<\/code>. \u0412 \u0435\u0433\u043e \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 &#171;\u0440\u0430\u0437\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f&#187; \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434-&#171;\u0441\u043b\u043e\u0442&#187; \u0443 \u0443\u0436\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 <code>counter.h<\/code>, \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043a\u0430\u043a \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Qt:<\/p>\n<pre><code class=\"cpp\">#include &lt;string>  #include &lt;waffle\/modules\/signals\/signals.h>  namespace model {  class Counter : public Waffle::SignalBase { public:     Counter();      int Value() const;      \/\/ @slot     void SetValue(int value);      \/\/ @signal     void ValueChanged(int newValue);  private:     int Value_; };  } \/\/ namespace model<\/code><\/pre>\n<p>\u0412 <code>counter.cpp<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0442\u043e\u0434-&#171;\u0441\u043b\u043e\u0442&#187;:<\/p>\n<pre><code class=\"cpp\">#include \"counter.h\"  namespace model {  Counter::Counter()     : Value_{0} { }  int Counter::Value() const {     return Value_; }  void Counter::SetValue(int value) {     if (value != Value_) {         Value_ = value;         ValueChanged(value);     } }  } \/\/ namespace model<\/code><\/pre>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/signals\/test\/counter\/counter.signals.cpp\" rel=\"noopener noreferrer nofollow\">counter.signals.cpp<\/a> \u0441 &#171;\u0440\u0430\u043d\u0442\u0430\u0439\u043c\u043e\u043c&#187;. \u0425\u043e\u0442\u044f \u043b\u0443\u0447\u0448\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u043d\u0442\u0430\u0439\u043c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u043e \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e, \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u0434\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u043e\u0441\u0442\u0438 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0422\u0435\u0441\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b \u0441\u043e \u0441\u043b\u043e\u0442\u043e\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (\u0442\u043e\u0436\u0435 \u043a\u0430\u043a \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Qt):<\/p>\n<pre><code class=\"cpp\">#include &lt;gtest\/gtest.h> #include \"counter\/counter.h\"  TEST(Signals, Smoke) {     model::Counter a, b;     Waffle::Connect(&amp;a, &amp;model::Counter::ValueChanged,                     &amp;b, &amp;model::Counter::SetValue);      a.SetValue(12);     ASSERT_EQ(a.Value(), 12);     ASSERT_EQ(b.Value(), 12);      b.SetValue(48);     ASSERT_EQ(a.Value(), 12);     ASSERT_EQ(b.Value(), 48); }<\/code><\/pre>\n<h2>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b<\/h2>\n<p>\u0412 \u0441\u043f\u0438\u0441\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a <a href=\"https:\/\/github.com\/fffaraz\/awesome-cpp\" rel=\"noopener noreferrer nofollow\">awesome-cpp<\/a> \u043d\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0434\u043b\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0437 <a href=\"https:\/\/github.com\/fffaraz\/awesome-cpp#reflection\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0438\u0441\u043a\u0430 Reflection<\/a>. \u0418\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442 \u043e\u0431\u0449\u0438\u0435 \u0447\u0435\u0440\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>\u041c\u0430\u043b\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438\u0437 enum \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0430\u0434\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 &#8212; \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e &#171;\u043f\u043e\u043b\u043d\u0443\u044e \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044e&#187;, \u0447\u0442\u043e \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 Clang \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 C++ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u0442\u043d\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. <a href=\"https:\/\/clang.llvm.org\/doxygen\/classclang_1_1ClassTemplatePartialSpecializationDecl.html\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 1<\/a>, <a href=\"https:\/\/clang.llvm.org\/doxygen\/classclang_1_1Decl.html\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440 2<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043f\u0440\u043e \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/post\/598981\/\" rel=\"noopener noreferrer nofollow\">\u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043c\u043e\u0438\u0445 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439<\/a>, \u0435\u0441\u043b\u0438 \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0442\u0435\u043c\u044b \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432 Qt, \u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442, \u0447\u0442\u043e \u043d\u0430 Waffle++ \u043f\u043e\u0445\u043e\u0436 \u0435\u0433\u043e <a href=\"https:\/\/doc.qt.io\/qt-6\/moc.html\" rel=\"noopener noreferrer nofollow\">Meta-Object Compiler<\/a> &#8212; \u0442\u0430\u043c \u043f\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u043c\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f <code>.cpp<\/code>-\u0444\u0430\u0439\u043b\u044b (\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432).<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0432\u043e\u0435\u0433\u043e DSL \u0435\u0441\u0442\u044c \u0443 <a href=\"https:\/\/protobuf.dev\/\" rel=\"noopener noreferrer nofollow\">protobuf<\/a>.<\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u043f\u0440\u0438\u0435\u0442\u0430\u0440\u043d\u044b\u0435 IDE \u0438\u043c\u0435\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#8212; <a href=\"https:\/\/www.jetbrains.com\/help\/rider\/Code_Generation_in_CPP.html#gmock\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 google mock<\/a>.<\/p>\n<h2>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430: \u041e\u0431\u0449\u0435\u0435<\/h2>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/\" rel=\"noopener noreferrer nofollow\">Izaron\/WafflePlusPlus<\/a>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>src\/<\/code>:<\/p>\n<ul>\n<li>\n<p><code>bin\/<\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>wafflec<\/code> \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><code>cmake_scripts\/<\/code> &#8212; \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 CMake, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><code>include\/waffle\/modules\/<\/code> &#8212; \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 header-\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><code>lib\/<\/code> &#8212; \u043e\u0431\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><code>modules\/<\/code> &#8212; \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><code>thirdparty\/include\/<\/code> &#8212; header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u041f\u0440\u043e\u0435\u043a\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/google\/googletest\" rel=\"noopener noreferrer nofollow\">GoogleTest<\/a> &#8212; \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/llvm\/llvm-project\" rel=\"noopener noreferrer nofollow\">LibClang <\/a>&#8212; \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 C++.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/pantor\/inja\" rel=\"noopener noreferrer nofollow\">pantor\/inja<\/a> &#8212; \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 (header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430).<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/nlohmann\/json\" rel=\"noopener noreferrer nofollow\">nlohmann\/json<\/a> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 JSON (header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430). \u0428\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 \u0442\u043e\u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0430\u043c\u043e\u0439 \u0432\u0430\u0436\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f LibClang. \u0417\u0430 \u0435\u0435 \u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0435\u0441\u044c \u0431\u0430\u043d\u043a\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0430 \u0443\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 C++ \u0432 <em>\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e (AST)<\/em>, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041f\u0440\u0438\u043c\u0435\u0440 AST \u043d\u0430 \u043a\u043e\u0434\u0435 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c &#8212; <a href=\"https:\/\/godbolt.org\/z\/dEqfcMc33\" rel=\"noopener noreferrer nofollow\">godbolt<\/a>.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>src\/lib\/<\/code> \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c:<\/p>\n<ul>\n<li>\n<p><code>comment\/<\/code> &#8212; \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u0442 doxygen-style \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e (\u043a\u043b\u0430\u0441\u0441\u0430\/\u0435\u043d\u0430\u043c\u0430\/\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0442.\u0434.)<\/p>\n<\/li>\n<li>\n<p><code>driver\/<\/code> &#8212; \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <code>int main()<\/code>. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u0430\u0440\u0441\u0438\u0442 \u0444\u0430\u0439\u043b, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <em>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438<\/em> \u0434\u043b\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><code>file\/<\/code> &#8212; \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p><code>registry\/<\/code> &#8212; \u043c\u0430\u043a\u0440\u043e\u0441 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f, \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><code>string_util\/<\/code> &#8212; \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e &#171;<em>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/em>&#187; \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0434\u0443\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439. \u041c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435 \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u0442\u043e\u0433\u0434\u0430 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043d\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0438 \u0438\u0445 \u043a\u043e\u0434 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/t.me\/cxx95\/76\" rel=\"noopener noreferrer nofollow\">\u0432 \u0431\u043b\u043e\u0433\u0435<\/a>.<\/p>\n<h2>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430: \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0432 <code>src\/modules\/<\/code> \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0443 \u043d\u0438\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f. \u041c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c <code>src\/modules\/google_mock\/<\/code>:<\/p>\n<ul>\n<li>\n<p><code>template.cpp<\/code> &#8212; \u0448\u0430\u0431\u043b\u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a\u043e\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">\/\/ Generated by the Waffle++ code generator. DO NOT EDIT! \/\/ source: {{ source_file }}  #include &lt;gmock\/gmock.h>  #include \"{{ source_file }}\"  namespace Waffle {  ## for struct in structs class Mock{{ struct.name }} : public {{ struct.qualified_name }} { public: ## for method in struct.methods     MOCK_METHOD({{ method.return_type }}, {{ method.name }}, ({{ method.signature }}), ({{ method.qualifiers }})); ## endfor };  ## endfor } \/\/ namespace Waffle<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u0439\u0434\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>inja<\/code>.<\/p>\n<p>\u041a\u0430\u043a \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f C++-\u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 <code>CMakeLists.txt<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 <code>waffle_generate_template_data()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/focal\/man1\/xxd.1.html\" rel=\"noopener noreferrer nofollow\">xxd<\/a>, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0435 build-\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0444\u0430\u0439\u043b <a href=\"https:\/\/gist.githubusercontent.com\/Izaron\/cd2640fd7770b537b6eaefda825888e4\/raw\/00cd836deef423895b8d8dbec27bf91faaccb283\/template.cpp.data\" rel=\"noopener noreferrer nofollow\">template.cpp.data<\/a>, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">#include \"template.cpp.data\" const std::string TEMPLATE{(char*)template_cpp, template_cpp_len};<\/code><\/pre>\n<ul>\n<li>\n<p><code>common.h<\/code>  &#8212; \u043d\u0435\u043a\u0438\u0435 \u043e\u0431\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0423 google_mock \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">using StructDecl = const clang::CXXRecordDecl*; using StructDecls = std::vector&lt;StructDecl>;<\/code><\/pre>\n<ul>\n<li>\n<p><code>collector.cpp\/.h<\/code> &#8212; \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 (LibClang \u043d\u0443\u0436\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0442\u044c, \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u043d\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438):<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">StructDecls Collect(clang::ASTContext&amp; ctx); std::vector&lt;std::string_view> Commands();<\/code><\/pre>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a <code>collector.cpp<\/code> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>clang::RecursiveASTVisitor<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>\/\/ @gmock<\/code>. \u0412 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 <code>clang::ASTContext<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0435\u043d\u043d\u043e\u043c C++-\u0444\u0430\u0439\u043b\u0435.<\/p>\n<ul>\n<li>\n<p><code>printer.cpp\/.h<\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041e\u043d \u0431\u0435\u0440\u0435\u0442 <code>template.cpp<\/code>, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 json-\u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0438 \u043f\u0438\u0445\u0430\u0435\u0442 \u044d\u0442\u0438 \u0434\u0432\u0435 \u0448\u0442\u0443\u043a\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440, \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0432 \u0444\u0430\u0439\u043b:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">void Print(Context&amp; ctx, const StructDecls&amp; decls);<\/code><\/pre>\n<p>(<code>Context<\/code> \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b)<\/p>\n<pre><code class=\"cpp\">struct Context {     IFileManager&amp; FileManager;     std::string_view InFile;     clang::ASTContext&amp; AstContext; };<\/code><\/pre>\n<ul>\n<li>\n<p><code>register.cpp<\/code> &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>gmock<\/code>:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">using namespace Waffle;  static void Do(Context&amp; ctx) {     if (const auto decls = GoogleMock::Collect(ctx.AstContext); !decls.empty()) {         GoogleMock::Print(ctx, decls);     } }  REGISTER_MODULE(gmock, GoogleMock::Commands(), Do);<\/code><\/pre>\n<h3>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430: \u0422\u0440\u0435\u0445\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043a\u043e\u0434\u0430. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432 \u0442\u0440\u0438 \u0444\u0430\u0437\u044b.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a <code>wafflec<\/code> \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438. \u0424\u0430\u0439\u043b <code>src\/bin\/CMakeLists.txt<\/code>:<\/p>\n<pre><code class=\"cmake\">if(NOT DEFINED MODULES)     list(APPEND MODULES         data_class         enum_serializer         google_mock         json_dump         poly_ptr         rest_controller         signals) endif()  include(waffle) waffle_add_executable(wafflec \"${MODULES}\")<\/code><\/pre>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0434\u043d\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>src\/modules\/google_mock\/test<\/code>:<\/p>\n<ul>\n<li>\n<p><code>CMakeLists.txt<\/code> &#8212; \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><code>test.cpp<\/code> &#8212; \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><code>turtle\/turtle.h<\/code> &#8212; \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<li>\n<p><code>turtle\/turtle.gmock.h<\/code> &#8212; \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c <code>CMakeLists.txt<\/code>:<\/p>\n<pre><code class=\"cmake\"># generate new files include(waffle) waffle_add_executable(google_mock_wafflec google_mock) waffle_generate(     google_mock_wafflec     turtle\/turtle.h     ${CMAKE_CURRENT_SOURCE_DIR}\/turtle\/turtle.gmock.h)<\/code><\/pre>\n<p>\u041c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a <code>google_mock_wafflec<\/code> \u0441 \u043e\u0434\u043d\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c <code>google_mock<\/code>, \u0438 \u043f\u043e\u0442\u043e\u043c \u0434\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>turtle.h<\/code> \u0444\u0430\u0439\u043b <code>turtle.gmock.h<\/code>.<\/p>\n<p>\u0422\u0435\u043c, \u043a\u0442\u043e \u043d\u0435\u043f\u0440\u0438\u0432\u044b\u0447\u0435\u043d \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u0441\u0431\u043e\u0440\u043a\u0438 (\u043a\u0430\u043a CMake) \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e &#171;\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435&#187; \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0435 \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435 (\u043a\u0430\u043a \u0432 \u044f\u0437\u044b\u043a\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 C++), \u0430 \u043a\u0430\u0443\u0437\u0430\u043b\u044c\u043d\u043e\u0435. \u0422\u043e \u0435\u0441\u0442\u044c CMake \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u0430 \u043d\u0435\u043a\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 &#171;\u0446\u0435\u043b\u0438&#187;, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 &#171;\u0446\u0435\u043b\u0435\u0439&#187; (\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430 \u0432\u0441\u0435 \u0432\u043b\u0438\u044f\u0442\u044c).<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>waffle_generate<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0437\u0430\u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0443\u0437\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u044c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b <code>turtle.gmock.h<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 <code>turtle.h<\/code>, \u043f\u0440\u0438\u0447\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0441\u0442\u0430\u0434\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438. \u042d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0442 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u043c\u044b \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u043b\u0438 \u043f\u0440\u0435\u0444\u0438\u043a\u0441, \u043a\u0443\u0434\u0430 \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b: <code>${CMAKE_CURRENT_SOURCE_DIR}<\/code>. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0444\u0430\u0439\u043b\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432, \u0438 \u0432\u0441\u0435 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432 \u0434\u0438\u0444\u0444 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 Git.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 <code>${CMAKE_CURRENT_BINARY_DIR}<\/code>, \u0442\u043e\u0433\u0434\u0430 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438, \u0438 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 \u0441\u0430\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u041e\u0431\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0445\u043e\u0440\u043e\u0448\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0435\u0439\u0441\u043e\u0432.<\/p>\n<pre><code class=\"cmake\"># link new files with test add_executable(google_mock_test     test.cpp     ${CMAKE_CURRENT_SOURCE_DIR}\/turtle\/turtle.gmock.h) target_link_libraries(google_mock_test gtest_main gmock_main)<\/code><\/pre>\n<p>\u0411\u0438\u043d\u0430\u0440\u044c \u0442\u0435\u0441\u0442\u043e\u0432 <code>google_mock_test<\/code> \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 <code>turtle.gmock.h<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 &#171;\u0446\u0435\u043b\u0438&#187; <code>google_mock_test<\/code> \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0435\u0449\u0435 \u043d\u0435\u0442 (\u0438\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a <code>turtle.h<\/code> \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0441\u044f).<\/p>\n<pre><code class=\"cmake\">include(GoogleTest) gtest_discover_tests(google_mock_test) enable_testing()<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 boilerplate \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0440\u0435\u0445\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<ol>\n<li>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0438 \u0442.\u0434. &#8212; \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438. \u041d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442\u044c, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0432 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f <code>.h\/.cpp<\/code>-\u0444\u0430\u0439\u043b\u044b \u0441\u0440\u0430\u0437\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f. \u041d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0432 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u0430\u0445. \u041d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<h2>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 Waffle++ \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043d \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f. \u0412 \u0421Make \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u0443\u0447\u0435\u0439 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e \u0441\u0431\u043e\u0440\u043a\u043e\u0439 Waffle++ \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c <code>CMakeLists.txt<\/code> \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 <code>compile_commands.json<\/code> \u0432 \u043a\u043e\u0440\u043d\u0435 build-\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e <code>.cpp<\/code>-\u0444\u0430\u0439\u043b\u0430. \u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<pre><code class=\"cmake\">set(CMAKE_EXPORT_COMPILE_COMMANDS ON)<\/code><\/pre>\n<p>Waffle++ \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0438\u0437 GitHub:<\/p>\n<pre><code class=\"cmake\">include(FetchContent) FetchContent_Declare(   waffle_plus_plus   GIT_REPOSITORY https:\/\/github.com\/Izaron\/WafflePlusPlus.git   GIT_TAG main ) FetchContent_MakeAvailable(waffle_plus_plus)<\/code><\/pre>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0433\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, include-\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e (\u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 header-\u043e\u0432) \u0438 cmake-\u0441\u043a\u0440\u0438\u043f\u0442 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438:<\/p>\n<pre><code class=\"cmake\">include_directories(${waffle_plus_plus_SOURCE_DIR}\/src\/include) add_subdirectory(\"${waffle_plus_plus_SOURCE_DIR}\/src\") list(APPEND CMAKE_MODULE_PATH \"${waffle_plus_plus_SOURCE_DIR}\/src\/cmake_scripts\")<\/code><\/pre>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432 <code>CMakeLists.txt<\/code> \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440:<\/p>\n<pre><code class=\"cmake\">include(waffle) waffle_generate(     wafflec  # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u043d\u0430\u0440\u044c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0431\u0438\u043d\u0430\u0440\u044c     piece.h     ${CMAKE_CURRENT_BINARY_DIR}\/piece.enum_serializer.cpp)  add_library(piece piece.cc board_piece.cc piece_registry.cc piece_or_empty.cc ${CMAKE_CURRENT_BINARY_DIR}\/piece.enum_serializer.cpp)<\/code><\/pre>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 &#8212; \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c <code>CMakeLists.txt<\/code> &#171;\u043d\u0430\u0439\u0442\u0438&#187; LibClang:<\/p>\n<pre><code class=\"cmake\"># add Clang find_package(Clang REQUIRED CONFIG)<\/code><\/pre>\n<h2>That&#8217;s all Folks!<\/h2>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445:<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 &#8212; ORM \u0434\u043b\u044f \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u043d\u0434\u043e\u043c\u0430\u0439\u0437\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, etc&#8230;<\/p>\n<\/li>\n<li>\n<p>Python-\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, <a href=\"https:\/\/clang.llvm.org\/extra\/clang-tidy\/Contributing.html#writing-a-clang-tidy-check\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 clang-tidy<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u043d\u0438\u0435 \u0444\u0438\u0447\u0435\u0439, \u0444\u0438\u043a\u0441 \u0431\u0430\u0433\u043e\u0432, \u043f\u0430\u0442\u0447\u0438 \u0432 Clang (\u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0433\u0434\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432).<\/p>\n<\/li>\n<li>\n<p>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0430\u0439\u043b\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0443 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 &#8212; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0438\u043b\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043d\u0435\u0439\u043c\u0441\u043f\u0435\u0439\u0441\u043e\u0432 \u0438 \u0442.\u0434.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441\u0431\u043e\u0440\u043a\u0438 (\u043a\u0440\u043e\u043c\u0435 CMake) \u0438 \u041e\u0421 (\u043a\u0440\u043e\u043c\u0435 Linux).<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 IDE.<\/p>\n<\/li>\n<\/ul>\n<p>&#8230; \u0412\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u043a\u043b\u0430\u043c\u0430<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043c\u043e\u0439 \u043a\u0430\u043d\u0430\u043b \u043f\u0440\u043e C++ \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b: <a href=\"https:\/\/t.me\/cxx95\" rel=\"noopener noreferrer nofollow\">https:\/\/t.me\/cxx95<\/a>, \u0433\u0434\u0435 \u044f \u043f\u0438\u0448\u0443 \u043a\u043e\u043d\u0442\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0431\u0435\u0437 \u043b\u043e\u0436\u043d\u043e\u0439 \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0441\u0442\u0438, \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0433\u0434\u0435-\u0442\u043e \u0435\u0449\u0435 =)<\/p>\n<p>\u041f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0443 \u0443 <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\" rel=\"noopener noreferrer nofollow\">Izaron\/WafflePlusPlus<\/a>, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c!<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/710744\/\"> https:\/\/habr.com\/ru\/post\/710744\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption>\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0441\u0445\u0430\u043b\u043e\u043a: https:\/\/clck.ru\/33J7ck<\/figcaption><\/figure>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Boilerplate_code\" rel=\"noopener noreferrer nofollow\">boilerplate<\/a>-\u043a\u043e\u0434 (\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442) \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>\u042f \u0434\u0435\u043b\u0430\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f C++, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439: \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 enum \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 JSON \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043b\u043e\u0442\u043e\u0432 \u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u0441\u0432\u043e\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c, \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432&#8230;<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 showcase, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0438 \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0432 \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b.<\/p>\n<h2>\u041f\u043e\u0447\u0435\u043c\u0443 Waffle++?<\/h2>\n<p>\u0412\u0430\u0444\u043b\u0438 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e <a href=\"https:\/\/www.google.com\/search?q=belgian+waffle&amp;tbm=isch\" rel=\"noopener noreferrer nofollow\">\u0431\u0435\u043b\u044c\u0433\u0438\u0439\u0441\u043a\u0438\u0435<\/a>) \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 boilerplate. \u0412\u0430\u0444\u0435\u043b\u044c\u043d\u0438\u0446\u0430 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0438\u0437\u0434\u0435\u043b\u0438\u044f \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u043a\u0430\u043a \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043f\u0438\u0448\u0435\u0442 boilerplate-\u043a\u043e\u0434 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 <code>waffle++<\/code> \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0437\u0430\u043d\u044f\u0442\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0439 \u043a\u0443\u0447\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e <code>waffle<\/code> &#8212; <a href=\"https:\/\/github.com\/search?q=waffle&amp;type=repositories&amp;p=1\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0433\u0438\u0442\u0445\u0430\u0431\u0443<\/a>.<\/p>\n<h2>Enum \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/h2>\n<p>\u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u043d\u0435\u0438\u043c\u0435\u043d\u0438\u0435\u043c \u043b\u0443\u0447\u0448\u0438\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u044d\u0442\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0441 \u043e\u0431\u0437\u043e\u0440\u043e\u043c \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>Waffle++ \u0447\u0438\u0442\u0430\u0435\u0442 \u043e\u0441\u043e\u0431\u043e \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u0427\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Doxygen\" rel=\"noopener noreferrer nofollow\">Doxygen<\/a> &#8212; \u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u0442\u0443\u043b\u0437\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. Waffle++ \u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0432\u043e\u0438 &#171;\u043a\u043e\u043c\u0430\u043d\u0434\u044b&#187; \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 <a href=\"https:\/\/www.doxygen.nl\/manual\/commands.html\" rel=\"noopener noreferrer nofollow\">\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 &#171;\u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438&#187;<\/a> Doxygen.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 enum \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 header, \u0433\u0434\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">#pragma once  #include &lt;span> #include &lt;string_view>  namespace Waffle {  template&lt;typename EnumType> EnumType FromString(std::string_view value);  template&lt;typename EnumType> EnumType FromStringOrDefault(std::string_view value, EnumType defaultResult);  template&lt;typename EnumType> std::string_view ToString(EnumType value);  template&lt;typename EnumType> std::span&lt;const EnumType> GetAllEnumValues();  } \/\/ namespace Waffle<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>enum class Color<\/code>, \u0442\u043e \u0431\u0435\u0437 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u044d\u0442\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u0443\u043f\u0430\u0434\u0435\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c. \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c enum \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>serializable<\/code>, \u0447\u0442\u043e\u0431\u044b Waffle++ &#171;\u0443\u0432\u0438\u0434\u0435\u043b&#187; \u0435\u0433\u043e:<\/p>\n<pre><code class=\"cpp\">\/\/ @serializable enum class Color {     Red,     Green,     Blue,     Cyan,     Magenta,     Yellow,     Black };<\/code><\/pre>\n<p>\u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e\u0442 enum \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>foo.h<\/code>, \u0442\u043e\u0433\u0434\u0430 Waffle++ \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <code>foo.enum_serializer.cpp<\/code> \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0438 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u043a \u043e\u0434\u043d\u043e\u043c\u0443, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <code>Waffle::ToString(Color::Red)<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 <code>\"Red\"<\/code>.<\/p>\n<p>\u041d\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>stringvalue<\/code> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a (&#171;\u043a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u043e\u0439&#187; \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435):<\/p>\n<pre><code class=\"cpp\">\/*  * @brief Represents the color of a book  * @author Izaron  * @serializable  *\/ enum class BookColor {     kRed, \/\/\/&lt; @stringvalue red rot rouge     kGreen, \/\/\/&lt; @stringvalue green gr\u00fcn vert     kBlue, \/\/\/&lt; @stringvalue blue blau bleu };<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0438\u0442\u0430\u0435\u0442 Doxygen (<code>brief<\/code>, <code>author<\/code>) \u043f\u0435\u0440\u0435\u043c\u0435\u0448\u0430\u043d\u044b \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 Waffle++ (<code>serializable<\/code>, <code>stringvalue<\/code> ).<\/p>\n<p>\u0412\u044b\u0437\u043e\u0432<code>ToString(BookColor::kRed)<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code>\"red\"<\/code>. \u0412\u044b\u0437\u043e\u0432\u044b <code>FromString&lt;BookColor>(XXX)<\/code> \u0432\u0435\u0440\u043d\u0443\u0442 <code>BookColor::kRed<\/code> \u0434\u043b\u044f <code>XXX<\/code> \u0440\u0430\u0432\u043d\u043e\u043c\u0443 <code>\"red\"<\/code>, <code>\"rot\"<\/code> \u0438\u043b\u0438 <code>\"rouge\"<\/code>.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 enum: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/misc_enum_places\/misc_enum_places.h\" rel=\"noopener noreferrer nofollow\">misc_enum_places.h<\/a>, <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/custom_names\/custom_names.h\" rel=\"noopener noreferrer nofollow\">custom_names.h<\/a>.<\/p>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/misc_enum_places\/misc_enum_places.enum_serializer.cpp\" rel=\"noopener noreferrer nofollow\">misc_enum_places.enum_serializer.cpp<\/a>, <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/custom_names\/custom_names.enum_serializer.cpp\" rel=\"noopener noreferrer nofollow\">custom_names.enum_serializer.cpp<\/a>.<\/p>\n<p>\u0422\u0435\u0441\u0442 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/enum_serializer\/test\/test.cpp\" rel=\"noopener noreferrer nofollow\">test.cpp<\/a>.<\/p>\n<h2>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 JSON \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/h2>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0442\u043e\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 header \u0441 \u0434\u0432\u0443\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">#pragma once  #include &lt;nlohmann\/json.hpp>  namespace Waffle {  template&lt;typename T> nlohmann::json ToJson(const T&amp; value);  template&lt;typename T> T FromJson(const nlohmann::json&amp; value);  } \/\/ namespace Waffle<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/nlohmann\/json\" rel=\"noopener noreferrer nofollow\">nlohmann\/json<\/a> \u044d\u0442\u043e header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Json \u0432 C++, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Json.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c <code>jsonable<\/code>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 Json-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0438\u043c\u0435\u043d\u0430 \u043f\u043e\u043b\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435, \u043a\u0430\u043a \u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043d\u043e \u044d\u0442\u0438\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>stringvalue<\/code>. \u0424\u0430\u0439\u043b <code>books_library.h<\/code>:<\/p>\n<pre><code class=\"cpp\">#include &lt;optional> #include &lt;string> #include &lt;vector>  namespace model {  struct Book {     std::string Name; \/\/ @stringvalue name     std::string Author; \/\/ @stringvalue author     int Year; \/\/ @stringvalue year };  struct LatLon {     double Lat; \/\/ @stringvalue lat     double Lon; \/\/ @stringvalue lon };  \/\/ @jsonable struct Library {     std::vector&lt;Book> Books; \/\/ @stringvalue books     std::optional&lt;std::string> Description; \/\/ @stringvalue description     LatLon Address; \/\/ @stringvalue address };  } \/\/ namespace model<\/code><\/pre>\n<p><code>std::vector<\/code> \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 Json-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 array. <code>std::optional<\/code> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432 <code>null<\/code>, \u0435\u0441\u043b\u0438 \u043e\u043d \u043f\u0443\u0441\u0442\u043e\u0439. \u041c\u0435\u0442\u043a\u0430 <code>jsonable<\/code> \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c (\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 <code>Book<\/code> \u0438 <code>LatLon<\/code> \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b <code>jsonable<\/code>).<\/p>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0430\u044f: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/json_dump\/test\/books_library\/books_library.json_dump.cpp\" rel=\"noopener noreferrer nofollow\">books_library.json_dump.cpp<\/a>.<\/p>\n<p>\u0412 \u0442\u0435\u0441\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a Json \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0432 \u0434\u0440\u0443\u0433\u0430: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/json_dump\/test\/test.cpp\" rel=\"noopener noreferrer nofollow\">test.cpp<\/a>.<\/p>\n<h2>\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u0430\u0442\u0430-\u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/h2>\n<p>\u0418\u0434\u0435\u044f data-\u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0430 \u0438\u0437 Java-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/projectlombok.org\/features\/Data\" rel=\"noopener noreferrer nofollow\">Lombok<\/a>. \u0412 Java \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441 \u043a\u0443\u0447\u0435\u0439 \u0438\u0434\u0435\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0433\u0435\u0442\u0442\u0435\u0440\u044b, \u0441\u0435\u0442\u0442\u0435\u0440\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>\u0412 Waffle++ \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>dataclass<\/code>. \u0412 \u0444\u0430\u0439\u043b\u0435 <code>mountain.h<\/code>:<\/p>\n<pre><code class=\"cpp\">#include &lt;string> #include &lt;optional>  namespace model {  \/\/ @dataclass LatLon struct LatLonStub {     double latitude;     double longitude; };  \/\/ @dataclass Mountain struct MountainStub {     std::optional&lt;std::string> name;     std::string country; \/\/ @getteronly     LatLonStub position;     double peak; };  } \/\/ namespace model<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0432\u043e\u0434\u044f\u0442\u0441\u044f &#171;\u043c\u0443\u0441\u043e\u0440\u043d\u044b\u0435&#187; (\u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435) \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0430 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0435\u0442\u0442\u0435\u0440\u044b (\u0442\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u0438 \u043f\u043e\u043b\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c).<\/p>\n<p>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f (\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0435 <code>.cpp<\/code>-\u0444\u0430\u0439\u043b, \u0430 <code>.h<\/code>-\u0444\u0430\u0439\u043b!): <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/data_class\/test\/mountains\/mountains.data_class.h\" rel=\"noopener noreferrer nofollow\">mountains.data_class.h<\/a>.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0434\u043b\u044f &#171;\u0431\u043e\u043b\u044c\u0448\u0438\u0445&#187; \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u0435\u0442\u0442\u0435\u0440\u0430 &#8212; \u043f\u043e const-\u0441\u0441\u044b\u043b\u043a\u0435 \u0438 rvalue-\u0441\u0441\u044b\u043b\u043a\u0435:<\/p>\n<pre><code class=\"cpp\">    void SetName(std::optional&lt;std::string>&amp;&amp; name) {         name_ = std::move(name);     }     void SetName(const std::optional&lt;std::string>&amp; name) {         name_ = name;     }     const std::optional&lt;std::string>&amp; GetName() const {         return name_;     }<\/code><\/pre>\n<p>\u0414\u043b\u044f &#171;\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445&#187; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">    void SetPeak(double peak) {         peak_ = peak;     }     double GetPeak() const {         return peak_;     }<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442: <a href=\"https:\/\/github.com\/Izaron\/WafflePlusPlus\/blob\/ae01a54e306f0b20699bb002f46048f5857a6568\/src\/modules\/data_class\/test\/test.cpp\" rel=\"noopener noreferrer nofollow\">test.cpp<\/a>.<\/p>\n<h2>\u041c\u043e\u043a-\u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f GoogleMock<\/h2>\n<p>GoogleMock \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c &#171;\u043c\u043e\u043a\u043e\u0432&#187; &#8212; \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u044e\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041b\u0443\u0447\u0448\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/google.github.io\/googletest\/gmock_for_dummies.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>, \u0442\u0430\u043c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430. \u0412 \u0441\u0438\u043b\u0443 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 C++, GoogleMock \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0438\u043d\u0430\u0447\u0435 \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430 \u043d\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u0440\u0430\u0432\u043a\u0443 \u043c\u043e\u043a\u043e\u0432 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445.<\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 <code>turtle.h<\/code> \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d \u043a\u043b\u0430\u0441\u0441 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 GoogleMock:<\/p>\n<pre><code class=\"cpp\">namespace model {  \/\/ @gmock class Turtle { public:     virtual ~Turtle() = default;     virtual void PenUp() = 0;     virtual void PenDown() = 0;     virtual void Forward(int distance) = 0;     virtual void Turn(int degrees) = 0;     virtual void GoTo(int x, int y) = 0;     virtual int GetX() const = 0;     virtual int GetY() const = 0; };  } \/\/ namespace model<\/code><\/pre>\n<p>Waffle++ \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b <code>turtle.gmock.h<\/code> \u0441 \u043c\u043e\u043a-\u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0438\u0448\u0443\u0442 \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<pre><code class=\"cpp\">\/\/ Generated by the Waffle++ code generator. DO NOT EDIT! \/\/ source: turtle.h  #include &lt;gmock\/gmock.h>  #include \"turtle.h\"  namespace Waffle {  class MockTurtle : public model::Turtle { public:     MOCK_METHOD(void, PenUp, (), (override));     MOCK_METHOD(void, PenDown, (), (override));     MOCK_METHOD(void, Forward, (int distance), (override));     MOCK_METHOD(void, Turn, (int degrees), (override));     MOCK_METHOD(void, GoTo, (int x, int y), (override));     MOCK_METHOD(int, GetX, (), (const, override));     MOCK_METHOD(int, GetY, (), (const, override)); };  } \/\/ namespace Waffle<\/code><\/pre>\n<p>Waffle++ \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u0442\u043e \u0435\u0441\u0442\u044c <code>turtle.h<\/code>) \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (\u0442\u043e \u0435\u0441\u0442\u044c <code>turtle.gmock.h<\/code>) \u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041f\u043e\u0437\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0444\u043e\u043a\u0443\u0441\u044b.<\/p>\n<h2>\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u0412 \u0434\u0432\u0438\u0436\u043a\u0435 <a href=\"https:\/\/spring.io\/\" rel=\"noopener noreferrer nofollow\">Java Spring<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>de facto<\/em> \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438, \u0435\u0441\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u043e\u043c \u043a\u043e\u0434\u0430. \u0412 &#171;\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445&#187; \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0441\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f Java, Spring Framework<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">@RestController class EmployeeController {    private final EmployeeRepository repository;    EmployeeController(EmployeeRepository repository) {     this.repository = repository;   }    @GetMapping(\"\/employees\")   List&lt;Employee> all() {     return repository.findAll();   }    @PostMapping(\"\/employees\")   Employee newEmployee(@RequestBody Employee newEmployee) {     return repository.save(newEmployee);   }    @GetMapping(\"\/employees\/{id}\")   Employee one(@PathVariable Long id) {     return repository.findById(id)       .orElseThrow(() -> new EmployeeNotFoundException(id));   }    @DeleteMapping(\"\/employees\/{id}\")   void deleteEmployee(@PathVariable Long id) {     repository.deleteById(id);   } }<\/code><\/pre>\n<p>\u041f\u0440\u0438 GET-\u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043d\u0430 <code>http:\/\/myserver.com\/employees\/123<\/code> \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>one(123)<\/code>, \u0438 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0435\u0440\u043d\u0443\u0442 json-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>Employee<\/code>.<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c <code>json_dump<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0441\u044f \u0440\u0430\u043d\u0435\u0435:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f C++, Waffle++<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0424\u0430\u0439\u043b <code>employee.h<\/code>:<\/p>\n<pre><code class=\"cpp\">#include &lt;memory><\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-344179","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=344179"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344179\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}