Nico Thanks for testing and reporting. I'd like to modify the API to be consistent with the method in UIMA Java. The two methods would be as follows: /** * Copy the contents of the array from <code>start</code> for <code>length</code> to the * destination <code>destArray</code> with destination offset <code>destOffset</code>. * * @param srcOffset The index of the first element to copy. * @param destArray The array to copy to. * @param destOffset Where to start copying into <code>dest</code>. * @param length The number of elements to copy. * @throws InvalidFSObjectException * @throws FSArrayOutOfBoundsException * If <code>srcOffset < 0</code> or <code>length > size()</code> or * <code>destOffset + length > destArray.length</code>. */ void copyToArray(size_t srcOffset, T * destArray, size_t destOffset, size_t length) const ;
/** * Copy the contents of an external array into this array. * * @param srcArray The source array. * @param srcOffset Where to start copying in the source array. * @param destOffset Where to start copying to in the destination array. * @param length The number of elements to copy. * @throws InvalidFSObjectException * @throws FSArrayOutOfBoundsException If <code>srcOffset or destOffset < 0</code> * or <code>length > size()</code> or * <code>destOffset + length > size()</code>. */ void copyFromArray(T const * srcArray, size_t srcOffset, size_t destOffset, size_t length) ; Please let me know if that would be ok , Bhavani On Fri, Jan 27, 2012 at 5:31 AM, Nico Blodow (Commented) (JIRA) < [email protected]> wrote: > > [ > https://issues.apache.org/jira/browse/UIMA-2307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194596#comment-13194596] > > Nico Blodow commented on UIMA-2307: > ----------------------------------- > > Cool, thank you Bhavani! > > There is just one minor issue left, the API says that uiEnd is supposed to > be the length, but right now it treats it as length-1, so if you want to > copy an array of length 10, you have to pass it 9 (which is the index of > the last element). > > > BasicArrayFS has two unimplemented Functions: copyToArray, copyFromArray. > > ------------------------------------------------------------------------- > > > > Key: UIMA-2307 > > URL: https://issues.apache.org/jira/browse/UIMA-2307 > > Project: UIMA > > Issue Type: Bug > > Components: C++ Framework > > Environment: Ubuntu 11.10 > > Reporter: Nico Blodow > > Assignee: Bhavani Iyer > > Fix For: 2.4.0C > > > > Attachments: > first_impl_of_copyToArray_and_copyFromArray_for_ByteArrayFS.patch > > > > > > When trying to use any non-atomic type in an ArrayFS, two functions are > vital to copy from / to the FS: > > void copyToArray (size_t uiStart, size_t uiEnd, T *destArray, size_t > uiDestOffset) const > > void copyFromArray (T const *sourceArray, size_t uiStart, size_t uiEnd, > size_t uiOffset) > > As far as I can tell, these need FSHeap::get8BitArray etc to be public. > > These raise a NotYetImplementedError. Will attach a patch if I find out > how to. > > -- > This message is automatically generated by JIRA. > If you think it was sent incorrectly, please contact your JIRA > administrators: > https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa > For more information on JIRA, see: http://www.atlassian.com/software/jira > > >
