Hello Carsten,
On 2018-05-15 16:33, Carsten wrote:
On 15.05.2018 16:10, Johannes wrote:
>> The FieldContainerMap does work great in the app session but does not
>> work with persistence. I stored my class in an OSB file and load that
>> file in separate session. The FieldContainerMap does contains the
>> respective entries but the mapped FieldContainer do not correspond to
>> the containers which I used for storing in the first place.
> I think for maps you'll have to add support to the OSB loader/writer.
> IIRC it can not figure out on its own that there are pointers to
> objects that need serialization.
> I think that was also be the reason some places use a string to
> int map and a MField of FC Ptr to achieve map like behavior.
I feared that. I will not touch the OSG loader/writer at the moment
because I'm not comfortable with the implementation details of this kind
of stuff.
However, yesterday I have taken a different route and build a poor man's
version of a map, i.e. I have created a FieldContainer (KeyValue)
holding a string and a FieldContainerPtr and created another
FieldContainer (StringToFieldContainerMap) containing a sorted multi
field of KeyValue elements. This way access is O(log N), insert and
erase is O(N). Also the overhead due to the KeyValue container is
considerable, but I am fine with that.
Best,
Johannes
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users