diff options
Diffstat (limited to 'html/055shape_shifting_container.cc.html')
-rw-r--r-- | html/055shape_shifting_container.cc.html | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/html/055shape_shifting_container.cc.html b/html/055shape_shifting_container.cc.html index f394ba8b..cbef525e 100644 --- a/html/055shape_shifting_container.cc.html +++ b/html/055shape_shifting_container.cc.html @@ -239,15 +239,15 @@ if ('onhashchange' in window) { <span id="L173" class="LineNr">173 </span> <span class="Delimiter">}</span> <span id="L174" class="LineNr">174 </span> <span class="Comment">// we haven't seen this container before</span> <span id="L175" class="LineNr">175 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> name<span class="Delimiter">)</span> || get<span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> name<span class="Delimiter">)</span> == <span class="Constant">0</span><span class="Delimiter">)</span> -<span id="L176" class="LineNr">176 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> name<span class="Delimiter">,</span> Next_type_ordinal++<span class="Delimiter">);</span> -<span id="L177" class="LineNr">177 </span> type_info& info = <a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Type<span class="Delimiter">,</span> get<span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> name<span class="Delimiter">));</span> +<span id="L176" class="LineNr">176 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> name<span class="Delimiter">,</span> Next_type_ordinal++<span class="Delimiter">);</span> +<span id="L177" class="LineNr">177 </span> type_info& info = <a href='001help.cc.html#L228'>get_or_insert</a><span class="Delimiter">(</span>Type<span class="Delimiter">,</span> get<span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> name<span class="Delimiter">));</span> <span id="L178" class="LineNr">178 </span> info<span class="Delimiter">.</span>type_ingredient_names<span class="Delimiter">.</span>swap<span class="Delimiter">(</span>type_ingredient_names<span class="Delimiter">);</span> <span id="L179" class="LineNr">179 </span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L180" class="LineNr">180 </span><span class="Delimiter">}</span> <span id="L181" class="LineNr">181 </span> <span id="L182" class="LineNr">182 </span><span class="Normal">bool</span> slurp_type_ingredients<span class="Delimiter">(</span>istream& in<span class="Delimiter">,</span> map<string<span class="Delimiter">,</span> type_ordinal>& out<span class="Delimiter">,</span> <span class="Normal">const</span> string& container_name<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L183" class="LineNr">183 </span> <span class="Normal">int</span> next_type_ordinal = START_TYPE_INGREDIENTS<span class="Delimiter">;</span> -<span id="L184" class="LineNr">184 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L184" class="LineNr">184 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='001help.cc.html#L238'>has_data</a><span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L185" class="LineNr">185 </span> <span class="Conceal">¦</span> string curr = slurp_until<span class="Delimiter">(</span>in<span class="Delimiter">,</span> <span class="Constant">':'</span><span class="Delimiter">);</span> <span id="L186" class="LineNr">186 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>curr<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L187" class="LineNr">187 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << container_name << <span class="Constant">": empty type ingredients not permitted</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> @@ -261,13 +261,13 @@ if ('onhashchange' in window) { <span id="L195" class="LineNr">195 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << container_name << <span class="Constant">": can't repeat type ingredient name'"</span> << curr << <span class="Constant">"' in a single container definition</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L196" class="LineNr">196 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L197" class="LineNr">197 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> -<span id="L198" class="LineNr">198 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>out<span class="Delimiter">,</span> curr<span class="Delimiter">,</span> next_type_ordinal++<span class="Delimiter">);</span> +<span id="L198" class="LineNr">198 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>out<span class="Delimiter">,</span> curr<span class="Delimiter">,</span> next_type_ordinal++<span class="Delimiter">);</span> <span id="L199" class="LineNr">199 </span> <span class="Delimiter">}</span> <span id="L200" class="LineNr">200 </span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L201" class="LineNr">201 </span><span class="Delimiter">}</span> <span id="L202" class="LineNr">202 </span> <span id="L203" class="LineNr">203 </span><span class="Normal">bool</span> type_ingredients_match<span class="Delimiter">(</span><span class="Normal">const</span> map<string<span class="Delimiter">,</span> type_ordinal>& a<span class="Delimiter">,</span> <span class="Normal">const</span> map<string<span class="Delimiter">,</span> type_ordinal>& b<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L204" class="LineNr">204 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>a<span class="Delimiter">)</span> != <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>b<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L204" class="LineNr">204 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>a<span class="Delimiter">)</span> != <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>b<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L205" class="LineNr">205 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<string<span class="Delimiter">,</span> type_ordinal>::const_iterator p = a<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != a<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L206" class="LineNr">206 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>b<span class="Delimiter">,</span> p<span class="Delimiter">-></span>first<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L207" class="LineNr">207 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>p<span class="Delimiter">-></span>second != get<span class="Delimiter">(</span>b<span class="Delimiter">,</span> p<span class="Delimiter">-></span>first<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> @@ -282,12 +282,12 @@ if ('onhashchange' in window) { <span id="L216" class="LineNr">216 </span><span class="Delimiter">}</span> <span id="L217" class="LineNr">217 </span><span class="Delimiter">:(code)</span> <span id="L218" class="LineNr">218 </span><span class="Normal">bool</span> is_type_ingredient_name<span class="Delimiter">(</span><span class="Normal">const</span> string& type<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L219" class="LineNr">219 </span> <span class="Identifier">return</span> <a href='001help.cc.html#L74'>starts_with</a><span class="Delimiter">(</span>type<span class="Delimiter">,</span> <span class="Constant">"_"</span><span class="Delimiter">);</span> +<span id="L219" class="LineNr">219 </span> <span class="Identifier">return</span> <a href='001help.cc.html#L77'>starts_with</a><span class="Delimiter">(</span>type<span class="Delimiter">,</span> <span class="Constant">"_"</span><span class="Delimiter">);</span> <span id="L220" class="LineNr">220 </span><span class="Delimiter">}</span> <span id="L221" class="LineNr">221 </span> <span id="L222" class="LineNr">222 </span><span class="Delimiter">:(before "End Container Type Checks")</span> <span id="L223" class="LineNr">223 </span><span class="Normal">if</span> <span class="Delimiter">(</span>type<span class="Delimiter">-></span>value >= START_TYPE_INGREDIENTS -<span id="L224" class="LineNr">224 </span> <span class="Conceal">¦</span> && <span class="Delimiter">(</span>type<span class="Delimiter">-></span>value - START_TYPE_INGREDIENTS<span class="Delimiter">)</span> < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> type<span class="Delimiter">-></span>value<span class="Delimiter">).</span>type_ingredient_names<span class="Delimiter">))</span> +<span id="L224" class="LineNr">224 </span> <span class="Conceal">¦</span> && <span class="Delimiter">(</span>type<span class="Delimiter">-></span>value - START_TYPE_INGREDIENTS<span class="Delimiter">)</span> < <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> type<span class="Delimiter">-></span>value<span class="Delimiter">).</span>type_ingredient_names<span class="Delimiter">))</span> <span id="L225" class="LineNr">225 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L226" class="LineNr">226 </span> <span id="L227" class="LineNr">227 </span><span class="Delimiter">:(scenario size_of_shape_shifting_exclusive_container)</span> @@ -702,10 +702,10 @@ if ('onhashchange' in window) { <span id="L636" class="LineNr">636 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:foo:&:num"</span><span class="Delimiter">);</span> <span id="L637" class="LineNr">637 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> <span id="L638" class="LineNr">638 </span> compute_container_address_offsets<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> -<span id="L639" class="LineNr">639 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L639" class="LineNr">639 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> <span id="L640" class="LineNr">640 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">()));</span> <span id="L641" class="LineNr">641 </span> set<address_element_info>& offset_info = get<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">());</span> -<span id="L642" class="LineNr">642 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L642" class="LineNr">642 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> <span id="L643" class="LineNr">643 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span>offset<span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">);</span> <span class="Comment">//</span> <span id="L644" class="LineNr">644 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>atom<span class="Delimiter">);</span> <span id="L645" class="LineNr">645 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>name<span class="Delimiter">,</span> <span class="Constant">"number"</span><span class="Delimiter">);</span> @@ -724,10 +724,10 @@ if ('onhashchange' in window) { <span id="L658" class="LineNr">658 </span> <a href='003trace.cc.html#L158'>CLEAR_TRACE</a><span class="Delimiter">;</span> <span id="L659" class="LineNr">659 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> <span id="L660" class="LineNr">660 </span> compute_container_address_offsets<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> -<span id="L661" class="LineNr">661 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L661" class="LineNr">661 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> <span id="L662" class="LineNr">662 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">()));</span> <span id="L663" class="LineNr">663 </span> set<address_element_info>& offset_info = get<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">());</span> -<span id="L664" class="LineNr">664 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">),</span> <span class="Constant">2</span><span class="Delimiter">);</span> +<span id="L664" class="LineNr">664 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">),</span> <span class="Constant">2</span><span class="Delimiter">);</span> <span id="L665" class="LineNr">665 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span>offset<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> <span class="Comment">//</span> <span id="L666" class="LineNr">666 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>atom<span class="Delimiter">);</span> <span id="L667" class="LineNr">667 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>name<span class="Delimiter">,</span> <span class="Constant">"number"</span><span class="Delimiter">);</span> |