<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://blogs.forum.nokia.com/styles/rss.css" type="text/css"?>
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/">
 <channel>
  <title>Paul Todd's Forum Nokia Blog - Use and abuse of Symbian idioms</title>
  <description>Forum Nokia Blogs</description>
  <link>http://blogs.forum.nokia.com/summary.php</link>
 </channel>
    <item>
     
   <title></title>
   <description>/me raises hand.&lt;br /&gt;&lt;br /&gt;I fixed a bug like this from my code just five minutes ago :)</description>
   <link>http://blogs.forum.nokia.com/blog/paul-todds-forum-nokia-blog/2007/04/02/use-and-abuse-of-symbian-idioms#comment1351</link>
  </item>
    <item>
     
   <title></title>
   <description>RClasses as an idiom work quite well for real resources or references to objects owned by other threads. But are pretty confusing when used as datastructures.&lt;br /&gt;&lt;br /&gt;The general rule of R classes is that you should never &amp;quot;new&amp;quot; them since it should be possible to copy R classes by value. As an example and RString is a handle to a real string owned by an RStringPool object - so copying the RString would mean copying just the handle and not the whole string.&lt;br /&gt;However, there are many exceptions to this rule in Symbian OS.&lt;br /&gt;&lt;br /&gt;Here is where it gets confusing:&lt;br /&gt;&lt;br /&gt;If you have RArray&amp;lt;TInt&amp;gt; a;&lt;br /&gt;a.Append(12);&lt;br /&gt;RArray&amp;lt;TInt&amp;gt; b= a;&lt;br /&gt;a.Close()&lt;br /&gt;RDebug::Print(&amp;quot;%D&amp;quot;,b[1]); &amp;lt;---- Does this work?&lt;br /&gt;&lt;br /&gt;Is b still a valid copy? I.e was the RArray contents reference counted.&lt;br /&gt;&lt;br /&gt;In my view Symbian should have used R classes only for things which derive from RHandleBase and have a clear policy for duplication and sharing accross threads and processes.&lt;br /&gt;Other classes which use R prefix are usually just proxy/pimpl objects.&lt;br /&gt;&lt;br /&gt;Another one to watch out for is:&lt;br /&gt;RPointerArray - You must call ResetAndDestroy() before the call to Close() if you want all the objects delete. Close() only deletes the memory allocated to the container.</description>
   <link>http://blogs.forum.nokia.com/blog/paul-todds-forum-nokia-blog/2007/04/02/use-and-abuse-of-symbian-idioms#comment1350</link>
  </item>
  </rdf:RDF>