← Back to team overview

yade-dev team mailing list archive

Re: [Bug 544857] [NEW] Some classes still don't register with YADE_CLASS_BASE_DOC_* macros

 

int  currentIndexes [4];
with initialization in the constructor like this currentIndexes[0]=0;
    currentIndexes[1]=0;
    currentIndexes[2]=0;
    currentIndexes[3]=0;

I tried

((int,currentIndexes [4],(0.,0.,0.,0.),"Used for faster interpolation (stores previous positions in tables)")

currentIndexes[4] will not work, right...

Try ((vector<int>,currentIndexes,vector<int>(4,0),"....")) - you will make a std::vector from it, but it will be initialized to (0,0,0,0).

You could also try std::array<int,4> or such, but I don't think current serialization system handles that.

Do you need to serialize that value? If not, you can declare it in the class normally, and put the initl currentIndexes[0]=currentIndexes[1]=...=0; to the CTOR part of the horrible YADE_CLASS_BASE_DOC_ATTR_CTOR macro.


I have another problem with protected declarations (see any of the recorder where the function postProcessAttributes(bool deserializing) is used). When I leave the declaration as it was previously:
Just make that function public, don't worry.

Thanks for your work.

Vaclav



Follow ups

References