Skip to content
Snippets Groups Projects
Commit 3dfadf0c authored by Philippe Canal's avatar Philippe Canal
Browse files

The array elements can be retrieved with:

    TObject *obj = array.At(i);                                        
                                                                       
By default the TRefArray 'points' to the current process and can only    
receive object that have been created in this process.                 
To point the TRefArray to a different process do:                      
    TRefArray array( processId );                                      
                                                                       
For example, if 'obj' is an instance that was created in the different 
process and you do:                                                    
    TRefArray array( TProcessID::GetProcessWithUID( obj ) );           
Then                                                                  
    array.Add(obj);                                                  
is correct (obj comes from the process the array is pointed to       
while                                                                
    TObject *nobj = new TObject;                                     
    array.Add(nobj);                                                 
is incorrect since 'nobj' was created in a different process than the
one the array is pointed to.  In thi case you will see error message:
     Error in <TRefArray::AddAtAndExpand>: The object at 0x... is not registered in the process the TRefArray point to (pid = ProcessID../....)


git-svn-id: http://root.cern.ch/svn/root/trunk@23059 27541ba8-7e3a-0410-8455-c3a389f83636
parent 09af0c1f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment