advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
There have been several suggestions to extend the functionality of RTTI. For example, the extended type info system should be able to report the size of an object dynamically, or even compose the functionality of several classes and produce a new class dynamically. Which additional features would you add to the extended RTTI system?
Partners & Affiliates
advertisement
advertisement
advertisement
Average Rating: 3.6/5 | Rate this item | 14 users have rated this item.
 

Use RTTI for Dynamic Type Identification

Runtime Type Information (RTTI) was created more than a decade ago, yet most developers remain unaware of its functions and benefits. This month's solution explains when and how you can use RTTI for dynamic type detection.  


advertisement
++ creators introduced Runtime Type Information (RTTI) more than a decade ago. Yet even today many programmers arent fully aware of its benefits and perils. In the following sections, I will show when and how you should use RTTI.



Object-oriented pundits claim that with a proper design and judicious use of virtual member function, you won't need to use RTTI. However, under certain conditions, for example, when using heterogeneous containers and root-based class hierarchies (MFC for example), dynamic type detection is sometimes unavoidable. How can you detect an objects dynamic type?



Use the built-in RTTI operators typeid and dynamic_cast.

  Next Page: Designing a Class Hierarchy
Page 1: IntroductionPage 3: Using RTTI
Page 2: Designing a Class Hierarchy 
Please rate this item (5=best)
 1  2  3  4  5
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs