<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - T, C, R, M classes - Comments</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html</link>
 <description>Comments for &quot;T, C, R, M classes&quot;</description>
 <language>en</language>
<item>
 <title>Re: T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-47267</link>
 <description>&lt;p&gt;this is an xlent tutorial which can be easily followed by any new bie just like me....thanks a lot...keep teaching till we write our own GUI prgrams...thanks in advance.&lt;/p&gt;</description>
 <pubDate>Tue, 01 Jul 2008 20:49:55 +0200</pubDate>
 <dc:creator>bosedayala</dc:creator>
 <guid isPermaLink="false">comment 47267 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-41478</link>
 <description>&lt;p&gt; outstanding the only word to describe the explanation.&lt;br /&gt;
 rakesh&lt;/p&gt;</description>
 <pubDate>Fri, 14 Sep 2007 13:30:10 +0200</pubDate>
 <dc:creator>rakesh</dc:creator>
 <guid isPermaLink="false">comment 41478 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-41311</link>
 <description>&lt;p&gt;Very good article.But all of you expert should have to write in detail about M class .&lt;br /&gt;
Can M class have a destructor or virtual destructor?&lt;br /&gt;
If yes in which condition we have to declare a destructor in M class and why&lt;/p&gt;</description>
 <pubDate>Fri, 07 Sep 2007 06:52:33 +0200</pubDate>
 <dc:creator>knsinha</dc:creator>
 <guid isPermaLink="false">comment 41311 at http://www.newlc.com</guid>
</item>
<item>
 <title>Thank u for ur amended</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-2873</link>
 <description>&lt;p&gt;Thank u for ur amended version. Now I&#039;ve got started here. And I am sure all of guys here will be great help to me. &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br /&gt;
Good luck to everyone!&lt;/p&gt;</description>
 <pubDate>Wed, 09 May 2007 09:18:02 +0200</pubDate>
 <dc:creator>soulark</dc:creator>
 <guid isPermaLink="false">comment 2873 at http://www.newlc.com</guid>
</item>
<item>
 <title>c object is created on heap</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-9</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;hi ,
AS per article mentioned that a C object is created on Heap is confusing me ,&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;if 
CMyObj  *obj = new(Eleave) CMyObj;&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;In the above statement the obj pointer is placed on stack and memory allcated by the CMyObj is on heap.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;So we can now conclude that C Class object is located on heap only if iam wrong correct me&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 19 Mar 2007 06:14:17 +0100</pubDate>
 <dc:creator>kishore</dc:creator>
 <guid isPermaLink="false">comment 9 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-8</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;Thats So simple, because HBufC is used to allocate memory on Heap, It starts with H...&lt;/div&gt;</description>
 <pubDate>Thu, 18 Jan 2007 03:41:21 +0100</pubDate>
 <dc:creator>Inder</dc:creator>
 <guid isPermaLink="false">comment 8 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-14</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;This Bit of Information is pretty good for understanding the Basics of C classes, 
Thanks&lt;/div&gt;</description>
 <pubDate>Wed, 17 Jan 2007 11:54:50 +0100</pubDate>
 <dc:creator>Inder</dc:creator>
 <guid isPermaLink="false">comment 14 at http://www.newlc.com</guid>
</item>
<item>
 <title>T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-4</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;Simply excellent. Great job Eric and totE...&lt;/div&gt;</description>
 <pubDate>Thu, 11 Jan 2007 06:47:45 +0100</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 4 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-7</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;I have read many books but it was not so clear. This is an excellent article. Thanks a ton for Eric and totk.&lt;/div&gt;</description>
 <pubDate>Thu, 11 Jan 2007 06:44:45 +0100</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 7 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-6</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;Why HBufC is started with H?&lt;/div&gt;</description>
 <pubDate>Tue, 19 Sep 2006 08:17:44 +0200</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 6 at http://www.newlc.com</guid>
</item>
<item>
 <title>T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-3</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;This article is really good....
