Dear Pankaj,

Thanks for your interest in FastBit.

The function getStorage is a member function of the class template
ibis::array_t.  It gives the raw pointer to the internal
representation of the array_t class.  It is usually not a good
practice to expose the internal representation of a class to the user
because this practice violates the basic principle of encapsulation.
The raw pointer allows one thread to manipulate the content of the
array object without going through the normal manipulation function.
In fact, the original array_t object could be deleted, while the
pointer returned by getStorage might still be in use, which would
cause the users to access freed memory.

If you'd like another copy of the array_t object, use the copy
constructor.  The default copy constructor performs a shallow copy,
which should give you all the necessary functionality without exposing
the internal representation of array_t object.

Hope this helps.

John




On 1/11/16 3:25 AM, pankaj modi wrote:
>  
> Hi,
> 
> While going through the Fast bit code documentation, I saw following
> comments:
> 
> Warning
>     *Likely to be removed in a future release*. Don't rely on this
>     function!
> for 
>     *ibis::fileManager::storage* getStorage() API*
> 
> And some older code also mention this API as *"Very dangarous".*
> *
> *
> Can you please guide what can be the danger in using this API? 
> 
> Thanks.
> 
> 
> _______________________________________________
> FastBit-users mailing list
> [email protected]
> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
> 
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users

Reply via email to