R class & RArray

Login to reply to this topic.
Mon, 2008-07-07 19:40
Joined: 2006-03-15
Forum posts: 9

Hi I can create R class object like c++ array

RMyClass mc[10];, it create 10 object in the stack
But how can I create 10 object in stack using RArray ?

If I do link the following is that ok
RArray imyarray //class member

Local variable
RMyClass obj1;

imyarray.Appand(obj1)

....
When my object obj1 goes out of scope will that object in the imyarray still valid ?

Thanks


Tue, 2008-07-08 00:55
Joined: 2006-05-08
Forum posts: 162
Re: R class & RArray

Hi neeloor,

RArray follows copy by value semantics and hence if you append something to it, a copy is made and appended to the array, which means its safe for what you are doing. The only thing to remember is that the usual rules specific to Symbian C++ still applies and you need to be careful about wonership issues, i.e. if you append a R class you should take care to close it later on etc.


Tue, 2008-07-08 13:09
Joined: 2007-01-17
Forum posts: 99
Re: R class & RArray

do it like this:

class MyClass; //some class,can be defined ltr
RArray<MYClass> iMcArray;
MyClass obj1;
iMcArray.Append(obj1);


Shashi Kiran G M

  • Login to reply to this topic.