[vtk-developers] Using STL containers as part of the API of a utility class
George Zagaris
george.zagaris at kitware.com
Tue Apr 3 10:57:18 EDT 2012
Thanks for your feedback. Might as well not break VTK style guidelines
and stick with vtkStringArray and vtkIntArray. I will submit another
patch.
Best,
George
On Tue, Apr 3, 2012 at 10:41 AM, Andy Bauer <andy.bauer at kitware.com> wrote:
> Since it's all static methods and no classes will derive from it, I was
> thinking something along the lines of:
> static void DeserializeMetaData(
> vtkMultiProcessStream& bytestream,
> std::vector<std::string> &names, std::vector<int> &datatypes,
> std::vector<int> &dimensions);
>
> Using a vtkStringArray and vtkIntArrays though would work out just as well
> though.
>
> Both of them are much better than allocating memory in the function and
> expecting the user to delete them afterwards.
>
> Andy
>
> On Mon, Apr 2, 2012 at 9:54 PM, George Zagaris <george.zagaris at kitware.com>
> wrote:
>>
>> On Mon, Apr 2, 2012 at 9:34 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>> > Almost anything is better than "std::string* &names". The odds are
>> > slim to none that an arg like that will ever be wrapped ;)
>> >
>> > Any reason for not using vtkStringArray and vtkIntArray? Are you
>> > concerned about their efficiency?
>>
>> Efficiency is not a huge concern for this method since field data
>> metadata is relatively small. I would prefer a lighter API, but, I am
>> not against changing the method to use vtkStringArray and vtkIntArray.
>>
>> Thanks for your feedback.
>>
>> Best,
>> George
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>
More information about the vtk-developers
mailing list