<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://library.morph.zone/index.php?action=history&amp;feed=atom&amp;title=Przeci%C4%85%C5%BCanie_metody_OM_SET%28%29</id>
		<title>Przeciążanie metody OM SET() - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://library.morph.zone/index.php?action=history&amp;feed=atom&amp;title=Przeci%C4%85%C5%BCanie_metody_OM_SET%28%29"/>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;action=history"/>
		<updated>2026-05-12T04:50:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1203&amp;oldid=prev</id>
		<title>Krashan: Translation finished.</title>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1203&amp;oldid=prev"/>
				<updated>2011-01-26T07:44:24Z</updated>
		
		<summary type="html">&lt;p&gt;Translation finished.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 07:44, 26 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l49&quot; &gt;Line 49:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 49:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;small&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;In some rare cases a subclass may want to override an attribute completely&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;so it is not passed &lt;/del&gt;to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;superclasses. This can be done by replacing the tag (not value!) by &lt;/del&gt;''TAG_IGNORE''. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;There is one caveat however&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;In most cases in &lt;/del&gt;C &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;and &lt;/del&gt;C++&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, the taglist is built dynamically on the stack from variable arguments of a function like &lt;/del&gt;''SetAttrs()''. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;It is possible however&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;that a taglist is a static object &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;for example a global one&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;or created in an allocated chunk of free memory&lt;/del&gt;). &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;In this case changing a tag is a &lt;/del&gt;'''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;permanent&lt;/del&gt;''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;operation&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;which may have unexpected results&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;This remark also applies for changing a value of a tag before passing it to a superclass&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;A safe solution is to clone the taglist with the &lt;/del&gt;''CloneTagItems()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;function from the &lt;/del&gt;''utility.library''. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Then changes are made in the copy and this copy is passed to the superclass&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The copy is then freed with &lt;/del&gt;''FreeTagItems()''. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The disadvantage of this solution is that cloning a taglist may fail due to lack of free memory and this possibility must be handled somehow&lt;/del&gt;.&amp;lt;/small&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;small&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;W rzadkich przypadkach klasa pochodna może chcieć całkowicie przejąć jakiś atrybut, tak&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;aby nie był wysłany do klas nadrzędnych. Można &lt;/ins&gt;to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zrobić zastępując identyfikator atrybutu w tagliście przez &lt;/ins&gt;''TAG_IGNORE''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Jest tu jednak pewien haczyk&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Najczęściej w &lt;/ins&gt;C &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;i &lt;/ins&gt;C++ &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;taglista tworzona jest dynamicznie na stosie procesu z argumentów funkcji (np. &lt;/ins&gt;''SetAttrs()''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Jest jednak możliwe&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;że taglista będzie obiektem statycznym &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;na przykład globalnym&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;albo stworzonym w zaalokowanym bloku pamięci&lt;/ins&gt;). &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;W tym przypadku zmiana taga na ''TAG_IGNORE'' będzie operacją &lt;/ins&gt;'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;trwałą&lt;/ins&gt;''', &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;co może skutkować nieoczekiwanymi efektami&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Uwaga ta dotyczy również zmiany '''wartości''' atrybutu, przed przekazaniem taglisty klasie nadrzędnej&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Bezpiecznym rozwiązaniem jest sklonowanie taglisty funkcją &lt;/ins&gt;''CloneTagItems()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;z &lt;/ins&gt;''utility.library''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Następnie dokonuje się zmian w otrzymanej kopii i kopię tę przekazuje klasie nadrzędnej&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Po powrocie z ''DoSuperMethodA()'' kopię zwalnia się wywołując funkcję &lt;/ins&gt;''FreeTagItems()''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Wadą tego rozwiązania jest możliwość wystąpienia błędu przy klonowaniu taglisty z powodu braku pamięci. Możliwość tę trzeba jakoś obsłużyć w kodzie&lt;/ins&gt;.&amp;lt;/small&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Krashan</name></author>	</entry>

	<entry>
		<id>https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1201&amp;oldid=prev</id>
		<title>Krashan: Translation in progress.</title>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1201&amp;oldid=prev"/>
				<updated>2011-01-26T07:32:36Z</updated>
		
		<summary type="html">&lt;p&gt;Translation in progress.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 07:32, 26 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot; &gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  break;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  break;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  /* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;more tags here &lt;/del&gt;*/&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  /* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;inne atrybuty &lt;/ins&gt;*/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot; &gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The taglist iteration is done with the &lt;/del&gt;''NextTagItem()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;function from the &lt;/del&gt;utility.library. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The function returns a pointer to the next tag each time it is called and keeps the current position in &lt;/del&gt;''tagptr''. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The advantage of this function is automatic handling of special tag values &lt;/del&gt;(''TAG_MORE'', ''TAG_IGNORE'', ''TAG_SKIP''), &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;they are not returned&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;but their actions are performed instead&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Taglista jest iterowana za pomocą funkcji &lt;/ins&gt;''NextTagItem()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;z ''&lt;/ins&gt;utility.library&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Przy każdym wywołaniu funkcja zwraca wskaźnik na kolejny element taglisty. Aktualna pozycja pamiętana jest w zmiennej &lt;/ins&gt;''tagptr''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Zaletą użycia tej funkcji jest automatyczna obsługa tagów specjalnych &lt;/ins&gt;(''TAG_MORE'', ''TAG_IGNORE'', ''TAG_SKIP''), &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;nie są one zwracane jako kolejne elementy&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;za to wykonywane są odpowiadające im operacje&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The &lt;/del&gt;''OM_SET()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;function returns the total number of recognized tags&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;It is implemented with &lt;/del&gt;''tagcounter''. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;It gets incremented on every tag recognized and finally the number of tags recognized by superclass(es) is added&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Metoda &lt;/ins&gt;''OM_SET()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;powinna jako wynik zwracać łączną ilość rozpoznanych i ustawionych atrybutów&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Ich zliczanie odbywa się w zmiennej &lt;/ins&gt;''tagcounter''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Zmienna jest zwiększana o 1 przy każdym rozpoznanym tagu, a następnie powiększana o ilość atrybutów rozpoznanych w klasach nadrzędnych&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Common bugs in &lt;/del&gt;''OM_SET()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;implementation are&lt;/del&gt;: &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ignoring tag counting and calling the super method in the &lt;/del&gt;''default'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;case of a &lt;/del&gt;''switch'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;statement&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The second bug causes the supermethod &lt;/del&gt;to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;be called multiple times, once for every tag not handled by the subclass&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Typowe błędy w implementacji &lt;/ins&gt;''OM_SET()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* zignorowanie zliczania rozpoznanych atrybutów,&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* wywoływanie metody w klasie nadrzędnej w przypadku &lt;/ins&gt;''default'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;wyrażenia &lt;/ins&gt;''switch''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Powoduje &lt;/ins&gt;to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;wywołanie metody w klasie nadrzędniej tyle razy ile jest w tagliście atrybutów nierozpoznanych przez klasę (zamiast raz)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;small&amp;gt;In some rare cases a subclass may want to override an attribute completely, so it is not passed to superclasses. This can be done by replacing the tag (not value!) by ''TAG_IGNORE''. There is one caveat however. In most cases in C and C++, the taglist is built dynamically on the stack from variable arguments of a function like ''SetAttrs()''. It is possible however, that a taglist is a static object (for example a global one, or created in an allocated chunk of free memory). In this case changing a tag is a '''permanent''' operation, which may have unexpected results. This remark also applies for changing a value of a tag before passing it to a superclass. A safe solution is to clone the taglist with the ''CloneTagItems()'' function from the ''utility.library''. Then changes are made in the copy and this copy is passed to the superclass. The copy is then freed with ''FreeTagItems()''. The disadvantage of this solution is that cloning a taglist may fail due to lack of free memory and this possibility must be handled somehow.&amp;lt;/small&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;small&amp;gt;In some rare cases a subclass may want to override an attribute completely, so it is not passed to superclasses. This can be done by replacing the tag (not value!) by ''TAG_IGNORE''. There is one caveat however. In most cases in C and C++, the taglist is built dynamically on the stack from variable arguments of a function like ''SetAttrs()''. It is possible however, that a taglist is a static object (for example a global one, or created in an allocated chunk of free memory). In this case changing a tag is a '''permanent''' operation, which may have unexpected results. This remark also applies for changing a value of a tag before passing it to a superclass. A safe solution is to clone the taglist with the ''CloneTagItems()'' function from the ''utility.library''. Then changes are made in the copy and this copy is passed to the superclass. The copy is then freed with ''FreeTagItems()''. The disadvantage of this solution is that cloning a taglist may fail due to lack of free memory and this possibility must be handled somehow.&amp;lt;/small&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Krashan</name></author>	</entry>

	<entry>
		<id>https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1198&amp;oldid=prev</id>
		<title>Krashan: Translation in progress.</title>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1198&amp;oldid=prev"/>
				<updated>2011-01-26T07:13:25Z</updated>
		
		<summary type="html">&lt;p&gt;Translation in progress.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 07:13, 26 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot; &gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; };&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; };&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The most important field is &lt;/del&gt;''ops_AttrList''. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;It is a pointer to a &lt;/del&gt;[[Taglists|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;taglist&lt;/del&gt;]] &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;containing attributes and values to be set&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The &lt;/del&gt;''ops_GInfo'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;field is an obsolete legacy thing and is not used by modern components like &lt;/del&gt;MUI &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;or &lt;/del&gt;Reggae. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The method implementation should iterate the taglist and set all attributes recognized&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The operation of setting an attribute may be just setting some field in an object instance data&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;it may also trigger some actions &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;like for example object redrawing&lt;/del&gt;). &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;It is recommended however that complex actions are implemented as methods rather than attribute changes&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;A reference implementation of &lt;/del&gt;''OM_SET()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;may look like this&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Najważniejszym polem struktury jest &lt;/ins&gt;''ops_AttrList''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Mieści ono w sobie wskaźnik do &lt;/ins&gt;[[Taglists|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;taglisty&lt;/ins&gt;]] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zawierającej atrybuty i ich wartości do ustawienia w obiekcie&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Pole &lt;/ins&gt;''ops_GInfo'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;jest historyczną pozostałością i nie jest używane przez nowoczesne elementy systemu takie jak &lt;/ins&gt;MUI&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, czy &lt;/ins&gt;Reggae. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Implementacja metody ''OM_SET()'' powinna przejrzeć po kolei całą taglistę i ustawić wszystkie rozpoznane atrybuty&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Operacja ustawienia atrybutu może się sprowadzać do ustawienia jakiejś wartości w danych obiektu&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;może też uruchamiać jakieś akcje &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;na przykład odrysowanie obiektu&lt;/ins&gt;). &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Zaleca się jednak, aby bardziej złożone akcje implementować raczej jako metody niż zmiany atrybutu&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Wzorcowa metoda &lt;/ins&gt;''OM_SET()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;może wyglądać następująco&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; IPTR MyClassSet(Class *cl, Object *obj, struct opSet *msg)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; IPTR MyClassSet(Class *cl, Object *obj, struct opSet *msg)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l27&quot; &gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  case SOME_TAG:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  case SOME_TAG:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160;  /* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;attribute setting actions for &lt;/del&gt;SOME_TAG */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160;  /* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;kod zmieniający atrybut &lt;/ins&gt;SOME_TAG */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160;  tagcount++;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160;  tagcount++;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  break;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  break;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Krashan</name></author>	</entry>

	<entry>
		<id>https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1197&amp;oldid=prev</id>
		<title>Krashan: Translation in progress.</title>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1197&amp;oldid=prev"/>
				<updated>2011-01-26T07:02:50Z</updated>
		
		<summary type="html">&lt;p&gt;Translation in progress.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 07:02, 26 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The &lt;/del&gt;''OM_SET()'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;method receives an &lt;/del&gt;''opSet'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;structure as its message&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The structure is defined in the &lt;/del&gt;''&amp;lt;intuition/classusr.h&amp;gt;'' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;header&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Metoda &lt;/ins&gt;''OM_SET()'' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;jako strukturę parametrów otrzymuje strukturę &lt;/ins&gt;''opSet''. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Jest ona zdefiniowana w pliku nagłówkowym &lt;/ins&gt;''&amp;lt;intuition/classusr.h&amp;gt;''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; struct opSet&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; struct opSet&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  ULONG&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; MethodID;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; /* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;always &lt;/del&gt;OM_SET (0x103) */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  ULONG&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; MethodID;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; /* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zawsze &lt;/ins&gt;OM_SET (0x103) */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  struct TagItem&amp;#160; &amp;#160; *ops_AttrList;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  struct TagItem&amp;#160; &amp;#160; *ops_AttrList;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  struct GadgetInfo *ops_GInfo;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  struct GadgetInfo *ops_GInfo;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Krashan</name></author>	</entry>

	<entry>
		<id>https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1196&amp;oldid=prev</id>
		<title>Krashan: Translation started.</title>
		<link rel="alternate" type="text/html" href="https://library.morph.zone/index.php?title=Przeci%C4%85%C5%BCanie_metody_OM_SET()&amp;diff=1196&amp;oldid=prev"/>
				<updated>2011-01-26T06:55:04Z</updated>
		
		<summary type="html">&lt;p&gt;Translation started.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;''Grzegorz Kraszewski''&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;small&amp;gt;Ten artykuł w innych językach: [[Overriding OM_SET()|angielski]]&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ''OM_SET()'' method receives an ''opSet'' structure as its message. The structure is defined in the ''&amp;lt;intuition/classusr.h&amp;gt;'' header.&lt;br /&gt;
&lt;br /&gt;
 struct opSet&lt;br /&gt;
 {&lt;br /&gt;
   ULONG              MethodID;            /* always OM_SET (0x103) */&lt;br /&gt;
   struct TagItem    *ops_AttrList;&lt;br /&gt;
   struct GadgetInfo *ops_GInfo;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The most important field is ''ops_AttrList''. It is a pointer to a [[Taglists|taglist]] containing attributes and values to be set. The ''ops_GInfo'' field is an obsolete legacy thing and is not used by modern components like MUI or Reggae. The method implementation should iterate the taglist and set all attributes recognized. The operation of setting an attribute may be just setting some field in an object instance data, it may also trigger some actions (like for example object redrawing). It is recommended however that complex actions are implemented as methods rather than attribute changes. A reference implementation of ''OM_SET()'' may look like this:&lt;br /&gt;
&lt;br /&gt;
 IPTR MyClassSet(Class *cl, Object *obj, struct opSet *msg)&lt;br /&gt;
 {&lt;br /&gt;
   struct TagItem *tag, *tagptr;&lt;br /&gt;
   IPTR tagcount = 0;&lt;br /&gt;
 &lt;br /&gt;
   tagptr = msg-&amp;gt;ops_AttrList;&lt;br /&gt;
 &lt;br /&gt;
   while ((tag = '''NextTagItem'''(&amp;amp;tagptr)) != NULL)&lt;br /&gt;
   {&lt;br /&gt;
     switch (tag-&amp;gt;ti_Tag)&lt;br /&gt;
     {&lt;br /&gt;
       case SOME_TAG:&lt;br /&gt;
         /* attribute setting actions for SOME_TAG */&lt;br /&gt;
         tagcount++;&lt;br /&gt;
       break;&lt;br /&gt;
 &lt;br /&gt;
       /* more tags here */&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   tagcount += '''DoSuperMethodA'''(cl, obj, (Msg)msg);&lt;br /&gt;
   return tagcount;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The taglist iteration is done with the ''NextTagItem()'' function from the utility.library. The function returns a pointer to the next tag each time it is called and keeps the current position in ''tagptr''. The advantage of this function is automatic handling of special tag values (''TAG_MORE'', ''TAG_IGNORE'', ''TAG_SKIP''), they are not returned, but their actions are performed instead.&lt;br /&gt;
&lt;br /&gt;
The ''OM_SET()'' function returns the total number of recognized tags. It is implemented with ''tagcounter''. It gets incremented on every tag recognized and finally the number of tags recognized by superclass(es) is added.&lt;br /&gt;
&lt;br /&gt;
Common bugs in ''OM_SET()'' implementation are: ignoring tag counting and calling the super method in the ''default'' case of a ''switch'' statement. The second bug causes the supermethod to be called multiple times, once for every tag not handled by the subclass.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;small&amp;gt;In some rare cases a subclass may want to override an attribute completely, so it is not passed to superclasses. This can be done by replacing the tag (not value!) by ''TAG_IGNORE''. There is one caveat however. In most cases in C and C++, the taglist is built dynamically on the stack from variable arguments of a function like ''SetAttrs()''. It is possible however, that a taglist is a static object (for example a global one, or created in an allocated chunk of free memory). In this case changing a tag is a '''permanent''' operation, which may have unexpected results. This remark also applies for changing a value of a tag before passing it to a superclass. A safe solution is to clone the taglist with the ''CloneTagItems()'' function from the ''utility.library''. Then changes are made in the copy and this copy is passed to the superclass. The copy is then freed with ''FreeTagItems()''. The disadvantage of this solution is that cloning a taglist may fail due to lack of free memory and this possibility must be handled somehow.&amp;lt;/small&amp;gt;&lt;/div&gt;</summary>
		<author><name>Krashan</name></author>	</entry>

	</feed>