foam-framework / foam2

FOAM: Feature-Oriented Active Modeller, Version 2
Apache License 2.0
73 stars 63 forks source link

MDAO.find, MultiPartID toIndex() #135

Open jacksonic opened 7 years ago

jacksonic commented 7 years ago

MutliPartID can have a new toIndex() added to generate one chained tree index per property indexed. MDAO.find_(key) takes a key that is either a value or multipart array, depending on the of:class.

In general MDAO shouldn't need to know what kind of index the MultiPartID generates. The old code that dissected the key and called get() repeatedly relied on knowing the structure of the idIndex. MultiPartID can create a KeyIndex (that accepts an array key for .get()) that hides the internal tree details. Thus calling mdao.find(obj.id) will always work, regardless of the type of ID used. It also keeps the key's array-aware code out of MDAO and under MutliPartID.

jacksonic commented 7 years ago

Related to #155