Community: Wiki

你在这里: You Are Here: Olet tässä: Vous êtes ici: Sie befinden sich hier: Tu sei qui: 現在のページ: Você está aqui: Вы здесь: Usted está aquí:
This page was last modified 09:12, 9 December 2007.

T class

From Forum Nokia Wiki

Simple type class. T classes typically have no explicit constructor and never have a destructor. They can be allocated on the stack or heap.

T classes are generally used to encapsulate integers, booleans and simple other types, or as enumerations:

TDayOfWeek weekday; // An enumeration 
TBool doContinue = ETrue; // A boolean value
TPoint origin; // A point object having TInt X and TInt Y member variables


Notes

  • A T classes does not have a destructor as you cannot ensure that it is called in the event of a leave.
  • As a result, a T class must not own any object that requires cleanup (such as a heap-based C class object or pointer to memory on the heap, or an R class object). It is acceptable (but rare) for a T class to hold a reference to such an object owned, and cleaned up, elsewhere.
  • T class objects like the built-in types, they are returned by value, and may be passed by reference or value.
  • Member variables are not automatically zero-initialized like in C classes.
  • T classes are typically small in size, thus they're usually created on stack.


See also

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Invite a friend Invite a friend
E-mail Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us Regional websites: Chinese Japanese © 2008 Nokia 
RDF Facets: qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX