R class

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Created: tote_b5 (22 Mar 2007)
Last edited: hamishwillee (26 Jul 2012)


R classes are proxies for objects owned elsewhere. There are two main motivations for this:

  • The real object is owned by a server in a different thread or address space, or
  • the real object’s implementation must be hidden from the client.

The following are key characteristics of R objects:

  • They contain a handle that is used to pass on requests to other objects
  • They are opened using an "open" function particular to the R class, and closed using a "close" function particular to the class. An R object must be closed once if it has been opened. Generally, the resource associated with an R object is closed automatically if the thread which opened the object terminates.
  • They have no explicit constructor, destructor, copy constructor or assignment operator.

It's also worth noting that

  • There is no common base class for all R classes
  • The initialisation function has a variety of names: also possible are Open(), Create(), Allocate(), etc.
  • The termination function has a variety of names: also possible are Close(), Destroy(), Free(), etc.
  • Since R classes own external resources, there is a requirement for cleanup: this is handled in various ways depending on the class.

See Also

This page was last modified on 26 July 2012, at 06:16.
48 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.