Not confusing, simple and understandable to a Newbie like me too...
others can include their views like toTE did, since people like me learn
a lot from the replys also...&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;great job... keep it up...&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 06 Mar 2006 11:22:06 +0100</pubDate>
 <dc:creator>kk</dc:creator>
 <guid isPermaLink="false">comment 3 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-2</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;A few important things are missing from here.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;A T class is not only a typedef. Generally, you should use a T class whenever you have a &#039;flat&#039; class. Flat means that your class does not own and maintain any externally allocated objects - i.e. it does not have pointer data members. Even if it has, then it must not be responsible for deleting it.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;It&#039;s like:&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;&lt;tt&gt;&lt;div align=&#039;left&#039; class=&#039;spip_code&#039; dir=&#039;ltr&#039;&gt;class TFlatClass&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;public: // constructor&lt;br /&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TFlatClass( TInt aSomething );&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;public: // data members&lt;br /&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TInt iSomething;&lt;br /&gt;
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TPtrC iString;&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;};&lt;/div&gt;&lt;/tt&gt;&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;From the example above you can see that a T class may have a constructor (or more). Actually it may have a destructor too, but is it worth when no externally allocated objects are maintained? It&#039;s important to know that T classes are usually small in size. And that&#039;s the reason why you&#039;re encouraged to use them from stack.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;Then C classes: you forgot to mention two important things. First, the constructor of CBase takes care of initializing your data members to zero. That is, you don&#039;t have to assign 0 or NULL to your data members inside your CBase-derived object, because it is automatically done. Second, CBase has a virtual destructor, which is very important, because this way if a client has a pointer pointing to your object as CBase* and deletes that object, then the right destructor will be called. Example:&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;&lt;tt&gt;&lt;div align=&#039;left&#039; class=&#039;spip_code&#039; dir=&#039;ltr&#039;&gt;class CYourCBaseObject : public CBase&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;// ...&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
void AnyObject::AnyFunctionL()&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;CBase* obj = new (ELeave) CYourCBaseObject;&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;delete obj;&lt;br /&gt;
 &amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;/tt&gt;&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;You can see that we point to our newly allocated object via a CBase pointer, but despite this the right destructor will be called, when issuing &#039;delete obj;&#039;.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;Any Symbian OS programmers are encouraged to allocate memory on heap when the size of the data exceeds a certain amount of memory. For example, if you know that the size of an arbitrary string may reach (but not exceed)  500 bytes, then do not burden the stack with e.g. an TBuf&lt;500&gt; variable, but use HBufC instead.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;Finally note that R classes are usually used in client-server communications. Typical examples are RFile, RFs, RSocket. It&#039;s not always true, anyway, because for example RArray has nothing to do with C-S.&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;Cheers,&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;tOtE&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Fri, 17 Sep 2004 16:10:33 +0200</pubDate>
 <dc:creator>tOtE</dc:creator>
 <guid isPermaLink="false">comment 2 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-13</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;that was funny pablo&lt;/div&gt;</description>
 <pubDate>Sun, 14 Sep 2003 06:15:34 +0200</pubDate>
 <dc:creator>xtravaga</dc:creator>
 <guid isPermaLink="false">comment 13 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-12</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;:-) :-) :-)&lt;/div&gt;</description>
 <pubDate>Wed, 03 Sep 2003 18:05:54 +0200</pubDate>
 <dc:creator>eric</dc:creator>
 <guid isPermaLink="false">comment 12 at http://www.newlc.com</guid>
</item>
<item>
 <title>&gt; T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html#comment-11</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;&lt;p class=&quot;spip&quot;&gt;Mmh... just I was thinking of:
www.ConstructL.com  --- site under construction...... please Leave&lt;/p&gt;

&lt;p class=&quot;spip&quot;&gt;:-)
paolo&lt;/p&gt;&lt;/div&gt;</description>
 <pubDate>Wed, 03 Sep 2003 15:17:31 +0200</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 11 at http://www.newlc.com</guid>
</item>
<item>
 <title>T, C, R, M classes</title>
 <link>http://www.newlc.com/en/T-C-R-M-classes.html</link>
 <description>&lt;div class=&quot;spip-content&quot;&gt;A short overview of Symbian naming convention for classes&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/T-C-R-M-classes.html&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/T-C-R-M-classes.html#comments</comments>
 <category domain="http://www.newlc.com/en/taxonomy/term/1">Basics</category>
 <pubDate>Tue, 14 Jan 2003 19:09:50 +0100</pubDate>
 <dc:creator>eric</dc:creator>
 <guid isPermaLink="false">1 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
