{"id":304476,"date":"2020-05-29T09:00:29","date_gmt":"2020-05-29T09:00:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304476"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304476","title":{"rendered":"Vassbotn H. \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/504386\/\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u043d\u0430\u0447\u0430\u043b \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u043c\u0435\u0442\u043a\u0443! \u0425\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0430\u043c (\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0444\u0430\u043d\u0430\u0442\u0430\u043c Object Pascal, \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0441\u043a\u0438\u0445 \u0442\u0440\u044e\u043a\u043e\u0432, \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432 \u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u0437\u044b\u0441\u043a\u043e\u0432) \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e (2007 \u0433\u043e\u0434\u0430) \u043f\u043e\u0441\u0442\u0430 <a href=\"http:\/\/hallvards.blogspot.com\/2007\/05\/hack17-virtual-class-variables-part-i.html\">&quot;Hack#17: Virtual class variables, Part I&quot;<\/a> \u0438 <a href=\"http:\/\/hallvards.blogspot.com\/2007\/05\/hack17-virtual-class-variables-part-ii.html\">&quot;Hack#17: Virtual class variables, Part II&quot;<\/a> \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u0430\u0432\u0442\u043e\u0440\u0430 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 Delphi, \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u0412\u0430\u0441\u0441\u0431\u043e\u0442\u043d\u0430 (Hallvard Vassbotn). <\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439\u0448\u0438\u0445 \u0442\u0435\u043c \u2013 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438 \u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u0445 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u0432\u044b \u043e\u043a\u0430\u0436\u0435\u0442\u0435\u0441\u044c \u043f\u0440\u0430\u0432\u044b, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e.<br \/>  \u0420\u0435\u0447\u044c \u0432 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u043e <strong>class virtual var<\/strong>, \u043f\u043e-\u0440\u0443\u0441\u0441\u043a\u0438 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u043e\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0437\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0430 (\u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u043e \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430). \u0412\u044b \u0441\u043a\u0430\u0436\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 Object Pascal\u2019\u0435 \u043d\u0435\u0442, \u0438 \u043e\u043a\u0430\u0436\u0435\u0442\u0435\u0441\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u0430\u0432\u044b\u043c\u0438. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u044f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0437\u043d\u0430\u0442\u043e\u043a\u0438 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u041e\u041e-\u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u044f\u0432\u044f\u0442: \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044f \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b, \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e. \u041a\u0430\u043a \u0438 \u0432\u0441\u0435 \u044f \u00ab\u0441\u0443\u0441\u043b\u0438\u043a\u0430 \u043d\u0435 \u0432\u0438\u0436\u0443\u2026\u00bb, \u043d\u043e \u0431\u0443\u0434\u0443 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0418 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0439\u0434\u0435\u0442 \u0432 \u0440\u0435\u0447\u044c \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u0432\u0430\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"predislovie-ot-perevodchika\">\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435 \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0430 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430, \u044f \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0433 \u0440\u0435\u0448\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0435\u0433\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u0434\u0435\u0438. \u041d\u043e \u0435\u0435 \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u043e\u043c \u043e\u0431\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0430 \u0438 \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u043d\u044f \u0432 \u043f\u043e\u043a\u043e\u0435 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u0430\u043c\u043d\u0438: \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430, \u0442\u0430 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u043d\u0435\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u00ab\u0445\u0430\u043a\u00bb (\u0430 \u044f \u0431\u044b \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u043b \u0442\u0430\u043a\u0438\u0435 \u0445\u0430\u043a\u0438 \u2013 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u0438\u0435\u043c\u0430\u043c\u0438) \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430. \u0420\u0430\u0437 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043a \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044f\u043c \u2013 \u0435\u0449\u0435 \u0440\u0430\u0437 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043c\u0430\u0442\u0447\u0430\u0441\u0442\u044c, \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u0432, \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e\u2026 <\/p>\n<p>  <\/p>\n<p>\u041c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u043e\u0442\u0438\u0432\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0432\u0448\u0438\u0441\u044c \u043a \u043f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0443 (<a href=\"http:\/\/hallvards.blogspot.com\/2007\/05\/hack17-virtual-class-variables-part-i.html\">\u0447\u0430\u0441\u0442\u044c 1<\/a>, <a href=\"http:\/\/hallvards.blogspot.com\/2007\/05\/hack17-virtual-class-variables-part-ii.html\">\u0447\u0430\u0441\u0442\u044c 2<\/a>) \u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0432 \u0435\u0433\u043e, \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0435 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u0438 \u043a \u043c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u043d\u0430 \u0442\u0435\u043c\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b (\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043e \u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e <b>\u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u043e\u043c \u0410\u043b\u0435\u043a\u0441\u0435\u0435\u0432\u044b\u043c<\/b> aka <b>GunSmoker<\/b> \u0432 \u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0435, \u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0438\u043c \u0431\u044b\u043b\u0430 \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u0430), \u0438 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0442\u0430\u043a \u043f\u043b\u043e\u0445\u043e \u2013 \u0441\u043b\u043e\u0436\u0438\u0432\u0448\u0443\u044e\u0441\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0442\u043e \u0441\u0430\u043c\u0430 \u0442\u0435\u043c\u0430 \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0435\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c, \u0430 \u043d\u0435 \u043f\u043e\u0445\u043e\u0434\u044f \u043f\u0440\u0435\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u0432 \u0434\u0443\u0445\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e: \u00ab\u042f \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c <a href=\"http:\/\/hallvards.blogspot.ru\/2007\/05\/hack17-virtual-class-variables-part-ii.html\">\u043e\u0434\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a> \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043d\u043e \u044d\u0442\u043e \u0445\u0430\u043a.\u00bb). <\/p>\n<p>  <\/p>\n<p>\u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434 \u043a\u0440\u0430\u0442\u043a\u043e \u0438\u0437\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u0443\u0442\u044c \u0438\u0434\u0435\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043e \u0441\u0432\u043e\u0438\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430\u0445 \u0441 Borland (\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0435\u0433\u043e \u0438\u0434\u0435\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a 1998 \u0433\u043e\u0434\u0443!) \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0435\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Object Pascal. \u0412\u043e-\u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043e\u043d \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u0432 \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u043d\u0430 2007 \u0433\u043e\u0434 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Object Pascal (\u0430 \u044d\u0442\u043e Delphi 2005-Delphi 2007). \u0421\u0440\u0430\u0437\u0443 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0431\u044b\u043b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u041f\u0430\u0442\u0440\u0438\u043a\u043e\u043c \u0412\u0430\u043d \u041b\u043e\u0433\u0445\u0435\u043c\u043e\u043c (Patrick van Logchem) \u2013 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0435\u043c \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u043f\u043e \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0438\u0434\u0435\u0438 \u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0435\u0433\u043e \u0441\u043e\u0430\u0432\u0442\u043e\u0440\u043e\u043c. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0438\u0434\u0435\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043e\u0431\u0435 \u0447\u0430\u0441\u0442\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u0436\u0434\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u043b\u0430 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0433\u043b\u0430\u0432\u043e\u0439. \u0422\u0430\u043a\u0436\u0435 \u044f \u0441\u0447\u0435\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u043e\u0438 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0430\u043c\u043e\u0439 \u0438\u0434\u0435\u0438, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u2026 <\/p>\n<p>  <\/p>\n<h1 id=\"sovet--17-virtualnye-peremennye-klassa-chast-i\">\u0421\u043e\u0432\u0435\u0442 # 17. \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430. \u0427\u0430\u0441\u0442\u044c I<\/h1>\n<p>  <\/p>\n<p>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432 Object Pascal-\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 class var \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0431\u044b\u043b\u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u0432 Delphi 8 \u0434\u043b\u044f .NET, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432 Delphi 2005 \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Win32. \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e class var \u0432 Object Pascal (\u043a\u0430\u043a \u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432) \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438\u0445 \u0436\u0438\u0437\u043d\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043a\u043e\u043f\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e Delphi-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f, \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0435 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"peremennye-klassa-dlya-bednyakov\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u0431\u0435\u0434\u043d\u044f\u043a\u043e\u0432<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430. \u0412 Delphi 7 \u0438 \u0432 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TFruit = class   public     constructor Create;     class function InstanceCount: integer;   end;    implementation  var   FInstanceCount: integer;  constructor TFruit.Create; begin   inherited Create;   Inc(FInstanceCount); end;  class function TFruit.InstanceCount: integer; begin   Result := FInstanceCount; end; <\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f FInstanceCount \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u00ab\u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0435\u0434\u043d\u044f\u043a\u0430\u00bb. \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 (\u0444\u0443\u043d\u043a\u0446\u0438\u044e) \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. (\u0414\u0430, \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 NewInstance \u0438 FreeInstance \u0434\u043b\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u0418 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c\u0438, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0434\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u2013 HV).<\/p>\n<p>  <\/p>\n<h2 id=\"yazykovaya-podderzhka-dlya-peremennyh-klassa\">\u042f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430<\/h2>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c\u0441\u044f \u0432 Delphi 2007, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f class var (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 Delphi 8 for .NET).<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TFruit = class   private     class var FInstanceCount: integer;   public     constructor Create;     class property InstanceCount: integer read FInstanceCount;   end;  implementation  constructor TFruit.Create; begin   inherited Create;   Inc(FInstanceCount); end; <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u0430 InstanceCount \u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0422\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0435\u043c \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043c \u043a\u043e\u0434\u0430 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u043f\u043e\u043b\u044f\u0445 \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0433\u043b\u0430\u0432\u0435 10 D4DNP [1] (\u0435\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043c\u043e\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 [2]).<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442 \u041e\u041e\u041f-\u043f\u0443\u0440\u0438\u0441\u0442\u043e\u0432, \u043d\u043e \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f (\u043a\u043e\u0434 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430) \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u0439. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 FInstanceCount \u043f\u0440\u0438 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0430\u0441\u0441\u043e\u043c TFruit \u0438 \u0432\u0441\u0435\u043c\u0438 \u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438-\u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"naivnyy-podhod\">\u041d\u0430\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u043d\u0435\u043a\u0438\u0439 \u043d\u0430\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u044f\u0431\u043b\u043e\u043a \u0438 \u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TApple = class(TFruit)     \/\/ ..   end;   TOrange = class(TFruit)     \/\/ ..   end;  procedure Test; var   List: TList; begin   List := TList.Create;   List.Add(TApple.Create);   List.Add(TApple.Create);   List.Add(TOrange.Create);   Writeln('Apples: ', TApple.InstanceCount);   Writeln('Oranges: ', TOrange.InstanceCount);   readln; end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c 2 \u044f\u0431\u043b\u043e\u043a\u0430 \u0438 1 \u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d, \u043d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">Apples: 3 Oranges: 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 TFruit, TApple \u0438 TOrange. <\/p>\n<p>  <\/p>\n<h3 id=\"yavnaya-poklassovaya-realizaciya-v-peremennyh-klassa\">\u042f\u0432\u043d\u0430\u044f \u043f\u043e\u043a\u043b\u0430\u0441\u0441\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u044f\u0432\u043d\u043e\u043c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TFruit = class   private     class var FInstanceCount: integer;   public     constructor Create;     class function InstanceCount: integer; virtual;   end;   TApple = class(TFruit)   private     class var FInstanceCount: integer;   public     constructor Create;     class function InstanceCount: integer; override;   end;   TOrange = class(TFruit)   private     class var FInstanceCount: integer;   public     constructor Create;     class function InstanceCount: integer; override;   end;  implementation  constructor TFruit.Create; begin   inherited Create;   Inc(FInstanceCount); end;  class function TFruit.InstanceCount: integer; begin   Result := FInstanceCount; end;  constructor TApple.Create; begin   inherited Create;   Inc(FInstanceCount); end;  class function TApple.InstanceCount: integer; begin   Result := FInstanceCount; end;  constructor TOrange.Create; begin   inherited Create;   Inc(FInstanceCount); end;  class function TOrange.InstanceCount: integer; begin   Result := FInstanceCount; end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043a\u043e\u0434\u0430, \u043d\u043e, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">Apples: 2 Oranges: 1<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 (\u0441\u043a\u0430\u0436\u0435\u043c, \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043b\u0430\u0441\u0441\u043e\u0432), \u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u043d\u043e \u0432\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0430\u0448 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u0435\u0442 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u043c \u0438 \u043d\u0435\u043e\u0431\u043e\u0437\u0440\u0438\u043c\u044b\u043c. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e InstanceCount \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u2014 \u0442\u0430\u043a \u0437\u0430\u0447\u0435\u043c \u0438\u0445 \u0437\u0430\u043d\u043e\u0432\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u043e\u0432?<\/p>\n<p>  <\/p>\n<h2 id=\"virtualnye-peremennye-klassa\">\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0442\u0430\u043a \u044d\u0442\u043e \u043d\u043e\u0432\u0430\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u2013 \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 V\u041c\u0422. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0436\u0435\u043b\u0430\u0435\u043c\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u044f\u0437\u044b\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 (<b>virtual class var<\/b>) \u2013 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u2013 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430. \u0412\u043e\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044d\u0442\u043e\u0439 \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">class var FInstanceCount: integer; virtual;<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0430\u043c\u044b\u043c \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u043d\u043e \u044d\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u00ab<b>virtual<\/b>\u00bb \u0438\u0437 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u0432 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432. \u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043d\u0430\u0440\u0443\u0448\u0438\u0442 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u00ab<b>virtual<\/b>\u00bb \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043a \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <b>virtual<\/b> \u043a\u0430\u043a \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443. \u042d\u0442\u043e \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">  TFruit = class   private     class virtual var FInstanceCount: integer;   public     constructor Create;     class property InstanceCount: integer read FInstanceCount;   end;   TApple = class(TFruit)     \/\/...   end;   TOrange = class(TFruit)     \/\/...   end;  implementation  constructor TFruit.Create; begin   inherited Create;   Inc(FInstanceCount); end;  class function TFruit.InstanceCount: integer; begin   Result := FInstanceCount; end;  procedure Test; var   List: TList; begin   List := TList.Create;   List.Add(TApple.Create);   List.Add(TApple.Create);   List.Add(TOrange.Create);   Writeln('Apples: ', TApple.InstanceCount);   Writeln('Oranges: ', TOrange.InstanceCount);   readln; end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c, \u0442\u043e \u0447\u0442\u043e \u043e\u0442 \u043d\u0435\u0433\u043e \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">Apples: 2 Oranges: 1<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"staryy-otchet\">\u0421\u0442\u0430\u0440\u044b\u0439 \u043e\u0442\u0447\u0435\u0442<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0438\u0434\u0435\u044f \u0432\u0435\u0434\u0435\u0442 \u0441\u0432\u043e\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0441 \u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u0435\u0449\u0435 \u0432 1998 \u0433\u043e\u0434\u0443 (\u0442\u043e\u0433\u0434\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0431\u044b\u043b\u0430 \u0435\u0449\u0435 Delphi 4 \u0438 \u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u0443\u0449\u0435\u043d\u044b \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430) \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Borland \u043f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u043e\u0439. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043e\u0442\u0440\u044b\u0432\u043a\u0438 \u0438\u0437 \u043c\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f (that has been Closed with As Designed ages ago \u2014 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0437\u0430\u043a\u0440\u044b\u0442 \u0432 \u0441\u0438\u043b\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0443\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430 [\u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0442\u0430\u043a \u0438 \u043d\u0435 \u0441\u043c\u043e\u0433 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u0443 \u0444\u0440\u0430\u0437\u0443! \u2013 \u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.]):<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043a\u043b\u0430\u0441\u0441\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TFoo = class   private     class FBar: integer;     class procedure SetBar(Value: integer);   public     class property Bar: integer read FBar write SetBar;   end;  class procedure TFoo.SetBar(Value: integer); begin   if Value &lt;&gt; FBar then   begin     FBar := Value;   end; end;<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u042d\u0442\u0430 \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u0435\u0442\u0430\u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u043e \u0447\u0435\u0433\u043e \u044f \u0445\u043e\u0447\u0443. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430. \u042d\u0442\u043e \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<\/em><\/p>\n<p>  <\/p>\n<p><strong><em>\u041a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 (\u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 ClassName \u0438 InstanceSize \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430).<\/em><\/strong> <em>\u0425\u043e\u0442\u044f, \u043e\u0431\u0435 \u0438\u0434\u0438\u043e\u043c\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0442\u0430\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430?<\/em><\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">  TFoo = class   private     class FBar: integer; const;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f (\u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043c\u043d\u044b \u0437\u0430\u0434\u043d\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c), \u044d\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 \u0432\u044b\u0448\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b; \u043a\u043b\u0430\u0441\u0441 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u0430. \u042f \u043d\u0435 \u043e\u0431\u0432\u0438\u043d\u044f\u044e \u0438\u0445 (Borland\/CodeGear) \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0436\u0435\u043d\u0438\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0442\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u044b\u043b \u0432\u044b\u0441\u043e\u043a, \u0434\u0430 \u044f \u0438 \u043d\u0435 \u0437\u043d\u0430\u044e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0431\u044b\u043b \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d (\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a?).<\/p>\n<p>  <\/p>\n<h2 id=\"realizaciya-virtualnoy-peremennoy-klassa\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0442\u0430\u043a\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u044f\u0437\u044b\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430? \u041c\u044b \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 (\u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430): \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 VMT \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u043d\u0430 VMT \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041a\u0430\u0436\u0434\u044b\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u043d\u0438\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d BASM \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b VMTINDEX) \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f VMT-\u0441\u043b\u043e\u0442\u0430 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u0434\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h3 id=\"vmt-slot-na-kazhdoe-pole\">VMT-\u0441\u043b\u043e\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0435<\/h3>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 VMT \u043e\u0434\u0438\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0442 \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430? \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u0440\u044f\u043c\u043e\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b VMT \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c (\u0430 \u044d\u0442\u043e 100% \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e VMT \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0438\u0434\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>\u042f \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0437\u0430\u043c\u0435\u0442\u043a\u0430\u0445 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 \u0441\u0430\u043c\u043e\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043a\u043e\u0434\u0430 [3], \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 DEP (Data Execution Protection \u2014 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u00ab\u0434\u043e\u0431\u0440\u043e\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u043d\u044b\u043c \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0438\u043d\u043e\u043c\u00bb, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0412 \u0442\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">procedure PatchCodeDWORD(Code: PDWORD; Value: DWORD); \/\/ Self-modifying code - change one DWORD in the code segment var   RestoreProtection, Ignore: DWORD; begin   if VirtualProtect(Code, SizeOf(Code^), PAGE_EXECUTE_READWRITE,     RestoreProtection) then   begin     Code^ := Value;     VirtualProtect(Code, SizeOf(Code^), RestoreProtection, Ignore);     FlushInstructionCache(GetCurrentProcess, Code, SizeOf(Code^));   end; end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u043d\u0430 \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u00ab\u043f\u043e\u0432\u0435\u0437\u043b\u043e\u00bb, \u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u043a\u043b\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0448\u0430\u043d\u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0438. \u0422\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u043e, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u0430. \u041a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e.<\/p>\n<p>  <\/p>\n<h3 id=\"virtualnaya-class-field-table\">\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f Class Field Table<\/h3>\n<p>  <\/p>\n<p>\u0414\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 V\u041c\u0422 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0438\u0434\u0435\u0435\u0439, \u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0442\u0430\u043c \u0436\u0435 \u2014 \u043d\u0435\u0442. \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0430\u0435\u0442 \u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c VMT \u0441 \u043d\u043e\u0432\u044b\u043c \u0432\u043e\u043b\u0448\u0435\u0431-\u043d\u044b\u043c \u0441\u043b\u043e\u0442\u043e\u043c \u2013 \u043f\u043e\u0437\u0432\u043e\u043b\u044c\u0442\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e ClassFieldTable (\u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044f\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u043d\u0435\u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442\u044c \u0432 VMT). \u042d\u0442\u043e\u0442 \u0441\u043b\u043e\u0442 \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 (\u0437\u0430\u043f\u0438\u0441\u044c), \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c\u0443\u044e \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u0441\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u0438\u043b\u0438 \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430\u0445. \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u044d\u0442\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u0438 ClassFieldTable-\u0441\u043b\u043e\u0442 \u0432 V\u041c\u0422 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043a\u043e-\u0434\u0430. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 ClassFieldTable \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 V\u041c\u0422 \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a\u043e\u043c\/\u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. <\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u044f\u0432\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u00ab\u043c\u0430\u0433\u0438\u044e\u00bb \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0444\u0438\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0437\u0430\u043f\u0438\u0441\u0438 (\u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0442\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u043a\u0430\u043a AnsiString, WideString, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, Variant \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432) \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439.<\/p>\n<p>  <\/p>\n<h3 id=\"realizaciya-komplyacii\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043d\u0430 \u0432\u0445\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430. \u0412\u043e\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u0435 \u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f 3\u0445 \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u0439. \u042f \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0434\u0440\u0443\u0433\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u0430 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432-\u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TFruit = class   private     class virtual var FInstanceCount: integer;   public     constructor Create;     class property InstanceCount: integer read FInstanceCount;   end;   TCitrus = class(TFruit)   end;   TOrange = class(TCitrus)   private     class virtual var ClassDescription: string;   end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0432\u043e\u0442 \u043f\u0441\u0435\u0432\u0434\u043e-\u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TFruit = class   private     class virtual var FInstanceCount: integer;   public     constructor Create;     class property InstanceCount: integer read FInstanceCount;   end;   TCitrus = class(TFruit)   end;   TOrange = class(TCitrus)   private     class virtual var ClassDescription: string;   end; \/\/ Compiler generated types and variables var   \/\/ Global variables used for per-class virtual class fields    FruitClassVars = record     FInstanceCount: integer;   end;   CitrusClassVars = record \/\/ inherits field      FInstanceCount: integer;   end;   OrangeClassVars = record \/\/ inherits field, introduces new field      FInstanceCount: integer;     ClassDescription: string;   end;   \/\/ New VMT slot initialization, generated by compiler:   TFruitVMT = record      ClassVarTable := @FruitClassVars;   end;    TCitrusVMT = record     ClassVarTable := @CitrusClassVars;   end;    TOrangeVMT = record     ClassVarTable := @OrangeClassVars;   end; <\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043c\u043e\u0435 \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0435\u0432\u044f\u0442\u0438\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u0438\u0432\u043e\u0436\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<h4 id=\"kak-eto-realizovat\">\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c:<\/h4>\n<p>  <\/p>\n<p><em>\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u041b\u0435\u0436\u0430\u0449\u0430\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043a\u0430\u043a \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c (\u0447\u0435\u043c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044f\u0432\u043d\u043e\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439).<br \/>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430-\u043e\u0434\u043d\u0430-\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0438\u043f\u0430 \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0443\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u0435\u0439 \u0432 V\u041c\u0422:<\/em><\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">ClassInstanceSize: Integer;  ClassInstanceData: Pointer;<\/code><\/pre>\n<p>  <\/p>\n<p><em>ClassInstanceSize \u0434\u0430\u0441\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435. ClassInstanceData \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0431\u043b\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 \u043f\u043e\u043b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430. \u042d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0443\u043b\u044f\u043c\u0438.<br \/>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u044d\u0442\u0438 \u043f\u043e\u043b\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b VMT. \u041a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c ClassInstanceSize = Parent.ClassInstanceSize + SizeOf (\u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u043b\u0435 \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435).<\/em><\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 \u043f\u043e\u043b\u0435 ClassInstanzeSize (\u0438\u043b\u0438 ClassVarTableSize) \u043d\u0435\u0442. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0441\u0432\u043e\u0435\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0438\u0438, \u043d\u043e \u043e\u043d\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 (\u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0439\u0441\u044f \u0432 .dcu), \u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0438\u043c \u043a\u043e\u0434 \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u043c, \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044f VirtualMethodCount \u0432 V\u041c\u0422. \u0422\u0430 \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u0430 \u0438 \u043a \u043d\u0430\u0448\u0438\u043c \u043d\u043e\u0432\u044b\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u044f\u043c \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043d\u043e\u0432\u043e\u043c\u0443 ClassVarTable-\u0441\u043b\u043e\u0442\u0443.<\/p>\n<p>  <\/p>\n<p><b>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442&#8230;<\/b><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0432 \u0441\u0438\u043b\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0432 \u044f\u0437\u044b\u043a\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0431\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0443\u0442\u044c \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<h5 id=\"opublikovano-hallvard-vassbotn-v-pyatnicu-04-maya-2007\">\u041e\u041f\u0423\u0411\u041b\u0418\u041a\u041e\u0412\u0410\u041d\u041e HALLVARD VASSBOTN \u0412 \u041f\u042f\u0422\u041d\u0418\u0426\u0423, 04 \u041c\u0410\u042f 2007<\/h5>\n<p>  <\/p>\n<h1 id=\"sovet--17-virtualnye-peremennye-klassa-chast-ii\">\u0421\u043e\u0432\u0435\u0442 # 17. \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430. \u0427\u0430\u0441\u0442\u044c II<\/h1>\n<p>  <\/p>\n<p>\u0412 \u0447\u0430\u0441\u0442\u0438 I \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043c\u044b \u0432\u0432\u0435\u043b\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (Delphi 2007 ) \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e Object Pascal (\u043a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f). \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435. \u0412 \u044d\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043c\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043c\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0438\u0441\u0430\u043a, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Delphi, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0438\u0442\u0440\u044b\u0435 \u0442\u0440\u044e\u043a\u0438 \u0438 \u0445\u0430\u043a\u0438. \u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u044d\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 <a href=\"http:\/\/www.vanlogchem.nl\/archive_patrick.php\">\u041f\u0430\u0442\u0440\u0438\u043a\u0443 \u0432\u0430\u043d Logchem<\/a> [4].<\/p>\n<p>  <\/p>\n<h2 id=\"reshenie\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043d\u0430\u043c \u0434\u0435\u043b\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 CodeGear (Embarcadero) \u0432\u0441\u0435 \u0435\u0449\u0435 \u043e\u0431\u0434\u0443\u043c\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 Delphi \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u0430? <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u043e\u0436\u0443 \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0437 \u0441\u0432\u043e\u0435\u0439 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u043a\u0438 \u0441 \u041f\u0430\u0442\u0440\u0438\u043a\u043e\u043c \u0432\u0430\u043d \u041b\u043e\u0433\u0445\u0435\u043c\u043e\u043c (Logchem) \u0438\u0437 <a href=\"http:\/\/everyangle.com\/\">everyangle.com<\/a>. \u0412\u043e\u0442 \u0447\u0442\u043e \u043e\u043d \u043c\u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b: <\/p>\n<p>  <\/p>\n<p><em>[&#8230;] \u0412\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 Delphi \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2005, \u043d\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435: \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b. \u042d\u0442\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u044f\u0437\u044b\u043a\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0438\u043f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u2014 \u044f \u0445\u043e\u0447\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/em><\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">TClass1 =  class(TObject)  public    \/\/ written once, read _very_ frequently     class property Variable: Type;  end;   TClass2 = class(TClass1);<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u043f\u0440\u0438\u0447\u0435\u043c TClass1.Variable &lt;&gt; TClass2.Variable. \u041d\u0430 \u0441\u043b\u043e\u0432\u0430\u0445: \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0438 \u0432\u0441\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/em><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 \u0432 \u0447\u0430\u0441\u0442\u0438 I. \u041d\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0443\u044f\u0441\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0432 Delphi, \u041f\u0430\u0442\u0440\u0438\u043a \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u043e, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0431\u044b \u043b\u044e\u0431\u043e\u0439 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440 \u2014 \u043e\u043d \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041f\u0430\u0442\u0440\u0438\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442:<\/p>\n<p>  <\/p>\n<p><em>\u042f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0447\u0438\u0441\u0442\u043e \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u044f \u043d\u0430\u0447\u0430\u043b \u0432\u0437\u043b\u043e\u043c. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0442 \u0432 VMT \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439! \u041f\u0440\u0438\u0432\u043e\u0436\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/em><\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   PClass = ^TClass;   \/\/ this class contains important meta-data,    \/\/ accessed _very_ frequently   TClassInfo = class(TObject);    TBasicObject = class(TObject)   strict private     procedure VMT_Placeholder1; virtual;   protected     class procedure SetClassInfo(const aClassInfo: TClassInfo);   public     class procedure InitVMTPlaceholders; virtual;     function GetClassInfo: TClassInfo; inline;     \/\/ Strange: Inlining of class methods doesn't work (yet)!     class function ClassGetClassInfo: TClassInfo; inline;    end;    PBasicObjectOverlay = ^RBasicObjectOverlay;   RBasicObjectOverlay = packed record     OurClassInfo: TClassInfo;   end;  procedure PatchCodeDWORD(Code: PDWORD; Value: DWORD); \/\/ Self-modifying code - change one DWORD in the code segment var   RestoreProtection, Ignore: DWORD; begin   if VirtualProtect(Code, SizeOf(Code^), PAGE_EXECUTE_READWRITE,     RestoreProtection) then   begin     Code^ := Value;     VirtualProtect(Code, SizeOf(Code^), RestoreProtection, Ignore);     FlushInstructionCache(GetCurrentProcess, Code, SizeOf(Code^));   end; end;  class procedure TBasicObject.InitVMTPlaceholders; begin   \/\/ First, check if the VMT-mapping came thru the compiler alright :   if Pointer(ClassGetClassInfo) = Addr(TBasicObject.VMT_Placeholder1) then   begin     \/\/ Now, empty the variable default,      \/\/ very important for later code !     PatchCodeDWORD(@PBasicObjectOverlay(Self).OurClassInfo, DWORD(nil));      \/\/ Now check that we see a cleaned up variable :     Assert(ClassGetClassInfo = nil, 'Failed cleaning VMT of ' + ClassName);   end   else     \/\/ When there's no original content anymore, this initialization      \/\/ has already been done - there _has_ to be a nil here :     Assert(ClassGetClassInfo = nil,        'Illegal value when checking initialized VMT of ' + ClassName); end;  function TBasicObject.GetClassInfo: TClassInfo; begin   Result := PBasicObjectOverlay(PClass(Self)^).OurClassInfo; end;  class function TBasicObject.ClassGetClassInfo: TClassInfo; begin   Result := PBasicObjectOverlay(Self).OurClassInfo; end;  class procedure TBasicObject.SetClassInfo(const aClassInfo: TClassInfo); begin   PatchCodeDWORD(@PBasicObjectOverlay(Self).OurClassInfo, DWORD(aClassInfo)); end;  procedure TBasicObject.VMT_Placeholder1; begin   \/\/ This method may never be called!    \/\/ It only exists to occupy a space in the VMT!   Assert(False);    \/\/ This line prevents warnings about unused symbols   \/\/ (until the compiler detects endless recursive loops)...   VMT_Placeholder1;  end;   initialization   \/\/ call this for any derived class too   TBasicObject.InitVMTPlaceholders; end.<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u0421\u0430\u043c\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 GetClassInfo \u0441\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0434\u0432\u0443\u0445 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439:<\/em><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">MOV EAX, [EAX]    \/\/ Go from instance to VMT MOV EAX, [EAX+12] \/\/ read from the VMT at some offset (!)<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u0412\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0447\u0435\u043c \u044d\u0442\u043e\u0442!<\/em><\/p>\n<p>  <\/p>\n<p>\u0414\u0430, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e\u0442 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0435!<\/p>\n<p>  <\/p>\n<h2 id=\"analiziruya-vzlom\">\u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u0432\u0437\u043b\u043e\u043c<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044c\u0442\u0435 \u0432\u0437\u044f\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0430\u0443\u0437\u0443 \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0445\u0430\u043a \u041f\u0430\u0442\u0440\u0438\u043a\u0430. \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u0432\u0432\u043e\u0434\u0438\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 TBasicObject. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u0441\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u044f\u043c\u043e \u0438\u043b\u0438 \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0433\u043e. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435\u0447\u0442\u043e \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0435 \u2013 \u043e\u043d \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u0439 \u0447\u0430\u0441\u0442\u043d\u044b\u0439 (<strong>strict private<\/strong>) \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 (\u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 VMT_Placeholder1), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d. \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0442 (<strong>override<\/strong>) \u2013 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0442 \u0432 VMT \u2013 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 (\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432).<\/p>\n<p>  <\/p>\n<h3 id=\"rezervirovanie-slota-v-vmt\">\u0420\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0442\u0430 \u0432 V\u041c\u0422<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0445\u043e\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432 V\u041c\u0422? \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0441\u0442\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438, \u0430 \u043d\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432! \u0421\u043c\u044b\u0441\u043b \u044d\u0442\u043e\u043c\u0443 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044e \u043f\u0440\u0438\u0434\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 GetClassInfo (\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 ClassGetClassInfo) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0430 TClassInfo, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (\u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430, \u0432 \u0434\u0443\u0445\u0435 .NET). \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">function TBasicObject.GetClassInfo: TClassInfo; begin   Result := PBasicObjectOverlay(PClass(Self)^).OurClassInfo; end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432. \u042d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u044f\u0432\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 GetClassInfo \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0439 (\u0438\u043b\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, TBasicObject) \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 TObject, \u0447\u0435\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u0435. \u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u043f\u0435\u0440\u0432\u044b\u0435 4 \u0431\u0430\u0439\u0442\u0430 \u0431\u043b\u043e\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 TClass, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 VMT \u043a\u043b\u0430\u0441\u0441\u0430. PClass(Self)^ \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0438 \u0432\u044b\u0434\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u044e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f V\u041c\u0422. VMT \u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430. \u041f\u0440\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b TObject \u0438 \u00ab\u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u0435\u00bb \u043f\u043e\u043b\u044f VMT (\u0441 \u0434\u0435\u0442\u0430\u043b\u044f\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 VMT \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043c\u043e\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 [5]).<\/p>\n<p>  <\/p>\n<h3 id=\"magiya-preobrazovaniya-tipov\">\u041c\u0430\u0433\u0438\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432<\/h3>\n<p>  <\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 TClass \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u0430 \u0432 \u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435, \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u044f\u0432\u043d\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0435\u0435 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043b\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0447\u043b\u0435\u043d\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u0430\u043a\u0438\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a ClassName. \u041a\u043e\u0434, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 TClass \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c RBasicObjectOverlay \u0437\u0430\u043f\u0438\u0441\u0438. \u042d\u0442\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 4-\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0439 OurClassInfo, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 \u0442\u0438\u043f, \u0447\u0442\u043e \u0438 \u043c\u0435\u0442\u0430\u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e TClassInfo. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u0435\u0442\u043e\u0434 VMT_Placeholder1 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0432 TBasicObject, \u0438 TBasicObject \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 TObject (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0442.\u0435. VMT-\u0441\u043b\u043e\u0442\u043e\u0432 \u0441 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u043c\u0438), \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u044e OurClassInfo \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f VMT-\u0441\u043b\u043e\u0442\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e VMT_Placeholder1. \u041f\u043e\u043d\u044f\u0442\u043d\u043e?<\/p>\n<p>  <\/p>\n<h3 id=\"kak-eto-vyglyadit-so-storony-kompilyatora\">\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 VMT-\u0441\u043b\u043e\u0442 VMT_Placeholder1 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 TClassInfo. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0434\u0440\u0435\u0441 \u043a\u043e\u0434\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d @TBasicObject VMT_Placeholder1 \u2013 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0443\u0447\u0438 strict private, \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043d\u043e\u0432\u0430 \u00ab\u043f\u043e\u0434\u043b\u0430\u0442\u0430\u0442\u044c\u00bb VMT [6](\u044f \u0432\u0435\u0434\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u043b \u0432\u0430\u0441, \u0447\u0442\u043e \u044d\u0442\u043e \u0445\u0430\u043a?). \u041c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 \u2014 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 TBasicObject \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 V\u041c\u0422-\u0441\u043b\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">class procedure TBasicObject.InitVMTPlaceholders; begin   \/\/First, check if the VMT-mapping came thru the compiler alright:   if Pointer(ClassGetClassInfo) = Addr(TBasicObject.VMT_Placeholder1) then   begin     \/\/ Now, empty the variable default,     \/\/ very important for later code !     PatchCodeDWORD(@PBasicObjectOverlay(Self).OurClassInfo, DWORD(nil));      \/\/ Now check that we see a cleaned up variable :     Assert(ClassGetClassInfo = nil, 'Failed cleaning VMT of ' + ClassName);   end   else     \/\/ When there's no original content anymore, this initialization     \/\/ has already been done - there _has_ to be a nil here :     Assert(ClassGetClassInfo = nil,       'Illegal value when checking initialized VMT of ' + ClassName); end;  initialization   \/\/ call this for any derived class too   TBasicObject.InitVMTPlaceholders; end.<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0435, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c VMT-\u0441\u043b\u043e\u0442\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430\u0448\u0438\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c. \u0415\u0441\u043b\u0438 \u0441\u043b\u043e\u0442 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u0430\u0434\u0440\u0435\u0441 \u043c\u0435\u0442\u043e\u0434\u0430 TBasicObject.VMT_Placeholder1, \u043c\u0435\u0442\u043e\u0434 \u043b\u0438\u0431\u043e \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d, \u043d\u0435 \u0431\u044b\u043b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0438\u043b\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0435 \u0442\u043e\u0442 \u0441\u043b\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u043b\u0438. \u0411\u0435\u0440\u0435\u0436\u0435\u043d\u043e\u0433\u043e \u0411\u043e\u0433 \u0431\u0435\u0440\u0435\u0436\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 PatchCodeDWORD \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0433\u0440\u044f\u0437\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u043f\u0440\u0438\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f nil \u0432 VMT-\u0441\u043b\u043e\u0442 (\u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u044d\u0444\u0444\u0435\u043a-\u0442\u0438\u0432\u043d\u043e \u043e\u0447\u0438\u0449\u0430\u044f \u0435\u0433\u043e). \u0414\u0430\u043b\u0435\u0435, \u043e\u043f\u044f\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u043e, \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Assert, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<p>  <\/p>\n<h3 id=\"sozdanie-klassa-metainfo\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 MetaInfo<\/h3>\n<p>  <\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433. \u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 nil-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 TClassInfo, \u043d\u043e \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e.<\/p>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043d\u0430\u0448\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u0442\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 TClassInfo \u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0432 \u0437\u0430\u043f\u0438\u0441\u0438 \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 VMT-\u0441\u043b\u043e\u0442. \u042d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441: \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f, \u0438\u043b\u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 SetClassInfo. \u0412\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0434\u0435 \u043c\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e TClassInfo \u0441 \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u043b\u0435\u043c \u0446\u0435\u043b\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TClassInfo = class(TObject)   public     A: integer;     constructor Create(Value: integer);   end;  constructor TClassInfo.Create(Value: integer); begin   inherited Create;   A := Value; end;  initialization   TBasicObject.InitVMTPlaceholders;   TBasicObject.SetClassInfo(TClassInfo.Create(42));<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 GetClassInfo \u0438 InitVMTPlaceholders, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f SetClassInfo \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0430\u0441 \u0443\u0434\u0438\u0432\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">class procedure TBasicObject.SetClassInfo(const aClassInfo: TClassInfo); begin   PatchCodeDWORD(@PBasicObjectOverlay(Self).OurClassInfo, DWORD(aClassInfo)); end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 VMT-\u0441\u043b\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 TClassInfo. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 TClassInfo \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 GetClassInfo, \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 TClassInfo \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0441\u0442\u0440\u0430\u0445\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0430\u043c\u044f\u0442\u0438. \u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 TClassInfo \u0436\u0438\u0432\u0435\u0442 \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0443\u0447\u0435, \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"klassy-prikladnogo-urovnya\">\u041a\u043b\u0430\u0441\u0441\u044b \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0448\u0438 TClassInfo-\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043f\u0440\u043e\u0441\u0442\u043e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u043e\u0442 TBasicObject, \u0432\u044b\u0437\u0432\u0430\u0442\u044c InitVMTPlaceholders \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 TClassInfo \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SetClassInfo. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043d\u0430\u0448 \u00ab\u0444\u0440\u0443\u043a\u0442\u043e\u0432\u044b\u0439\u00bb \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0427\u0430\u0441\u0442\u0438 I, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0443 \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u0445\u043d\u0438\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   TFruitClassInfo = class(TClassInfo)   {unit} private     var FInstanceCount: integer;   end;   TFruit = class(TBasicObject)   protected     class function FruitClassInfo: TFruitClassInfo; inline;   public     constructor Create;     class function InstanceCount: integer;   end;   TApple = class(TFruit)   end;   TOrange = class(TFruit)   end;  constructor TFruit.Create; begin   inherited Create;   Inc(FruitClassInfo.FInstanceCount); end;  class function TFruit.FruitClassInfo: TFruitClassInfo; begin   Result := ClassGetClassInfo as TFruitClassInfo; end;  class function TFruit.InstanceCount: integer; begin   Result := FruitClassInfo.FInstanceCount; end;  initialization   TFruit.SetClassInfo(TFruitClassInfo.Create);   TApple.SetClassInfo(TFruitClassInfo.Create);   TOrange.SetClassInfo(TFruitClassInfo.Create); end.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u043e\u0434 \u0441\u0442\u0430\u043b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435. \u0424\u0443\u043d\u043a\u0446\u0438\u044f InstanceCount \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 TFruit \u2013 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 TApple \u0438 TOrange \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0434\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e \u0432\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u044d\u0442\u0438\u043c \u043f\u0440\u0438\u0435\u043c\u043e\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0435\u043d\u0438\u0432\u0448\u0438\u0441\u044c, \u044f \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c VMT-\u0441\u043b\u043e\u0442\u0430 \u0441 nil (\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f InitVMTPlaceholders \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430). \u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0412\u0432\u043e\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043a\u0430 TClassInfo \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u043e \u0442\u0438\u043f\u0443 \u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0430 TFruitClassInfo, \u044f \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043a\u043b\u0430\u0441\u0441-\u0444\u0443\u043d\u043a\u0446\u0438\u044e (FruitClassInfo), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043c\u043d\u0435 \u0442\u0438\u043f\u0430.<\/p>\n<p>  <\/p>\n<h3 id=\"ustroystvo-classinfo\">\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e ClassInfo<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0438 \u0433\u043e\u043c\u043e\u0433\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 TClassInfo, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432\u0441\u0435\u043c\u0438 \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438, \u0438\u043b\u0438 \u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043c\u043a\u0438 TClassInfo. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 (\u043c\u043e\u0436\u043d\u043e \u00ab\u0441\u043c\u043e\u0448\u0435\u043d\u043d\u0438\u0447\u0430\u0442\u044c\u00bb, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0436\u0435\u0441\u0442\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430, \u0432\u043c\u0435\u0441\u0442\u043e as-\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f).<\/p>\n<p>  <\/p>\n<h3 id=\"podvodnye-kamni-vstraivaniya-inlining\">\u041f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f (inlining)<\/h3>\n<p>  <\/p>\n<p><del>\u0412\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 GetClassInfo \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0430 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u00ab\u0436\u0438\u0432\u043e\u0439\u00bb \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 (\u0430 \u043d\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438\u043b\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430) \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e \u043c\u0435\u0441\u0442\u0443 \u0432\u044b\u0437\u043e\u0432\u0430, \u0447\u0442\u043e \u043f\u043e \u0431\u044b\u0442\u0443\u044e\u0449\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043a\u043e\u0434.<\/del> \u0415\u0441\u043b\u0438 \u0432\u044b \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b\u0439 \u043c\u043d\u043e\u044e \u0432\u044b\u0448\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442, \u0442\u043e \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u2013 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044f \u0431\u044b\u043b \u043f\u043e\u0434 \u0432\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0446\u0430 \u043a\u043e\u0434\u0430. \u0412 \u043a\u043e\u0434\u0435 \u041f\u0430\u0442\u0440\u0438\u043a\u0430 TBasicObject.InitVMTPlaceholders \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 ClassGetClassInfo, \u0438 \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f-\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0434, \u0442\u043e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043d\u0435 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u0421\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u043f\u043e\u043d\u044f\u043b \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u2013 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u00ab\u0432\u0438\u0434\u043d\u0430\u00bb \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u043f\u0435\u0440\u0435\u0434 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043a \u043d\u0435\u043c\u0443 \u2014 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0434. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Delphi \u044f\u0432\u043d\u043e \u0438 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0440\u0430\u0437-\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043a\u0430\u043a \u043e\u0434\u043d\u043e\u043f\u0440\u043e\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0447\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u0434 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d. \u0421 \u044d\u0442\u0438\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0431\u043d\u043e\u0432\u0438\u043b \u0441\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 (\u0441\u0441\u044b\u043b\u043a\u0430). \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u0435 InitVMTPlaceholders \u043d\u0438\u0436\u0435 \u0432 ClassGetClassInfo, \u0442\u043e \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u043c. \u041f\u0440\u0438\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043d\u0435\u0434\u043e\u0440\u0430\u0437\u0443\u043c\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<h2 id=\"s-tochki-zreniya-proizvoditelnosti\">\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043e\u0442\u043c\u0435\u0442\u0438\u043b \u041f\u0430\u0442\u0440\u0438\u043a \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0438\u0441\u044c\u043c\u0435, \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 GetClassInfo \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 TClassInfo \u0438\u0437 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ClassInfo := Apple.GetClassInfo; \/\/ With inlinging and optimization enabled  \/\/ this compiles into asm    MOV EAX,[EAX]    MOV EAX,[EAX] end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u0430 TClassInfo \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u0432\u0443\u0445 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432 \u0438 \u0434\u0432\u0443\u0445 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043a \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0435\u0440\u0432\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u0442 \u043e\u0442 TObject \u043a TClass, \u0432\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e V\u041c\u0422-\u0441\u043b\u043e\u0442\u0430 (\u0442.\u0435. \u0438\u043d\u0434\u0435\u043a\u0441 \u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 0). \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0448\u044c \u2014 \u043e\u0447\u0435\u043d\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442!<\/p>\n<p>  <\/p>\n<h2 id=\"ochischenie-haka\">\u041e\u0447\u0438\u0449\u0435\u043d\u0438\u0435 \u0445\u0430\u043a\u0430?<\/h2>\n<p>  <\/p>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u041f\u0430\u0442\u0440\u0438\u043a \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u043a\u0430\u043a\u043e\u0439 \u0445\u0430\u043a \u043e\u043d \u0434\u043e\u0441\u0442\u0430\u043b \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0443\u043a\u0430\u0432\u0430, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0447\u0442\u043e-\u0442\u043e \u0435\u0433\u043e \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u043b\u043e. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u043b\u0443\u0447\u0448\u0435 \u0438\u043b\u0438 \u0447\u0438\u0449\u0435? <\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. <\/p>\n<p>  <\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u0443\u044e \u041f\u0430\u0442\u0440\u0438\u043a\u0430:<\/p>\n<p>  <\/p>\n<p><em>\u041d\u043e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u044f\u0437\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0447\u0435\u043c \u044d\u0442\u043e?<\/em><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u043e \u043e\u043d\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c. \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 TClass: \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 TClassInfo \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043d\u0430 \u044d\u0442\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u0447\u0438\u0441\u0442\u044b\u043c, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u043e\u0432\u044b\u0439 VMT-\u0441\u043b\u043e\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u0430 \u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 VMT-\u0441\u043b\u043e\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 AutoTable \u2014 \u0430\u0442\u0430\u0432\u0438\u0437\u043c Delphi 2, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0432 \u043f\u0441\u0435\u0432\u0434\u043e\u0437\u0430\u043f\u0438\u0441\u044c VMT (\u0435\u0433\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0437\u044f\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430):<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   PVmt = ^TVmt;   TVmt = packed record     SelfPtr           : TClass;     IntfTable         : Pointer;     AutoTable         : Pointer;     InitTable         : Pointer;     TypeInfo          : Pointer;     FieldTable        : Pointer;     MethodTable       : Pointer;     DynamicTable      : Pointer;     ClassName         : PShortString;     InstanceSize      : PLongint;     Parent            : PClass;     SafeCallException : PSafeCallException;     AfterConstruction : PAfterConstruction;     BeforeDestruction : PBeforeDestruction;     Dispatch          : PDispatch;     DefaultHandler    : PDefaultHandler;     NewInstance       : PNewInstance;     FreeInstance      : PFreeInstance;     Destroy           : PDestroy;    {UserDefinedVirtuals: array[0..999] of procedure;}   end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0442\u0430 AutoTable:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434<\/li>\n<li>\u043e\u043d \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d nil (\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0433\u043e Delphi 2-\u043a\u043e\u0434\u0430) <\/li>\n<li>\u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u0435\u043c \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u044b \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e TBasicObject.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c VMT-\u0441\u043b\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u0441\u0435\u043a\u0446\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 Delphi 3.<\/p>\n<p>  <\/p>\n<h3 id=\"nostalgiya-delphi-2-com-i-avtomatiziciya\">\u041d\u043e\u0441\u0442\u0430\u043b\u044c\u0433\u0438\u044f: Delphi 2, COM \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u0435\u043c \u0438\u043c\u0435\u0435\u0442 \u0442\u043e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c Delphi 2-\u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0435\u043a\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u042d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0435\u0449\u0435 \u0432 \u0442\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 Delphi \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u043e COM-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c COM-\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c COM. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Delphi \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u00ab\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u00bb \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043e\u0434\u043d\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 COM, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c Delphi, \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b QueryInterface, \u0447\u0442\u043e \u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0443\u044e \u043c\u0430\u0440\u0448\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u00ab\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u00bb (\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u0430).<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u043a\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u043e\u0437\u0434\u043d\u0435\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 RTTI \u0434\u043b\u044f \u0441\u0435\u043a\u0446\u0438\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 COM Delphi 2-\u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434 \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u0445\u043e\u0434 \u0432\u044b\u0437\u043e\u0432\u0430. \u0412 Delphi 3 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0421\u041e\u041c \u0431\u044b\u043b\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u0441 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u0434\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (\u0434\u0438\u0441\u043f\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430). \u041a\u043e\u0440\u043e\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0440\u0430\u0437\u0434\u0435\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 (\u043d\u0430\u0434\u0435\u044e\u0441\u044c) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0434\u043a\u043e. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u043a\u043e\u0434\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c RTTI \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f).<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u043d\u043e\u0439 RTTI \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u043b\u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u044f \u0431\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u0438 \u043b\u0443\u0447\u0448\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e $METHODINFO ON \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e. \u0411\u043e\u043b\u0435 \u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043c\u043e\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445 [7, 8, 9 \u0438 10].<\/p>\n<p>  <\/p>\n<h3 id=\"ochischennyy-hak---perezapis-autotable\">\u00ab\u041e\u0447\u0438\u0449\u0435\u043d\u043d\u044b\u0439\u00bb \u0445\u0430\u043a \u2014 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044c AutoTable<\/h3>\n<p>  <\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0435\u043c\u0430 \u041f\u0430\u0442\u0440\u0438\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e VMT-\u0441\u043b\u043e\u0442\u0430 AutoTable, \u0430 \u043d\u0435 \u0432 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0438 VMT-\u0441\u043b\u043e\u0442\u0430 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0447\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434: <\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type   PClassVars = ^TClassVars;   TClassVars = class(TObject)   public     InstanceCount: integer;   end;    TBasicObject = class(TObject)   protected       class procedure SetClassVars(aClassVars: TClassVars);   public     class function GetClassVars: TClassVars; inline;     function ClassVars: TClassVars; inline;   end;  const   vmtClassVars = System.vmtAutoTable;  function TBasicObject.ClassVars: TClassVars; begin   Result := PClassVars(PInteger(Self)^ + vmtClassVars)^; \/\/ Original code end;  class function TBasicObject.GetClassVars: TClassVars; begin   Result := PClassVars(Integer(Self) + vmtClassVars)^; end;  class procedure TBasicObject.SetClassVars(aClassVars: TClassVars); begin   PatchCodeDWORD(PDWORD(Integer(Self) + vmtClassVars), DWORD(aClassVars)); end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c strict private \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043d\u0438 \u043c\u0435\u0442\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 VMT-\u0441\u043b\u043e\u0442 (\u043c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u043b\u043e\u0442 AutoTable \u0443\u0436\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u0435\u043d). \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0434\u043d\u0443 \u0438\u0437 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f System, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 vmtAutoTable, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412\u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043c\u043e\u0434\u0443\u043b\u044f System:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">const   ... { Virtual method table entries }    vmtSelfPtr           = -76;   vmtIntfTable         = -72;   vmtAutoTable         = -68;   vmtInitTable         = -64;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e AutoTable \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e -68 (\u0438\u043b\u0438 -$44 \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435) \u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f TClass. \u042f \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0448\u0438\u043b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c ClassInfo \u0432 ClassVars, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 TObject.ClassInfo, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 RTTI \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 (\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 TypInfo). \u041c\u0435\u0442\u043e\u0434\u044b SetClassInfo \u0438 ClassInfo \u2014 \u043d\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 (\u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u044f\u0432\u043d\u044b\u0435 \u043d\u0435\u044f\u0432\u043d\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 Self \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 TClass, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043a\u043b\u0430\u0441\u0441). \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 ClassVar \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 TClassVars, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 InstanceCount \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 TClassVars (\u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430-\u043f\u043e\u0442\u043e\u043c\u043a\u0430). \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0442\u0430 ClassVars, \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">procedure RegisterClassVarsSupport(const Classes: array of TBasicObjectClass); var   LClass: TBasicObjectClass; begin   for LClass in Classes do     if LClass.GetClassVars = nil then       LClass.SetClassVars(TClassVars.Create)     else       raise Exception.CreateFmt( 'Class %s has automated section or duplicated registration', [LClass.ClassName]); end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0448 \u00ab\u0444\u0440\u0443\u043a\u0442\u043e\u0432\u044b\u0439\u00bb \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0435\u0449\u0435 \u043f\u0440\u043e\u0449\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">type    TFruit = class(TBasicObject)   public     constructor Create;     function InstanceCount: integer; inline;      class function ClassInstanceCount: integer; inline;    end;    TApple = class(TFruit)   end;    TOrange = class(TFruit)   end; \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026 \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026 \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026 \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026  constructor TFruit.Create; begin   inherited Create;                                       Inc(ClassVars.InstanceCount); end;  function TFruit.InstanceCount: integer; begin   Result := ClassVars.InstanceCount; end;  class function TFruit.ClassInstanceCount: integer; begin   Result := GetClassVars.InstanceCount; end;  initialization   RegisterClassVarsSupport([TFruit, TApple, TOrange]); end.<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435. \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TClass \u0441\u0441\u044b\u043b\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0441\u043b\u043e\u0442 TClassVar \u0432 VMT, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0446\u0435\u043b\u043e\u0435 \u043f\u043e\u043b\u0435 (InstanceCount) \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Count := Apple.ClassInstanceCount; asm   MOV EAX,[ESI]   ADD EAX,-$44   MOV EAX,[EAX]   MOV EBX,[EAX+$04] end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0430 \u043e\u0434\u043d\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u0442\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e vmtAutoTable \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0432 VMT, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c. <\/p>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435\u044f\u0441\u043d\u043e \u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 MOV reg \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u044b\u043b\u0430 \u0431\u044b \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0433 \u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Count := Apple.ClassInstanceCount; asm   MOV EAX,[ESI]   MOV EAX,[EAX-$44]   MOV EBX,[EAX+$04] end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b $44 \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u0432\u0435\u0434\u0435\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u0434\u0435, \u0430 \u044d\u0442\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043f\u0440\u0438 \u044f\u0432\u043d\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u0441\u043c\u043e\u0433\u0443 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a VMT \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u043e\u0442 AutoTable, \u0445\u043e\u0442\u044f \u043c\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043b\u0430\u0441\u0441 TBasicObject, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f TFruit. \u041c\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0437\u0436\u0435 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f. <\/p>\n<p>  <\/p>\n<p>\u042f \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u0432 \u0441\u0432\u043e\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u2014 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0436\u0435 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0441\u043f\u0430\u0442\u044c \u2014 \u0438 \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, Windows Live Writer \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 HTML \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430 \u0432 HTML, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 Delphi2HTML \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u043b\u044f \u043c\u0435\u043d\u044f. \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e\u0442 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0433\u043b\u0443\u043f\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0432 32 \u041a\u0411 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f HTML (\u044d\u0442\u043e \u0447\u0442\u043e 1982 ??!). (\u041e\u0442\u043e\u043d, \u043e\u043d \u0441\u043f\u0430\u0441 \u0432\u0430\u0441 \u043e\u0442 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430).<\/p>\n<p>  <\/p>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u043b\u043e\u0432\u0430 \u041f\u0430\u0442\u0440\u0438\u043a\u0430:<\/p>\n<p>  <\/p>\n<p><em>\u042f \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0448\u0435\u043b \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e vmtAutoTable, \u043a\u0430\u043a \u0432\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438. \u042f \u0443\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b \u0435\u0433\u043e \u043a\u043e \u0432\u0441\u0435\u043c \u0441\u0432\u043e\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 \u043f\u0440\u0438\u0435\u043c, \u0438 \u044d\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0447\u0443\u0434\u0435\u0441\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0441 \u0432\u0430\u043c\u0438 \u0434\u0432\u0438\u0436\u043a\u0430-\u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u0441\u043f\u0430\u0441\u0438\u0431\u043e!<\/em><\/p>\n<p>  <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0430\u043c \u041f\u0430\u0442\u0440\u0438\u043a \u0437\u0430 \u043e\u0431\u043c\u0435\u043d \u0438\u0434\u0435\u044f\u043c\u0438 \u0438 \u043d\u0430\u0448\u0435 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u043e!<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u043c\u0430\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>[\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043b \u0438\u0437 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u043a\u0430\u043a \u0432\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0439\u0441\u044f \u043a \u0442\u0435\u043c\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438].<\/p>\n<p>  <\/p>\n<h4 id=\"opublikovano-hallvard-vassbotn-v-sredu-16-maya-2007\">\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e HALLVARD VASSBOTN, \u0432 \u0441\u0440\u0435\u0434\u0443, 16 \u041c\u0410\u042f 2007<\/h4>\n<p>  <\/p>\n<h1 id=\"ssylki\">\u0421\u0421\u042b\u041b\u041a\u0418<\/h1>\n<p>  <\/p>\n<ol>\n<li>\n<p>Shemitz J. .NET 2.0 for Delphi Programmers, 2006, \u0433\u043b\u0430\u0432\u0430 10 (\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 H. Vassbotn)<\/p>\n<p>  <\/li>\n<li>\n<p>DN4DP#1: Getting classy, <a href=\"http:\/\/hallvards.blogspot.com\/2006\/08\/dn4dp1-getting-classy_31.html\">http:\/\/hallvards.blogspot.com\/2006\/08\/dn4dp1-getting-classy_31.html<\/a><\/p>\n<p>  <\/li>\n<li>\n<p>Vassbotn H. Hack#15: Overriding message and dynamic methods at run-time, <a href=\"http:\/\/hallvards.blogspot.com\/2007\/03\/hack15-overriding-message-and-dynamic.html\">http:\/\/hallvards.blogspot.com\/2007\/03\/hack15-overriding-message-and-dynamic.html<\/a><\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"http:\/\/www.vanlogchem.nl\/archive_patrick.php\">http:\/\/www.vanlogchem.nl\/archive_patrick.php<\/a><\/p>\n<p>  <\/li>\n<li>\n<p>Vassbotn H. Hack #8: Explicit VMT calls, <a href=\"http:\/\/hallvards.blogspot.com\/2006\/03\/hack-8-explicit-vmt-calls.html\">http:\/\/hallvards.blogspot.com\/2006\/03\/hack-8-explicit-vmt-calls.html<\/a><\/p>\n<p>  <\/li>\n<li>\n<p>Vassbotn H. Hack#15: Overriding message and dynamic methods at run-time, <a href=\"http:\/\/hallvards.blogspot.com\/2007\/03\/hack15-overriding-message-and-dynamic.html\">http:\/\/hallvards.blogspot.com\/2007\/03\/hack15-overriding-message-and-dynamic.html<\/a><\/p>\n<p>  <\/li>\n<li>\n<p>Vassbotn H. David Glassborow on extended RTTI, <a href=\"http:\/\/hallvards.blogspot.com\/2006\/05\/david-glassborow-on-extended-rtti.html\">http:\/\/hallvards.blogspot.com\/2006\/05\/david-glassborow-on-extended-rtti.html<\/a><\/p>\n<p>  <\/li>\n<li>\n<p>Vassbotn H. Digging into SOAP and WebSnap, <a href=\"http:\/\/hallvards.blogspot.com\/2006\/06\/digging-into-soap-and-websnap.html\">http:\/\/hallvards.blogspot.com\/2006\/06\/digging-into-soap-and-websnap.html<\/a><\/p>\n<p>  <\/li>\n<li>\n<p>Vassbotn H. Simple Interface RTTI, <a href=\"http:\/\/hallvards.blogspot.com\/2006\/06\/simple-interface-rtti.html\">http:\/\/hallvards.blogspot.com\/2006\/06\/simple-interface-rtti.html<\/a><\/p>\n<p>  <\/li>\n<li>\n<p>Vassbotn H. Extended Class RTTI, <a href=\"http:\/\/hallvards.blogspot.com\/2006\/09\/extended-class-rtti.html\">http:\/\/hallvards.blogspot.com\/2006\/09\/extended-class-rtti.html<\/a><\/p>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h1 id=\"posleslovie-ot-perevodchika\">\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435 \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/h1>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0441\u0432\u043e\u0438 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u0437\u0438\u0441\u043d\u043e (\u044d\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430), \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u043e \u0431\u044b \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0430 \u043e\u0442 \u043c\u0435\u043d\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<p>  <\/p>\n<p>A. \u0423\u0434\u0438\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044f Borland\/CodeGear\/Embarcadero, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0445 \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u044b \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u043d\u044f\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Object Pascal <strong>virtual class var<\/strong> (\u00ab\u2026that has been Closed with As Designed ages ago\u00bb). \u0418 \u044d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043b\u044f Delphi. \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u044f\u0437\u044b\u043a\u0430, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a\u043e\u0439 \u044f \u0435\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0432\u0435\u0442 Delphi \u0438 \u043c\u043e\u0435\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c\u0438 Borland, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043d\u043e\u0432\u044b\u0445 (\u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0438\u0445 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u0421, \u0421++, Java, JavaScript \u0438 \u0442.\u043f.) \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0432 \u044f\u0437\u044b\u043a \u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c (\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c helpr-\u044b). \u0421\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 \u0448\u043b\u043e \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0438\u0434\u0442\u0438 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f (\u043a\u0430\u043a \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u2013 \u043f\u0440\u0438\u043c\u0443\u0442 \u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438), \u0430 \u043f\u043e\u0442\u043e\u043c \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u043d\u0435 \u043f\u0440\u0430\u0432.<\/p>\n<p>  <\/p>\n<p>B. \u041d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043b\u0438 \u0441\u0442\u0430\u0440\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c? \u0421\u0442\u0430\u0440\u043e\u0435 \u2013 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043e \u0432 2007 \u0433\u043e\u0434\u0443? \u0410 \u0447\u0442\u043e \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e\u0435, \u00ab\u0434\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0434\u043e \u0443\u043c\u0430\u00bb \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 Embarcadero \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0430 \u044d\u0442\u043e\u0442 \u00ab\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440\u00bb? \u0414\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0431\u0440\u0430\u0437\u0446\u0435 (pattern) \u00ab\u041e\u0434\u0438\u043d\u043e\u0447\u043a\u0430\u00bb. \u041d\u043e \u0431\u0443\u0434\u0443\u0442 \u043b\u0438 \u043e\u043d\u0438 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435? \u041e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u2013 \u043d\u0435\u0442 (\u043f\u043e\u043c\u043d\u0438\u0442\u0435: \u043e\u0442 2 \u0434\u043e 4 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u0430!).<\/p>\n<p>  <\/p>\n<p>C. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 \u0445\u044d\u043b\u043f\u0435\u0440\u044b (\u0432 \u0438\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430)? \u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u2013 \u0434\u0430. \u0423\u0434\u043e\u0431\u043d\u043e \u043b\u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c? \u041d\u0435\u0442. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u0448\u0438\u0442\u044c \u0442\u0435 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0447\u0442\u043e \u0438 \u0441 <strong>virtual class var<\/strong>? \u2014 \u041d\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>D. \u041f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0445\u0430\u043a \u0438\u043b\u0438 \u00ab\u043d\u0435 \u0445\u0430\u043a\u00bb \u2013 \u043e\u0431\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u0435\u043c. \u042f \u043d\u0435 \u0445\u043e\u0447\u0443 \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0442\u044c \u0436\u0430\u0440\u0433\u043e\u043d\u043d\u044b\u0439 \u0442\u0435\u0440\u043c\u0438\u043d \u00ab\u0445\u0430\u043a\u00bb, \u0438\u043c\u0435\u044e\u0449\u0438\u0439 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b \u2013 \u043a\u0430\u043a \u0432\u0437\u043b\u043e\u043c, \u0433\u0440\u0443\u0431\u043e\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u0430\u0440\u0443\u0448\u0430\u044e\u0449\u0438\u0439 \u0435\u0435 <u><strong>\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435<\/strong><\/u> \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u0438 \u041f\u0430\u0442\u0440\u0438\u043a\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u043b\u043b\u0438\u0430\u0442\u0438\u0432 \u0438 \u043e\u0431\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u0435\u043c. \u0410 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e\u0435 \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0443\u0436\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0435\u0441\u043b\u0438 \u0447\u0435\u0442\u043a\u043e \u043e\u0447\u0435\u0440\u0447\u0435\u043d\u044b \u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0438 \u0440\u0438\u0441\u043a\u0438 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0435 \u00ab\u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u00bb, \u043d\u0430\u0434\u043e \u043f\u0440\u044f\u043c\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2013 \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0447\u0430\u0441\u0442\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 runtime, \u0434\u0430 \u0438 \u0435\u0449\u0435 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432?) \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0442\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b, \u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c? \u0411\u0443\u0434\u0443 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c: \u0438\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u043a\u0430 Embarcadero (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 Embarcadero) \u043d\u0435 \u0432\u0432\u0435\u0434\u0435\u0442 \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430 <b>class ((static | &lt;empty&gt;) | virtual) var<\/b> \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 (\u043a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c Free Pascal?). \u0418 \u044f \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <strong>class virtual var<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u044f \u0431\u0443\u0434\u0443 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u0435\u043d.<\/p>\n<p>  <\/p>\n<p>E. \u041f\u043e \u043e\u0431\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u0435\u043c\u0443. \u0415\u0449\u0435 \u0440\u0430\u0437 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043a\u043e\u0434\u0443 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 (\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u041f\u0430\u0442\u0440\u0438\u043a\u0430) \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 (\u0441\u043c. \u043a\u043e\u0434 \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u0420\u0415\u0428\u0415\u041d\u0418\u0415):<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026 if Pointer(ClassGetClassInfo) = Addr(TBasicObject.VMT_Placeholder1) then \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026 \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f) \u0435\u0449\u0435 \u0440\u0430\u0437 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b:<\/p>\n<p>  <\/p>\n<p>E.1. Addr(TBasicObject.VMT_Placeholder1) \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 VMT-\u0441\u043b\u043e\u0442\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 VMT_Placeholder1() \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 TBasicObject. <\/p>\n<p>  <\/p>\n<p>Pointer(ClassGetClassInfo) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 VMT-\u0441\u043b\u043e\u0442\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 VMT_Placeholder1() \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0433\u043e \u043e\u0442 TBasicObject. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<p>E.2. ClassGetClassInfo() \u2013 \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 VMT \u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 VMT \u043a\u043b\u0430\u0441\u0441\u0430-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430. <\/p>\n<p>  <\/p>\n<p>E.3. \u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d (override), \u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0435\u043c\u0443 VMT-\u0441\u043b\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0435 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c VMT-\u0441\u043b\u043e\u0442\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (\u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u00ab\u0440\u0430\u0441\u0442\u0443\u0442 \u043d\u043e\u0433\u0438\u00bb \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438).<\/p>\n<p>  <\/p>\n<p>\u0412 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u041f\u0430\u0442\u0440\u0438\u043a\u0430, \u044d\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 VMT-\u0441\u043b\u043e\u0442\u0430 VMT_Placeholder1 \u043a\u043b\u0430\u0441\u0441\u0430-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430.<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0430 \u0435\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u0441\u0435\u043a\u0446\u0438\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">initialization \/\/ call this for any derived class too \/\/ \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.   TBasicObject.InitVMTPlaceholders(); end.<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u0432 \u0441\u0435\u043a\u0446\u0438\u044f\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">initialization \/\/ call this for any derived class too \/\/ \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.   TFruit.InitVMTPlaceholders();   TApple.InitVMTPlaceholders();   TOrange.InitVMTPlaceholders(); end.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a \u0441\u0432\u043e\u0435\u043c\u0443 \u0441\u0442\u044b\u0434\u0443, \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 TBasicObject.InitVMTPlaceholders() \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0434\u043b\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>E.4. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f VMT-\u0441\u043b\u043e\u0442\u0443, \u043e\u043d \u0443\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 (\u043e\u0431\u044a\u0435\u043a\u0442) \u043a\u043b\u0430\u0441\u0441\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430. <\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f), \u043d\u043e \u0438 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u2014 \u00ab\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439\u00bb \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 SetClassInfo:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">class procedure TBasicObject.SetClassInfo(const AClassInfo: TClassInfo); var   AVirtualClassInfo: TObject; begin \/\/ \u0415\u0441\u043b\u0438 Pointer(ClassGetClassInfo) &lt;&gt; Addr(TBasicObject.VMT_Placeholder) = true, \/\/ \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u044b\u043b\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e!   if (Pointer(ClassGetClassInfo) &lt;&gt; Addr(TBasicObject.VMT_Placeholder)) then           begin \/\/ \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430!             AVirtualClassInfo := ClassGetClassInfo(); \/\/ \u041d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u00ab\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430\u00bb \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435!             PatchCodeDWORD(@PBasicObjectOverlay (Self).VarClassInfo, DWORD(nil)); \/\/ \u0421\u0442\u0430\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0438\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c!             System.SysUtils.FreeAndNil(AVirtualClassInfo);           end;         PatchCodeDWORD(@PBasicObjectOverlay(Self).VarClassInfo, DWORD(AClassInfo)); end;<\/code><\/pre>\n<p>  <\/p>\n<p>F. \u0427\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c TBasicObject \u043d\u0435 \u043e\u0442 TObject \u0438\u043b\u0438 TInterfacedObject, \u0430 \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b? \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0441 \u043f\u043e\u0434\u0436\u0438\u0434\u0430\u0435\u0442 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0439 \u043f\u043e\u0434\u0432\u043e\u0445. \u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u041f\u0430\u0442\u0440\u0438\u043a\u0430, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0437\u0430\u043f\u043e\u0440\u0442\u044f\u0442\u0441\u044f VMT-\u0441\u043b\u043e\u0442\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435 \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (\u043f\u043e \u0432\u0441\u0435\u0439 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u043e\u0438 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u0443\u043d\u043a\u0442\u0430\u0445 4.2 \u0438 4.3, \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b). \u0418\u0442\u0430\u043a, \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u041f\u0430\u0442\u0440\u0438\u043a\u0430, \u0431\u0435\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u043a\u0438 \u043d\u0435 \u00ab\u043f\u0440\u043e\u0439\u0434\u0435\u0442\u00bb. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430? \u0414\u0430, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437\u0443\u043a\u043e\u0440\u0438\u0437\u043d\u0435\u043d\u043d\u043e! \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 (\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043a\u043e\u0434\u0435 \u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 TVirtualClassVar). \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u00ab\u043e\u0447\u0438\u0449\u0435\u043d\u043d\u044b\u0439\u00bb \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">  type     TVirtualClassVar = class     end;     TVirtualClassVarClass = class of TVirtualClassVar;     PVirtualClassVar = ^TVirtualClassVar;      TVirtualClassVarObject = class     protected       class procedure PatchCodeDWORD(ACode: PDWORD; AValue: DWORD); static;       class function GetAddress(): PDWORD; inline;     protected       class function ClassGetClassInfo(): TVirtualClassVar; inline;     public       constructor Create(); overload; virtual;       destructor Destroy(); override;     public       class function GetClassInfo&lt;T: TVirtualClassVar&gt;(): T; overload;       class function GetClassInfo(): TVirtualClassVar; overload; inline;       class procedure SetClassInfo(const AClassInfo: TVirtualClassVar); inline;     end;     TVirtualClassVarObjectClass = class of TVirtualClassVarObject;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">constructor TVirtualClassVarObject.Create(); begin   inherited Create(); end;  destructor TVirtualClassVarObject.Destroy(); begin   inherited Destroy(); end;  class procedure TVirtualClassVarObject.PatchCodeDWORD(ACode: PDWORD; AValue: DWORD); var   ARestoreProtection: DWORD;   AIgnore: DWORD; begin \/\/ \u0421\u043d\u0438\u043c\u0430\u0435\u043c \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438.   if (VirtualProtect(ACode, System.SizeOf(ACode^), PAGE_EXECUTE_READWRITE, ARestoreProtection)) then     begin       ACode^ := AValue; \/\/ \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438.       VirtualProtect(ACode, System.SizeOf(ACode^), ARestoreProtection, AIgnore);       FlushInstructionCache(GetCurrentProcess, ACode, System.SizeOf(ACode^));     end; end;  class function TVirtualClassVarObject.GetAddress(): PDWORD; begin   Result := PDWORD(Integer(Self) + System.vmtAutoTable); end;  class function TVirtualClassVarObject.ClassGetClassInfo(): TVirtualClassVar; begin   Result := PVirtualClassVar(PInteger(Self)^ + System.vmtAutoTable)^; end;  class function TVirtualClassVarObject.GetClassInfo&lt;T&gt;(): T; begin   Result := (GetClassInfo() as T); end;  class function TVirtualClassVarObject.GetClassInfo(): TVirtualClassVar; begin   Result := PVirtualClassVar(Integer(Self) + System.vmtAutoTable)^; end;  class procedure TVirtualClassVarObject.SetClassInfo(const AClassInfo: TVirtualClassVar); var   AVirtualClassVar: TVirtualClassVar; begin   AVirtualClassVar := GetClassInfo();   if (AVirtualClassVar &lt;&gt; nil) then     begin       if (AVirtualClassVar.Equals(AClassInfo)) then exit;         PatchCodeDWORD(GetAddress(), DWORD(nil));         System.SysUtils.FreeAndNil(AVirtualClassVar);     end;   PatchCodeDWORD(GetAddress(), DWORD(AClassInfo)) end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 TVirtualClassVarObject.SetClassInfo(\u2026): \u0432 \u043d\u0435\u043c \u043c\u043d\u043e\u044e \u0431\u044b\u043b\u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u0443\u044f \u00ab\u0444\u0440\u0443\u043a\u0442\u043e\u0432\u0443\u044e \u0442\u0435\u043c\u0443\u00bb.<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 (\u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0436\u0434\u0435, \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u043c\u044f FInstanceName):<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">{$REGION 'TVirtualClassVarFruit'} TVirtualClassVarFruit = class(TVirtualClassVar) private     FInstanceName: string; protected   function GetName(): string; overload; virtual;   procedure SetName(const AValue: string); overload; virtual; public   constructor Create(const AName: string); overload; virtual;   destructor Destroy(); override; published     property InstanceName: string read GetName write SetName; end; TVirtualClassVarFruitClass = class of TVirtualClassVarFruit; {$ENDREGION 'TVirtualClassVarFruit'}<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">{$REGION 'TFruit'}  TFruit = class(TClassVarObject) protected   class function FruitClassInfo(): TVirtualClassVarFruit; inline;   class procedure RegisterClassInfo(); static; protected   class constructor Create(); public   constructor Create(); overload; virtual;   class function Name(): string; end;  TFruitClass = class of TFruit;  {$ENDREGION 'TFruit'}  {$REGION 'TApple'}  TApple = class(TFruit) public   constructor Create(); overload; override;   destructor Destroy(); override; end; TAppleClass = class of TApple;  {$ENDREGION 'TApple'}  {$REGION 'TOrange'}  TOrange = class(TFruit) end; TOrangeClass = class of TOrange;  {$ENDREGION 'TOrange'}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 (\u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e!):<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">{$REGION 'TVirtualClassVarFruit'}  constructor TVirtualClassVarFruit.Create(const AName: string); begin   inherited Create();   FInstanceName := AName; end;  destructor TVirtualClassVarFruit.Destroy(); begin   inherited Destroy(); end;  function TVirtualClassVarFruit.GetName(): string; begin   Result := FInstanceName; end;  procedure TVirtualClassVarFruit.SetName(const AValue: string); begin   FInstanceName := AValue; end;  {$ENDREGION 'TVirtualClassVarFruit'}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">{$REGION 'TFruit'}  class constructor TFruit.Create(); begin   TFruit.RegisterClassInfo(); end;  constructor TFruit.Create(); begin   inherited Create(); end;  class procedure TFruit.RegisterClassInfo(); begin   TFruit.SetClassInfo(TVirtualClassVarFruit.Create('\u0424\u0440\u0443\u043a\u0442\u044b'));   TApple.SetClassInfo(TVirtualClassVarFruit.Create('\u042f\u0431\u043b\u043e\u043a\u0438'));   TOrange.SetClassInfo(TVirtualClassVarFruit.Create('\u0410\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u044b'));   TApple.SetClassInfo(TVirtualClassVarFruit.Create('\u042f\u0431\u043b\u043e\u043a\u0438 2')); end;  class function TFruit.FruitClassInfo(): TVirtualClassVarFruit; begin   Result := (ClassGetClassInfo() as TVirtualClassVarFruit); end;  class function TFruit.Name(): string; begin   Result := System.SysUtils.format('%s: %s', [ClassName, FruitClassInfo().InstanceName]); end; {$ENDREGION 'TFruit'}  {$REGION 'TApple'} constructor TApple.Create(); begin   inherited Create(); end;  destructor TApple.Destroy(); begin   inherited Destroy(); end;  {$ENDREGION 'TApple'}<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">class constructor TFruit.Create(); begin   TFruit.RegisterClassInfo(); end; \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026 \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026 \u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026 class procedure TFruit.RegisterClassInfo(); begin   TFruit.SetClassInfo(TVirtualClassVarFruit.Create('\u0424\u0440\u0443\u043a\u0442\u044b'));   TApple.SetClassInfo(TVirtualClassVarFruit.Create('\u042f\u0431\u043b\u043e\u043a\u0438'));   TOrange.SetClassInfo(TVirtualClassVarFruit.Create('\u0410\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u044b'));   TApple.SetClassInfo(TVirtualClassVarFruit.Create('\u042f\u0431\u043b\u043e\u043a\u0438 2')); end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u2013 \u043d\u0435\u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e. \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430, \u0430, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0438 \u0432 \u0442\u0435\u043b\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (\u044d\u0442\u043e\u0433\u043e \u0432\u043e \u00ab\u0444\u0440\u0443\u043a\u0442\u043e\u0432\u043e\u043c\u00bb \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0445\u043e\u0442\u044f \u044f \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e: \u0441\u043c. \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435 TFruit.RegisterClassInfo). <\/p>\n<p>  <\/p>\n<p>G. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 (class property) \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0430? <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0435\u043b\u044c\u0437\u044f. \u041f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u0441\u0443\u0449\u0438\u0435 Object Pascal \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430. \u041e\u043d\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c!<\/p>\n<p>  <\/p>\n<p>H. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0442\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 \u2013 \u043e\u0431\u044a\u0435\u043a\u0442\u0430-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u00ab\u0447\u0438\u0441\u0442\u0443\u044e\u00bb \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430? \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0435\u0441\u044c\u043c\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e: \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u0432 4 \u0431\u0430\u0439\u0442\u0430 \u0434\u043b\u044f 32-\u0440\u0430\u0440\u044f\u0434\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u0432 8 \u0431\u0430\u0439\u0442 \u0434\u043b\u044f 64-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0439. \u0412 \u0446\u0435\u043b\u043e\u043c: \u00ab\u043e\u0432\u0447\u0438\u043d\u043a\u0430 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0434\u0435\u043b\u043a\u0438\u00bb!<\/p>\n<p>  <\/p>\n<p>I. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u00ab\u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00bb TBasicObject \u0438 TClassInfo? \u0427\u0442\u043e \u044f \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u044e? \u041f\u043e\u043b\u043e\u0436\u0438\u043c, \u043c\u044b \u0437\u0430\u0434\u0430\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">TVirtualClassVarObject&lt;TParentClass: \u0441lass, constructor&gt; = class(TParentClass)     .........     protected       class procedure PatchCodeDWORD(ACode: PDWORD; AValue: DWORD); static;       class function GetAddress(): PDWORD; inline;     protected       class function ClassGetClassInfo(): TVirtualClassVar; inline;     public       constructor Create(); overload; virtual;       destructor Destroy(); override;     public       class function GetClassInfo&lt;T: TVirtualClassVar&gt;(): T; overload;       class function GetClassInfo(): TVirtualClassVar; overload; inline;       class procedure SetClassInfo(const AClassInfo: TVirtualClassVar); inline; end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0438\u043b\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">    TVirtualClassVarObject&lt;TParentClass: TClass, constructor&gt; = class(TParentClass)     .........     protected       class procedure PatchCodeDWORD(ACode: PDWORD; AValue: DWORD); static;       class function GetAddress(): PDWORD; inline;     protected       class function ClassGetClassInfo(): TVirtualClassVar; inline;     public       constructor Create(); overload; virtual;       destructor Destroy(); override;     public       class function GetClassInfo&lt;T: TVirtualClassVar&gt;(): T; overload;       class function GetClassInfo(): TVirtualClassVar; overload; inline;       class procedure SetClassInfo(const AClassInfo: TVirtualClassVar); inline;     end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 TDesignate \u2013 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441):<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">TMyAppClass = class(TVirtualClassVarObject&lt;TDesignate&gt;) ....... ....... ....... end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0434\u0430\u043b\u0435\u0435, \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0431\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u0430 TMyAppClass \u043a\u0430\u043a \u043d\u0430\u043c \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0431\u044b \u043d\u0430\u043c \u044d\u0442\u043e\u0433\u043e \u043d\u0438 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u041f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0445 (\u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445) \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 Object Pascal \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">TMyGenericClass&lt;T: \u0441lass, constructor&gt; = class(T)     ......... end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f, \u0430 \u0435\u0441\u043b\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f? \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0445\u044d\u043b\u043f\u0435\u0440\u044b?<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e!<\/p>\n<p>  <\/p>\n<p>J. \u041a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0445\u044d\u043b\u043f\u0435\u0440\u044b?<\/p>\n<p>  <\/p>\n<p>\u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u043e\u043b\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u0430\u043a\u043e\u0433\u043e \u0445\u044d\u043b\u043f\u0435\u0440\u0430. <\/p>\n<p>  <\/p>\n<p>\u0415\u0433\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">THelperVirtualClassVarObject = class helper for TObject     protected       class procedure PatchCodeDWORD(ACode: PDWORD; AValue: DWORD); static;       class function GetAddress(): PDWORD; inline;     protected       class function ClassGetClassInfo(): TVirtualClassVar; inline;     public       class function GetClassVar&lt;T: TVirtualClassVar&gt;(): T; overload;       class function GetClassVar&lt;T: class, constructor;V: TVirtualClassVar&gt;(): V; overload;       class function GetClassVar(): TVirtualClassVar; overload; inline;       class procedure SetClassVar(const AClassInfo: TVirtualClassVar); inline; end;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"delphi\">{$REGION 'THelperVirtualClassVarObject'}  class procedure THelperVirtualClassVarObject.PatchCodeDWORD(ACode: PDWORD;  AValue: DWORD); var   ARestoreProtection: DWORD;   AIgnore: DWORD; begin \/\/ \u0421\u043d\u0438\u043c\u0430\u0435\u043c \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438.   if (VirtualProtect(ACode, System.SizeOf(ACode^), PAGE_EXECUTE_READWRITE, ARestoreProtection)) then     begin       ACode^ := AValue; \/\/ \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438.       VirtualProtect(ACode, System.SizeOf(ACode^), ARestoreProtection, AIgnore);       FlushInstructionCache(GetCurrentProcess, ACode, System.SizeOf(ACode^));     end; end;  class function THelperVirtualClassVarObject.GetAddress(): PDWORD; begin   Result := PDWORD(Integer(Self) + System.vmtAutoTable); end;  class function THelperVirtualClassVarObject.ClassGetClassInfo(): TVirtualClassVar; begin   Result := PVirtualClassVar(PInteger(Self)^ + System.vmtAutoTable)^; end;  class function THelperVirtualClassVarObject.GetClassVar&lt;T&gt;(): T; begin   Result := (GetClassVar() as T); end;  class function THelperVirtualClassVarObject.GetClassVar&lt;T, V&gt;(): V; begin   Result := (T.GetClassVar() as V); end;  class function THelperVirtualClassVarObject.GetClassVar(): TVirtualClassVar; begin   Result := PVirtualClassVar(Integer(Self) + System.vmtAutoTable)^; end;  class procedure THelperVirtualClassVarObject.SetClassVar(const AClassInfo: TVirtualClassVar); var   AVirtualClassVar: TVirtualClassVar; begin   AVirtualClassVar := GetClassVar();   if (AVirtualClassVar &lt;&gt; nil) then     begin       if (AVirtualClassVar.Equals(AClassInfo)) then exit;         PatchCodeDWORD(GetAddress(), DWORD(nil));         System.SysUtils.FreeAndNil(AVirtualClassVar);     end;   PatchCodeDWORD(GetAddress(), DWORD(AClassInfo)) end; {$ENDREGION 'THelperVirtualClassVarObject'}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443 \u043d\u0430\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u044d\u0442\u043e\u0442 \u0445\u044d\u043b\u043f\u0435\u0440, \u0438 \u0432\u0435\u0441\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! <\/p>\n<p>  <\/p>\n<p>K. \u0412\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 VCL-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 (Win32). \u0411\u0443\u0434\u0435\u0442 \u043b\u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445? <\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u0437\u043d\u0430\u044e. \u041d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b. \u0411\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u2026 <\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u041f\u0430\u0440\u0438\u0436 \u0441\u0442\u043e\u0438\u0442 \u043c\u0435\u0441\u0441\u044b, \u0442\u0430\u043a \u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f, \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d\u043d\u0430\u044f \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u043e\u043c \u0412\u0430\u0441\u0441\u0431\u043e\u0442\u043d\u043e\u043c, \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u043b\u044c\u0444\u0438\u0439\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<\/div>\n<p> \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\/504386\/\"> https:\/\/habr.com\/ru\/post\/504386\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/504386\/\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u043d\u0430\u0447\u0430\u043b \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u043c\u0435\u0442\u043a\u0443! \u0425\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0430\u043c (\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0444\u0430\u043d\u0430\u0442\u0430\u043c Object Pascal, \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0441\u043a\u0438\u0445 \u0442\u0440\u044e\u043a\u043e\u0432, \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432 \u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u0437\u044b\u0441\u043a\u043e\u0432) \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e (2007 \u0433\u043e\u0434\u0430) \u043f\u043e\u0441\u0442\u0430 <a href=\"http:\/\/hallvards.blogspot.com\/2007\/05\/hack17-virtual-class-variables-part-i.html\">&quot;Hack#17: Virtual class variables, Part I&quot;<\/a> \u0438 <a href=\"http:\/\/hallvards.blogspot.com\/2007\/05\/hack17-virtual-class-variables-part-ii.html\">&quot;Hack#17: Virtual class variables, Part II&quot;<\/a> \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u0430\u0432\u0442\u043e\u0440\u0430 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 Delphi, \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u0412\u0430\u0441\u0441\u0431\u043e\u0442\u043d\u0430 (Hallvard Vassbotn). <\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0425\u0430\u043b\u043b\u0432\u0430\u0440\u0434\u0430 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439\u0448\u0438\u0445 \u0442\u0435\u043c \u2013 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438 \u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u0445 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u0432\u044b \u043e\u043a\u0430\u0436\u0435\u0442\u0435\u0441\u044c \u043f\u0440\u0430\u0432\u044b, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e.<br \/>  \u0420\u0435\u0447\u044c \u0432 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u043e <strong>class virtual var<\/strong>, \u043f\u043e-\u0440\u0443\u0441\u0441\u043a\u0438 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u043e\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0437\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0430 (\u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u043e \u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430). \u0412\u044b \u0441\u043a\u0430\u0436\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 Object Pascal\u2019\u0435 \u043d\u0435\u0442, \u0438 \u043e\u043a\u0430\u0436\u0435\u0442\u0435\u0441\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u0430\u0432\u044b\u043c\u0438. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u044f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0437\u043d\u0430\u0442\u043e\u043a\u0438 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u041e\u041e-\u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u044f\u0432\u044f\u0442: \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044f \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b, \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e. \u041a\u0430\u043a \u0438 \u0432\u0441\u0435 \u044f \u00ab\u0441\u0443\u0441\u043b\u0438\u043a\u0430 \u043d\u0435 \u0432\u0438\u0436\u0443\u2026\u00bb, \u043d\u043e \u0431\u0443\u0434\u0443 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0418 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0439\u0434\u0435\u0442 \u0432 \u0440\u0435\u0447\u044c \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u0432\u0430\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430.<\/p>\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-304476","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304476","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=304476"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304476\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}